CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes
METMonitor Class Reference

#include <METMonitor.h>

Inheritance diagram for METMonitor:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 METMonitor (const edm::ParameterSet &)
 
 ~METMonitor ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillHistoLSPSetDescription (edm::ParameterSetDescription &pset)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookME (DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
 
void bookME (DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX)
 
void bookME (DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, int nbinsY, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY)
 
void setMETitle (METME &me, std::string titleX, std::string titleY)
 
- 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)
 

Static Private Member Functions

static MEbinning getHistoLSPSet (edm::ParameterSet pset)
 
static MEbinning getHistoPSet (edm::ParameterSet pset)
 

Private Attributes

GenericTriggerEventFlagden_genTriggerEventFlag_
 
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
 
edm::EDGetTokenT< reco::GsfElectronCollectioneleToken_
 
std::string folderName_
 
std::string histoSuffix_
 
StringCutObjectSelector< reco::PFJet, true > jetSelection_
 
edm::EDGetTokenT< reco::PFJetCollectionjetToken_
 
MEbinning ls_binning_
 
MEbinning met_binning_
 
std::vector< double > met_variable_binning_
 
METME metME_
 
METME metME_variableBinning_
 
METME metPhiME_
 
StringCutObjectSelector< reco::MET, true > metSelection_
 
edm::EDGetTokenT< reco::PFMETCollectionmetToken_
 
METME metVsLS_
 
StringCutObjectSelector< reco::Muon, true > muoSelection_
 
edm::EDGetTokenT< reco::MuonCollectionmuoToken_
 
int nelectrons_
 
int njets_
 
int nmuons_
 
GenericTriggerEventFlagnum_genTriggerEventFlag_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 56 of file METMonitor.h.

Constructor & Destructor Documentation

METMonitor::METMonitor ( const edm::ParameterSet iConfig)

Definition at line 19 of file METMonitor.cc.

References METME::denominator, metME_, metME_variableBinning_, metPhiME_, metVsLS_, and METME::numerator.

19  :
20  folderName_ ( iConfig.getParameter<std::string>("FolderName") )
21  , metToken_ ( consumes<reco::PFMETCollection> (iConfig.getParameter<edm::InputTag>("met") ) )
22  , jetToken_ ( mayConsume<reco::PFJetCollection> (iConfig.getParameter<edm::InputTag>("jets") ) )
23  , eleToken_ ( mayConsume<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("electrons") ) )
24  , muoToken_ ( mayConsume<reco::MuonCollection> (iConfig.getParameter<edm::InputTag>("muons") ) )
25  , met_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning") )
26  , met_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("metPSet") ) )
28  , num_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"),consumesCollector(), *this))
29  , den_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"),consumesCollector(), *this))
30  , metSelection_ ( iConfig.getParameter<std::string>("metSelection") )
31  , jetSelection_ ( iConfig.getParameter<std::string>("jetSelection") )
32  , eleSelection_ ( iConfig.getParameter<std::string>("eleSelection") )
33  , muoSelection_ ( iConfig.getParameter<std::string>("muoSelection") )
34  , njets_ ( iConfig.getParameter<int>("njets" ) )
35  , nelectrons_ ( iConfig.getParameter<int>("nelectrons" ) )
36  , nmuons_ ( iConfig.getParameter<int>("nmuons" ) )
37 {
38 
39  metME_.numerator = nullptr;
40  metME_.denominator = nullptr;
43  metVsLS_.numerator = nullptr;
44  metVsLS_.denominator = nullptr;
45  metPhiME_.numerator = nullptr;
46  metPhiME_.denominator = nullptr;
47 
48 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
T getParameter(std::string const &) const
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.h:104
GenericTriggerEventFlag * den_genTriggerEventFlag_
Definition: METMonitor.h:99
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:103
METME metME_variableBinning_
Definition: METMonitor.h:94
std::string folderName_
Definition: METMonitor.h:81
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:102
static MEbinning getHistoPSet(edm::ParameterSet pset)
Definition: METMonitor.cc:56
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:86
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MEbinning met_binning_
Definition: METMonitor.h:90
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:85
static MEbinning getHistoLSPSet(edm::ParameterSet pset)
Definition: METMonitor.cc:65
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:84
GenericTriggerEventFlag * num_genTriggerEventFlag_
Definition: METMonitor.h:98
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:87
MonitorElement * denominator
Definition: BPHMonitor.h:46
std::vector< double > met_variable_binning_
Definition: METMonitor.h:89
METME metPhiME_
Definition: METMonitor.h:96
METME metVsLS_
Definition: METMonitor.h:95
MEbinning ls_binning_
Definition: METMonitor.h:91
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:101
int nelectrons_
Definition: METMonitor.h:106
METME metME_
Definition: METMonitor.h:93
METMonitor::~METMonitor ( )

Definition at line 50 of file METMonitor.cc.

References den_genTriggerEventFlag_, and num_genTriggerEventFlag_.

51 {
54 }
GenericTriggerEventFlag * den_genTriggerEventFlag_
Definition: METMonitor.h:99
GenericTriggerEventFlag * num_genTriggerEventFlag_
Definition: METMonitor.h:98

Member Function Documentation

void METMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 155 of file METMonitor.cc.

References GenericTriggerEventFlag::accept(), den_genTriggerEventFlag_, METME::denominator, MillePedeFileConverter_cfg::e, genericTrackCleaner_cfi::electrons, eleSelection_, eleToken_, HcalObjRepresent::Fill(), edm::Event::getByToken(), edm::EventBase::id(), fwrapper::jets, jetSelection_, jetToken_, eostools::ls(), edm::EventID::luminosityBlock(), funct::m, RazorAnalyzer::met, metME_, metME_variableBinning_, metPhiME_, metSelection_, metToken_, metVsLS_, electronCleaner_cfi::muons, muoSelection_, muoToken_, nelectrons_, njets_, nmuons_, num_genTriggerEventFlag_, METME::numerator, GenericTriggerEventFlag::on(), phi, reco::LeafCandidate::phi(), and reco::LeafCandidate::pt().

155  {
156 
157  // Filter out events if Trigger Filtering is requested
158  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
159 
161  iEvent.getByToken( metToken_, metHandle );
162  reco::PFMET pfmet = metHandle->front();
163  if ( ! metSelection_( pfmet ) ) return;
164 
165  float met = pfmet.pt();
166  float phi = pfmet.phi();
167 
169  iEvent.getByToken( jetToken_, jetHandle );
170  std::vector<reco::PFJet> jets;
171  if ( int(jetHandle->size()) < njets_ ) return;
172  for ( auto const & j : *jetHandle ) {
173  if ( jetSelection_( j ) ) jets.push_back(j);
174  }
175  if ( int(jets.size()) < njets_ ) return;
176 
178  iEvent.getByToken( eleToken_, eleHandle );
179  std::vector<reco::GsfElectron> electrons;
180  if ( int(eleHandle->size()) < nelectrons_ ) return;
181  for ( auto const & e : *eleHandle ) {
182  if ( eleSelection_( e ) ) electrons.push_back(e);
183  }
184  if ( int(electrons.size()) < nelectrons_ ) return;
185 
187  iEvent.getByToken( muoToken_, muoHandle );
188  if ( int(muoHandle->size()) < nmuons_ ) return;
189  std::vector<reco::Muon> muons;
190  for ( auto const & m : *muoHandle ) {
191  if ( muoSelection_( m ) ) muons.push_back(m);
192  }
193  if ( int(muons.size()) < nmuons_ ) return;
194 
195  // filling histograms (denominator)
196  metME_.denominator -> Fill(met);
198  metPhiME_.denominator -> Fill(phi);
199 
200  int ls = iEvent.id().luminosityBlock();
201  metVsLS_.denominator -> Fill(ls, met);
202 
203  // applying selection for numerator
204  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
205 
206  // filling histograms (num_genTriggerEventFlag_)
207  metME_.numerator -> Fill(met);
209  metPhiME_.numerator -> Fill(phi);
210  metVsLS_.numerator -> Fill(ls, met);
211 
212 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
virtual double pt() const final
transverse momentum
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.h:104
GenericTriggerEventFlag * den_genTriggerEventFlag_
Definition: METMonitor.h:99
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:103
METME metME_variableBinning_
Definition: METMonitor.h:94
virtual double phi() const final
momentum azimuthal angle
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:102
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:86
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:85
vector< PseudoJet > jets
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:84
GenericTriggerEventFlag * num_genTriggerEventFlag_
Definition: METMonitor.h:98
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:87
MonitorElement * denominator
Definition: BPHMonitor.h:46
def ls(path, rec=False)
Definition: eostools.py:348
met
===> hadronic RAZOR
METME metPhiME_
Definition: METMonitor.h:96
METME metVsLS_
Definition: METMonitor.h:95
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:101
int nelectrons_
Definition: METMonitor.h:106
METME metME_
Definition: METMonitor.h:93
void METMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 119 of file METMonitor.cc.

References bookME(), den_genTriggerEventFlag_, folderName_, GenericTriggerEventFlag::initRun(), ls_binning_, met_binning_, met_variable_binning_, metME_, metME_variableBinning_, metPhiME_, metVsLS_, MEbinning::nbins, num_genTriggerEventFlag_, GenericTriggerEventFlag::on(), phi_binning_, DQMStore::IBooker::setCurrentFolder(), setMETitle(), AlCaHLTBitMon_QueryRunRegistry::string, MEbinning::xmax, and MEbinning::xmin.

122 {
123 
124  std::string histname, histtitle;
125 
126  std::string currentFolder = folderName_ ;
127  ibooker.setCurrentFolder(currentFolder.c_str());
128 
129  histname = "met"; histtitle = "PFMET";
130  bookME(ibooker,metME_,histname,histtitle,met_binning_.nbins,met_binning_.xmin, met_binning_.xmax);
131  setMETitle(metME_,"PF MET [GeV]","events / [GeV]");
132 
133  histname = "met_variable"; histtitle = "PFMET";
134  bookME(ibooker,metME_variableBinning_,histname,histtitle,met_variable_binning_);
135  setMETitle(metME_variableBinning_,"PF MET [GeV]","events / [GeV]");
136 
137  histname = "metVsLS"; histtitle = "PFMET vs LS";
139  setMETitle(metVsLS_,"LS","PF MET [GeV]");
140 
141  histname = "metPhi"; histtitle = "PFMET phi";
142  bookME(ibooker,metPhiME_,histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
143  setMETitle(metPhiME_,"PF MET #phi","events / 0.1 rad");
144 
145  // Initialize the GenericTriggerEventFlag
148 
149 }
const MEbinning phi_binning_
Definition: METMonitor.cc:12
GenericTriggerEventFlag * den_genTriggerEventFlag_
Definition: METMonitor.h:99
METME metME_variableBinning_
Definition: METMonitor.h:94
std::string folderName_
Definition: METMonitor.h:81
MEbinning met_binning_
Definition: METMonitor.h:90
double xmin
Definition: LumiMonitor.h:30
GenericTriggerEventFlag * num_genTriggerEventFlag_
Definition: METMonitor.h:98
void setMETitle(METME &me, std::string titleX, std::string titleY)
Definition: METMonitor.cc:74
void bookME(DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: METMonitor.cc:83
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::vector< double > met_variable_binning_
Definition: METMonitor.h:89
METME metPhiME_
Definition: METMonitor.h:96
METME metVsLS_
Definition: METMonitor.h:95
MEbinning ls_binning_
Definition: METMonitor.h:91
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
METME metME_
Definition: METMonitor.h:93
double xmax
Definition: LumiMonitor.h:31
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbins,
double  xmin,
double  xmax 
)
protected

Definition at line 83 of file METMonitor.cc.

References DQMStore::IBooker::book1D(), METME::denominator, and METME::numerator.

Referenced by bookHistograms().

84 {
85  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, min, max);
86  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, min, max);
87 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * denominator
Definition: BPHMonitor.h:46
T min(T a, T b)
Definition: MathUtil.h:58
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX 
)
protected

Definition at line 88 of file METMonitor.cc.

References DQMStore::IBooker::book1D(), METME::denominator, pileupCalc::nbins, and METME::numerator.

89 {
90  int nbins = binning.size()-1;
91  std::vector<float> fbinning(binning.begin(),binning.end());
92  float* arr = &fbinning[0];
93  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, arr);
94  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, arr);
95 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * denominator
Definition: BPHMonitor.h:46
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
protected

Definition at line 96 of file METMonitor.cc.

References DQMStore::IBooker::bookProfile(), METME::denominator, and METME::numerator.

97 {
98  me.numerator = ibooker.bookProfile(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
99  me.denominator = ibooker.bookProfile(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
100 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
MonitorElement * denominator
Definition: BPHMonitor.h:46
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
int  nbinsY,
double  ymin,
double  ymax 
)
protected

Definition at line 101 of file METMonitor.cc.

References DQMStore::IBooker::book2D(), METME::denominator, and METME::numerator.

102 {
103  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
104  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
105 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
MonitorElement * denominator
Definition: BPHMonitor.h:46
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX,
const std::vector< double > &  binningY 
)
protected

Definition at line 106 of file METMonitor.cc.

References DQMStore::IBooker::book2D(), METME::denominator, and METME::numerator.

107 {
108  int nbinsX = binningX.size()-1;
109  std::vector<float> fbinningX(binningX.begin(),binningX.end());
110  float* arrX = &fbinningX[0];
111  int nbinsY = binningY.size()-1;
112  std::vector<float> fbinningY(binningY.begin(),binningY.end());
113  float* arrY = &fbinningY[0];
114 
115  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, arrX, nbinsY, arrY);
116  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, arrX, nbinsY, arrY);
117 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
MonitorElement * denominator
Definition: BPHMonitor.h:46
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void METMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 226 of file METMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), create_public_pileup_plots::bins, DEFINE_FWK_MODULE, fillHistoLSPSetDescription(), fillHistoPSetDescription(), and AlCaHLTBitMon_QueryRunRegistry::string.

227 {
229  desc.add<std::string> ( "FolderName", "HLT/MET" );
230 
231  desc.add<edm::InputTag>( "met", edm::InputTag("pfMet") );
232  desc.add<edm::InputTag>( "jets", edm::InputTag("ak4PFJetsCHS") );
233  desc.add<edm::InputTag>( "electrons",edm::InputTag("gedGsfElectrons") );
234  desc.add<edm::InputTag>( "muons", edm::InputTag("muons") );
235  desc.add<std::string>("metSelection", "pt > 0");
236  desc.add<std::string>("jetSelection", "pt > 0");
237  desc.add<std::string>("eleSelection", "pt > 0");
238  desc.add<std::string>("muoSelection", "pt > 0");
239  desc.add<int>("njets", 0);
240  desc.add<int>("nelectrons", 0);
241  desc.add<int>("nmuons", 0);
242 
243  edm::ParameterSetDescription genericTriggerEventPSet;
244  genericTriggerEventPSet.add<bool>("andOr");
245  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi") );
246  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions",{});
247  genericTriggerEventPSet.add<bool>("andOrDcs", false);
248  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
249  genericTriggerEventPSet.add<std::string>("dbLabel","");
250  genericTriggerEventPSet.add<bool>("andOrHlt", true);
251  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT") );
252  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths",{});
253  genericTriggerEventPSet.add<std::string>("hltDBKey","");
254  genericTriggerEventPSet.add<bool>("errorReplyHlt",false);
255  genericTriggerEventPSet.add<unsigned int>("verbosityLevel",1);
256 
257  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
258  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
259 
262  fillHistoPSetDescription(metPSet);
263  histoPSet.add<edm::ParameterSetDescription>("metPSet", metPSet);
264  std::vector<double> bins = {0.,20.,40.,60.,80.,90.,100.,110.,120.,130.,140.,150.,160.,170.,180.,190.,200.,220.,240.,260.,280.,300.,350.,400.,450.,1000.};
265  histoPSet.add<std::vector<double> >("metBinning", bins);
266 
269  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
270 
271  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
272 
273  descriptions.add("metMonitoring", desc);
274 }
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:214
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:221
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void METMonitor::fillHistoLSPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 221 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

222 {
223  pset.add<int> ( "nbins", 2500);
224 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void METMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 214 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

215 {
216  pset.add<int> ( "nbins");
217  pset.add<double>( "xmin" );
218  pset.add<double>( "xmax" );
219 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MEbinning METMonitor::getHistoLSPSet ( edm::ParameterSet  pset)
staticprivate

Definition at line 65 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

66 {
67  return MEbinning{
68  pset.getParameter<int32_t>("nbins"),
69  0.,
70  double(pset.getParameter<int32_t>("nbins"))
71  };
72 }
T getParameter(std::string const &) const
MEbinning METMonitor::getHistoPSet ( edm::ParameterSet  pset)
staticprivate

Definition at line 56 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

57 {
58  return MEbinning{
59  pset.getParameter<int32_t>("nbins"),
60  pset.getParameter<double>("xmin"),
61  pset.getParameter<double>("xmax"),
62  };
63 }
T getParameter(std::string const &) const
void METMonitor::setMETitle ( METME me,
std::string  titleX,
std::string  titleY 
)
protected

Definition at line 74 of file METMonitor.cc.

References METME::denominator, METME::numerator, and MonitorElement::setAxisTitle().

Referenced by bookHistograms().

75 {
76  me.numerator->setAxisTitle(titleX,1);
77  me.numerator->setAxisTitle(titleY,2);
78  me.denominator->setAxisTitle(titleX,1);
79  me.denominator->setAxisTitle(titleY,2);
80 
81 }
MonitorElement * numerator
Definition: BPHMonitor.h:45
MonitorElement * denominator
Definition: BPHMonitor.h:46
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

GenericTriggerEventFlag* METMonitor::den_genTriggerEventFlag_
private

Definition at line 99 of file METMonitor.h.

Referenced by analyze(), bookHistograms(), and ~METMonitor().

StringCutObjectSelector<reco::GsfElectron,true> METMonitor::eleSelection_
private

Definition at line 103 of file METMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::GsfElectronCollection> METMonitor::eleToken_
private

Definition at line 86 of file METMonitor.h.

Referenced by analyze().

std::string METMonitor::folderName_
private

Definition at line 81 of file METMonitor.h.

Referenced by bookHistograms().

std::string METMonitor::histoSuffix_
private

Definition at line 82 of file METMonitor.h.

StringCutObjectSelector<reco::PFJet,true > METMonitor::jetSelection_
private

Definition at line 102 of file METMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFJetCollection> METMonitor::jetToken_
private

Definition at line 85 of file METMonitor.h.

Referenced by analyze().

MEbinning METMonitor::ls_binning_
private

Definition at line 91 of file METMonitor.h.

Referenced by bookHistograms().

MEbinning METMonitor::met_binning_
private

Definition at line 90 of file METMonitor.h.

Referenced by bookHistograms().

std::vector<double> METMonitor::met_variable_binning_
private

Definition at line 89 of file METMonitor.h.

Referenced by bookHistograms().

METME METMonitor::metME_
private

Definition at line 93 of file METMonitor.h.

Referenced by analyze(), bookHistograms(), and METMonitor().

METME METMonitor::metME_variableBinning_
private

Definition at line 94 of file METMonitor.h.

Referenced by analyze(), bookHistograms(), and METMonitor().

METME METMonitor::metPhiME_
private

Definition at line 96 of file METMonitor.h.

Referenced by analyze(), bookHistograms(), and METMonitor().

StringCutObjectSelector<reco::MET,true> METMonitor::metSelection_
private

Definition at line 101 of file METMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFMETCollection> METMonitor::metToken_
private

Definition at line 84 of file METMonitor.h.

Referenced by analyze().

METME METMonitor::metVsLS_
private

Definition at line 95 of file METMonitor.h.

Referenced by analyze(), bookHistograms(), and METMonitor().

StringCutObjectSelector<reco::Muon,true> METMonitor::muoSelection_
private

Definition at line 104 of file METMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::MuonCollection> METMonitor::muoToken_
private

Definition at line 87 of file METMonitor.h.

Referenced by analyze().

int METMonitor::nelectrons_
private

Definition at line 106 of file METMonitor.h.

Referenced by analyze().

int METMonitor::njets_
private

Definition at line 105 of file METMonitor.h.

Referenced by analyze().

int METMonitor::nmuons_
private

Definition at line 107 of file METMonitor.h.

Referenced by analyze().

GenericTriggerEventFlag* METMonitor::num_genTriggerEventFlag_
private

Definition at line 98 of file METMonitor.h.

Referenced by analyze(), bookHistograms(), and ~METMonitor().