CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFJetDQMAnalyzer Class Reference

#include <PFJetDQMAnalyzer.h>

Inheritance diagram for PFJetDQMAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 PFJetDQMAnalyzer (const edm::ParameterSet &parameterSet)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginJob ()
 
void endJob ()
 
void storeBadEvents (edm::Event const &, float &val)
 

Private Attributes

std::string benchmarkLabel_
 
edm::InputTag inputLabel_
 
edm::InputTag matchLabel_
 
edm::EDGetTokenT< edm::View
< reco::Jet > > 
myJet_
 
edm::EDGetTokenT< edm::View
< reco::Jet > > 
myMatchedJet_
 
int nBadEvents_
 
PFJetMonitor pfJetMonitor_
 
edm::ParameterSet pSet_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file PFJetDQMAnalyzer.h.

Constructor & Destructor Documentation

PFJetDQMAnalyzer::PFJetDQMAnalyzer ( const edm::ParameterSet parameterSet)

Definition at line 22 of file PFJetDQMAnalyzer.cc.

References benchmarkLabel_, edm::ParameterSet::getParameter(), inputLabel_, matchLabel_, myJet_, myMatchedJet_, edm::parameterSet(), pfJetMonitor_, pSet_, PFJetMonitor::setParameters(), and AlCaHLTBitMon_QueryRunRegistry::string.

24 {
26  inputLabel_ = pSet_.getParameter<edm::InputTag>("InputCollection");
27  matchLabel_ = pSet_.getParameter<edm::InputTag>("MatchCollection");
28  benchmarkLabel_ = pSet_.getParameter<std::string>("BenchmarkLabel");
29 
30  pfJetMonitor_.setParameters(parameterSet); // set parameters for booking histograms and validating jet
31 
32  myJet_ = consumes< edm::View<reco::Jet> >(inputLabel_);
33  myMatchedJet_ = consumes< edm::View<reco::Jet> >(matchLabel_);
34 }
T getParameter(std::string const &) const
edm::InputTag inputLabel_
PFJetMonitor pfJetMonitor_
void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool fracHistoFlag=true)
set the parameters locally
Definition: PFJetMonitor.cc:64
std::string benchmarkLabel_
edm::EDGetTokenT< edm::View< reco::Jet > > myMatchedJet_
edm::ParameterSet pSet_
edm::InputTag matchLabel_
edm::EDGetTokenT< edm::View< reco::Jet > > myJet_
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11

Member Function Documentation

void PFJetDQMAnalyzer::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 51 of file PFJetDQMAnalyzer.cc.

References PFJetMonitor::fill(), edm::Event::getByToken(), edm::ParameterSet::getParameter(), edm::HandleBase::isValid(), myJet_, myMatchedJet_, nBadEvents_, pfJetMonitor_, pSet_, and storeBadEvents().

52  {
53 
54  edm::Handle< edm::View<reco::Jet> > jetCollection;
55  iEvent.getByToken(myJet_, jetCollection);
56 
57  edm::Handle< edm::View<reco::Jet> > matchedJetCollection;
58  iEvent.getByToken(myMatchedJet_, matchedJetCollection);
59 
60  float maxRes = 0.0;
61  float minRes = 99.99;
62  float jetpT = 0.0;
63  if (jetCollection.isValid() && matchedJetCollection.isValid()) {
64  //pfJetMonitor_.fill( *jetCollection, *matchedJetCollection, minRes, maxRes); // match collections and fill pt eta phi and charge histos for candidate jet, fill delta_x_VS_y histos for matched couples, book and fill delta_frac_VS_frac histos for matched couples
65  pfJetMonitor_.fill( *jetCollection, *matchedJetCollection, minRes, maxRes, jetpT, pSet_); // match collections and fill pt eta phi and charge histos for candidate jet, fill delta_x_VS_y histos for matched couples, book and fill delta_frac_VS_frac histos for matched couples
66  edm::ParameterSet skimPS = pSet_.getParameter<edm::ParameterSet>("SkimParameter");
67  if ( (skimPS.getParameter<bool>("switchOn")) &&
68  (nBadEvents_ <= skimPS.getParameter<int32_t>("maximumNumberToBeStored")) ) {
69  if (jetpT > skimPS.getParameter<double>("minimumJetpT")) {
70  if ( minRes < skimPS.getParameter<double>("lowerCutOffOnResolution")) {
71  storeBadEvents(iEvent,minRes);
72  nBadEvents_++;
73  } else if (maxRes > skimPS.getParameter<double>("upperCutOffOnResolution")) {
74  storeBadEvents(iEvent,maxRes);
75  nBadEvents_++;
76  }
77  } // minimum jet pT check
78  }
79  }
80 }
T getParameter(std::string const &) const
void storeBadEvents(edm::Event const &, float &val)
PFJetMonitor pfJetMonitor_
void fill(const T &jetCollection, const C &matchedJetCollection, float &minVal, float &maxVal)
fill histograms with all particle
Definition: PFJetMonitor.h:81
int iEvent
Definition: GenABIO.cc:230
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< edm::View< reco::Jet > > myMatchedJet_
edm::ParameterSet pSet_
edm::EDGetTokenT< edm::View< reco::Jet > > myJet_
void PFJetDQMAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 38 of file PFJetDQMAnalyzer.cc.

References benchmarkLabel_, Benchmark::DQM_, nBadEvents_, cppFunctionSkipper::operator, cmsHarvester::path, pfJetMonitor_, pSet_, DQMStore::setCurrentFolder(), PFJetMonitor::setup(), and AlCaHLTBitMon_QueryRunRegistry::string.

38  {
39 
41  // part of the following could be put in the base class
42  std::string path = "ParticleFlow/" + benchmarkLabel_;
44  edm::LogInfo("PFJetDQMAnalyzer") << " PFJetDQMAnalyzer::beginJob " << "Histogram Folder path set to "<< path;
45  pfJetMonitor_.setup(pSet_); // booking histograms of type delta_frac_VS_frac from PFJetMonitor, pt_ eta_ phi_ and charge_ from CandidateBenchmark, delta_x_VS_y from MatchCandidateBenchmark
46  nBadEvents_ = 0;
47 }
PFJetMonitor pfJetMonitor_
static DQMStore * DQM_
Definition: Benchmark.h:40
tuple path
else: Piece not in the list, fine.
void setup()
book histograms
std::string benchmarkLabel_
edm::ParameterSet pSet_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void PFJetDQMAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file PFJetDQMAnalyzer.cc.

98  {
99 }
void PFJetDQMAnalyzer::storeBadEvents ( edm::Event const &  iEvent,
float &  val 
)
private

Definition at line 81 of file PFJetDQMAnalyzer.cc.

References benchmarkLabel_, DQMStore::bookFloat(), Benchmark::DQM_, edm::EventID::event(), MonitorElement::Fill(), DQMStore::get(), edm::EventBase::id(), edm::EventID::luminosityBlock(), cmsHarvester::path, MonitorElement::Reset(), edm::EventID::run(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

81  {
82  unsigned int runNb = iEvent.id().run();
83  unsigned int evtNb = iEvent.id().event();
84  unsigned int lumiNb = iEvent.id().luminosityBlock();
85 
86  std::string path = "ParticleFlow/" + benchmarkLabel_ + "/BadEvents";
87  Benchmark::DQM_->setCurrentFolder(path.c_str());
88  std::ostringstream eventid_str;
89  eventid_str << runNb << "_"<< evtNb << "_" << lumiNb;
90  MonitorElement* me = Benchmark::DQM_->get(path + "/" + eventid_str.str());
91  if (me) me->Reset();
92  else me = Benchmark::DQM_->bookFloat(eventid_str.str());
93  me->Fill(val);
94 }
static DQMStore * DQM_
Definition: Benchmark.h:40
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:891
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:230
tuple path
else: Piece not in the list, fine.
std::string benchmarkLabel_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
void Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667

Member Data Documentation

std::string PFJetDQMAnalyzer::benchmarkLabel_
private

Definition at line 30 of file PFJetDQMAnalyzer.h.

Referenced by beginJob(), PFJetDQMAnalyzer(), and storeBadEvents().

edm::InputTag PFJetDQMAnalyzer::inputLabel_
private

Definition at line 29 of file PFJetDQMAnalyzer.h.

Referenced by PFJetDQMAnalyzer().

edm::InputTag PFJetDQMAnalyzer::matchLabel_
private

Definition at line 28 of file PFJetDQMAnalyzer.h.

Referenced by PFJetDQMAnalyzer().

edm::EDGetTokenT< edm::View<reco::Jet> > PFJetDQMAnalyzer::myJet_
private

Definition at line 26 of file PFJetDQMAnalyzer.h.

Referenced by analyze(), and PFJetDQMAnalyzer().

edm::EDGetTokenT< edm::View<reco::Jet> > PFJetDQMAnalyzer::myMatchedJet_
private

Definition at line 27 of file PFJetDQMAnalyzer.h.

Referenced by analyze(), and PFJetDQMAnalyzer().

int PFJetDQMAnalyzer::nBadEvents_
private

Definition at line 36 of file PFJetDQMAnalyzer.h.

Referenced by analyze(), and beginJob().

PFJetMonitor PFJetDQMAnalyzer::pfJetMonitor_
private

Definition at line 32 of file PFJetDQMAnalyzer.h.

Referenced by analyze(), beginJob(), and PFJetDQMAnalyzer().

edm::ParameterSet PFJetDQMAnalyzer::pSet_
private

Definition at line 34 of file PFJetDQMAnalyzer.h.

Referenced by analyze(), beginJob(), and PFJetDQMAnalyzer().