CMS 3D CMS Logo

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

#include <METMonitor.h>

Inheritance diagram for METMonitor:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  MEbinning
 
struct  METME
 

Public Member Functions

 METMonitor (const edm::ParameterSet &)
 
 ~METMonitor () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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 edm::one::EDProducerBase
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, const std::string &titleX, const 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 (const edm::ParameterSet &pset)
 
static MEbinning getHistoPSet (const edm::ParameterSet &pset)
 

Private Attributes

METME deltaphij1j2ME_
 
METME deltaphimetj1ME_
 
std::unique_ptr< 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_
 
unsigned nelectrons_
 
unsigned njets_
 
unsigned nmuons_
 
std::unique_ptr< GenericTriggerEventFlagnum_genTriggerEventFlag_
 
edm::EDGetTokenT< reco::VertexCollectionvtxToken_
 

Static Private Attributes

static double MAX_PHI = 3.2
 
static int N_PHI = 64
 
static MEbinning phi_binning_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 49 of file METMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file METMonitor.cc.

References ~METMonitor().

15  :
16  folderName_ ( iConfig.getParameter<std::string>("FolderName") )
17  , metToken_ ( consumes<reco::PFMETCollection> (iConfig.getParameter<edm::InputTag>("met") ) )
18  , jetToken_ ( mayConsume<reco::PFJetCollection> (iConfig.getParameter<edm::InputTag>("jets") ) )
19  , eleToken_ ( mayConsume<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("electrons") ) )
20  , muoToken_ ( mayConsume<reco::MuonCollection> (iConfig.getParameter<edm::InputTag>("muons") ) )
21  , vtxToken_ ( mayConsume<reco::VertexCollection> (iConfig.getParameter<edm::InputTag>("vertices") ) )
22  , met_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning") )
23  , met_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("metPSet") ) )
24  , ls_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("lsPSet") ) )
25  , num_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"),consumesCollector(), *this))
26  , den_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"),consumesCollector(), *this))
27  , metSelection_ ( iConfig.getParameter<std::string>("metSelection") )
28  , jetSelection_ ( iConfig.getParameter<std::string>("jetSelection") )
29  , eleSelection_ ( iConfig.getParameter<std::string>("eleSelection") )
30  , muoSelection_ ( iConfig.getParameter<std::string>("muoSelection") )
31  , njets_ ( iConfig.getParameter<unsigned>("njets" ) )
32  , nelectrons_ ( iConfig.getParameter<unsigned>("nelectrons" ) )
33  , nmuons_ ( iConfig.getParameter<unsigned>("nmuons" ) )
34 {
35 }
T getParameter(std::string const &) const
unsigned nmuons_
Definition: METMonitor.h:118
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:109
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: METMonitor.cc:39
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.h:95
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:114
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:108
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:113
std::string folderName_
Definition: METMonitor.h:88
unsigned njets_
Definition: METMonitor.h:116
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:112
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:93
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MEbinning met_binning_
Definition: METMonitor.h:98
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:92
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:91
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:94
unsigned nelectrons_
Definition: METMonitor.h:117
std::vector< double > met_variable_binning_
Definition: METMonitor.h:97
MEbinning ls_binning_
Definition: METMonitor.h:99
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:111
METMonitor::~METMonitor ( )
overridedefault

Referenced by METMonitor().

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 146 of file METMonitor.cc.

References hiPixelPairStep_cff::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, METMonitor::METME::denominator, MillePedeFileConverter_cfg::e, electrons_cff::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_, nano_cff::muons, muoSelection_, muoToken_, nelectrons_, njets_, nmuons_, num_genTriggerEventFlag_, METMonitor::METME::numerator, phi, reco::LeafCandidate::phi(), reco::Vertex::position(), reco::LeafCandidate::pt(), findQualityFiles::v, badGlobalMuonTaggersAOD_cff::vtx, and vtxToken_.

146  {
147  // Filter out events if Trigger Filtering is requested
148  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
150  iEvent.getByToken( metToken_, metHandle );
151  reco::PFMET pfmet = metHandle->front();
152  if ( ! metSelection_( pfmet ) ) return;
153 
154  float met = pfmet.pt();
155  float phi = pfmet.phi();
157  iEvent.getByToken( jetToken_, jetHandle );
158  std::vector<reco::PFJet> jets;
159  if ( jetHandle->size() < njets_ ) return;
160  for ( auto const & j : *jetHandle ) {
161  if ( jetSelection_(j) ) {
162  jets.push_back(j);
163  }
164  }
165  float deltaPhi_met_j1= 10.0;
166  float deltaPhi_j1_j2 = 10.0;
167 
168  if (!jets.empty()) deltaPhi_met_j1 = fabs( deltaPhi( pfmet.phi(), jets[0].phi() ));
169  if (jets.size() >= 2) deltaPhi_j1_j2 = fabs( deltaPhi( jets[0].phi(), jets[1].phi() ));
171  iEvent.getByToken( eleToken_, eleHandle );
172  std::vector<reco::GsfElectron> electrons;
173  if ( eleHandle->size() < nelectrons_ ) return;
174  for ( auto const & e : *eleHandle ) {
175  if ( eleSelection_( e ) ) electrons.push_back(e);
176  }
177  if (electrons.size() < nelectrons_ ) return;
178 
180  iEvent.getByToken(vtxToken_, vtxHandle);
181 
183  for (auto const & v : *vtxHandle) {
184  bool isFake = v.isFake() ;
185 
186  if (!isFake) {
187  vtx = v;
188  break;
189  }
190  }
191 
193  iEvent.getByToken( muoToken_, muoHandle );
194  if ( muoHandle->size() < nmuons_ ) return;
195  std::vector<reco::Muon> muons;
196  for ( auto const & m : *muoHandle ) {
197  bool pass = m.isGlobalMuon() && m.isPFMuon() && m.globalTrack()->normalizedChi2() < 10. && m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && m.numberOfMatchedStations() > 1 && fabs(m.muonBestTrack()->dxy(vtx.position())) < 0.2 && fabs(m.muonBestTrack()->dz(vtx.position())) < 0.5 && m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 && m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5;
198  if ( muoSelection_( m ) && pass ) muons.push_back(m);
199  }
200  if ( muons.size() < nmuons_ ) return;
201 
202  // filling histograms (denominator)
203  metME_.denominator -> Fill(met);
205  metPhiME_.denominator -> Fill(phi);
206  deltaphimetj1ME_.denominator -> Fill(deltaPhi_met_j1);
207  deltaphij1j2ME_.denominator -> Fill(deltaPhi_j1_j2);
208 
209  int ls = iEvent.id().luminosityBlock();
210  metVsLS_.denominator -> Fill(ls, met);
211  // applying selection for numerator
212  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
213 
214  // filling histograms (num_genTriggerEventFlag_)
215  metME_.numerator -> Fill(met);
217  metPhiME_.numerator -> Fill(phi);
218  metVsLS_.numerator -> Fill(ls, met);
219  deltaphimetj1ME_.numerator -> Fill(deltaPhi_met_j1);
220  deltaphij1j2ME_.numerator -> Fill(deltaPhi_j1_j2);
221 }
unsigned nmuons_
Definition: METMonitor.h:118
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:109
MonitorElement * numerator
Definition: METMonitor.h:60
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.h:95
double pt() const final
transverse momentum
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.h:114
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:108
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:113
METME metME_variableBinning_
Definition: METMonitor.h:102
const Point & position() const
position
Definition: Vertex.h:109
unsigned njets_
Definition: METMonitor.h:116
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:112
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:93
MonitorElement * denominator
Definition: METMonitor.h:61
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:92
vector< PseudoJet > jets
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:91
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:94
METME deltaphij1j2ME_
Definition: METMonitor.h:106
def ls(path, rec=False)
Definition: eostools.py:348
unsigned nelectrons_
Definition: METMonitor.h:117
met
===> hadronic RAZOR
METME metPhiME_
Definition: METMonitor.h:104
METME metVsLS_
Definition: METMonitor.h:103
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:111
METME deltaphimetj1ME_
Definition: METMonitor.h:105
METME metME_
Definition: METMonitor.h:101
double phi() const final
momentum azimuthal angle
void METMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 102 of file METMonitor.cc.

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

105 {
106 
107  std::string histname, histtitle;
108 
109  std::string currentFolder = folderName_ ;
110  ibooker.setCurrentFolder(currentFolder);
111 
112  histname = "deltaphi_metjet1"; histtitle = "DPHI_METJ1";
114  setMETitle(deltaphimetj1ME_,"delta phi (met, j1)","events / 0.1 rad");
115 
116  histname = "deltaphi_jet1jet2"; histtitle = "DPHI_J1J2";
118  setMETitle(deltaphij1j2ME_,"delta phi (j1, j2)","events / 0.1 rad");
119 
120  histname = "met"; histtitle = "PFMET";
121  bookME(ibooker,metME_,histname,histtitle,met_binning_.nbins,met_binning_.xmin, met_binning_.xmax);
122  setMETitle(metME_,"PF MET [GeV]","events / [GeV]");
123 
124  histname = "met_variable"; histtitle = "PFMET";
125  bookME(ibooker,metME_variableBinning_,histname,histtitle,met_variable_binning_);
126  setMETitle(metME_variableBinning_,"PF MET [GeV]","events / [GeV]");
127 
128  histname = "metVsLS"; histtitle = "PFMET vs LS";
130  setMETitle(metVsLS_,"LS","PF MET [GeV]");
131 
132  histname = "metPhi"; histtitle = "PFMET phi";
133  bookME(ibooker,metPhiME_,histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
134  setMETitle(metPhiME_,"PF MET #phi","events / 0.1 rad");
135 
136  // Initialize the GenericTriggerEventFlag
137  if ( num_genTriggerEventFlag_ && num_genTriggerEventFlag_->on() ) num_genTriggerEventFlag_->initRun( iRun, iSetup );
138  if ( den_genTriggerEventFlag_ && den_genTriggerEventFlag_->on() ) den_genTriggerEventFlag_->initRun( iRun, iSetup );
139 
140 }
void setMETitle(METME &me, const std::string &titleX, const std::string &titleY)
Definition: METMonitor.cc:57
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:109
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:108
METME metME_variableBinning_
Definition: METMonitor.h:102
std::string folderName_
Definition: METMonitor.h:88
MEbinning met_binning_
Definition: METMonitor.h:98
METME deltaphij1j2ME_
Definition: METMonitor.h:106
void bookME(DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: METMonitor.cc:66
static MEbinning phi_binning_
Definition: METMonitor.h:122
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
std::vector< double > met_variable_binning_
Definition: METMonitor.h:97
METME metPhiME_
Definition: METMonitor.h:104
METME metVsLS_
Definition: METMonitor.h:103
MEbinning ls_binning_
Definition: METMonitor.h:99
METME deltaphimetj1ME_
Definition: METMonitor.h:105
METME metME_
Definition: METMonitor.h:101
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 66 of file METMonitor.cc.

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

Referenced by bookHistograms().

67 {
68  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, min, max);
69  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, min, max);
70 }
MonitorElement * numerator
Definition: BPHMonitor.h:60
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * denominator
Definition: BPHMonitor.h:61
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 71 of file METMonitor.cc.

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

72 {
73  int nbins = binning.size()-1;
74  std::vector<float> fbinning(binning.begin(),binning.end());
75  float* arr = &fbinning[0];
76  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, arr);
77  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, arr);
78 }
MonitorElement * numerator
Definition: BPHMonitor.h:60
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * denominator
Definition: BPHMonitor.h:61
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 79 of file METMonitor.cc.

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

80 {
81  me.numerator = ibooker.bookProfile(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
82  me.denominator = ibooker.bookProfile(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
83 }
MonitorElement * numerator
Definition: BPHMonitor.h:60
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
MonitorElement * denominator
Definition: BPHMonitor.h:61
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 84 of file METMonitor.cc.

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

85 {
86  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
87  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
88 }
MonitorElement * numerator
Definition: BPHMonitor.h:60
MonitorElement * denominator
Definition: BPHMonitor.h:61
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
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 89 of file METMonitor.cc.

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

90 {
91  int nbinsX = binningX.size()-1;
92  std::vector<float> fbinningX(binningX.begin(),binningX.end());
93  float* arrX = &fbinningX[0];
94  int nbinsY = binningY.size()-1;
95  std::vector<float> fbinningY(binningY.begin(),binningY.end());
96  float* arrY = &fbinningY[0];
97 
98  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, arrX, nbinsY, arrY);
99  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, arrX, nbinsY, arrY);
100 }
MonitorElement * numerator
Definition: BPHMonitor.h:60
MonitorElement * denominator
Definition: BPHMonitor.h:61
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
void METMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 237 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.

238 {
240  desc.add<std::string> ( "FolderName", "HLT/MET" );
241 
242  desc.add<edm::InputTag>( "met", edm::InputTag("pfMet") );
243  desc.add<edm::InputTag>( "jets", edm::InputTag("ak4PFJetsCHS") );
244  desc.add<edm::InputTag>( "electrons",edm::InputTag("gedGsfElectrons") );
245  desc.add<edm::InputTag>( "muons", edm::InputTag("muons") );
246  desc.add<edm::InputTag>( "vertices",edm::InputTag("offlinePrimaryVertices") );
247  desc.add<std::string>("metSelection", "pt > 0");
248  desc.add<std::string>("jetSelection", "pt > 0");
249  desc.add<std::string>("eleSelection", "pt > 0");
250  desc.add<std::string>("muoSelection", "pt > 0");
251  desc.add<unsigned>("njets", 0);
252  desc.add<unsigned>("nelectrons", 0);
253  desc.add<unsigned>("nmuons", 0);
254 
255  edm::ParameterSetDescription genericTriggerEventPSet;
256  genericTriggerEventPSet.add<bool>("andOr");
257  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi") );
258  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions",{});
259  genericTriggerEventPSet.add<bool>("andOrDcs", false);
260  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
261  genericTriggerEventPSet.add<std::string>("dbLabel","");
262  genericTriggerEventPSet.add<bool>("andOrHlt", true);
263  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT") );
264  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths",{});
265  genericTriggerEventPSet.add<std::string>("hltDBKey","");
266  genericTriggerEventPSet.add<bool>("errorReplyHlt",false);
267  genericTriggerEventPSet.add<unsigned int>("verbosityLevel",1);
268 
269  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
270  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
271 
274  fillHistoPSetDescription(metPSet);
275  histoPSet.add<edm::ParameterSetDescription>("metPSet", metPSet);
276  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.};
277  histoPSet.add<std::vector<double> >("metBinning", bins);
278 
281  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
282 
283  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
284 
285  descriptions.add("metMonitoring", desc);
286 }
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:223
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:230
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 230 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

231 {
232  pset.add<unsigned int> ( "nbins", 2500 );
233  pset.add<double> ( "xmin", 0.);
234  pset.add<double> ( "xmax", 2500.);
235 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void METMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 223 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

224 {
225  pset.add<unsigned> ( "nbins");
226  pset.add<double>( "xmin" );
227  pset.add<double>( "xmax" );
228 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
METMonitor::MEbinning METMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 48 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

49 {
50  return METMonitor::MEbinning{
51  pset.getParameter<unsigned>("nbins"),
52  0.,
53  double(pset.getParameter<unsigned>("nbins"))
54  };
55 }
T getParameter(std::string const &) const
METMonitor::MEbinning METMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 39 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

40 {
41  return METMonitor::MEbinning{
42  pset.getParameter<unsigned>("nbins"),
43  pset.getParameter<double>("xmin"),
44  pset.getParameter<double>("xmax"),
45  };
46 }
T getParameter(std::string const &) const
void METMonitor::setMETitle ( METME me,
const std::string &  titleX,
const std::string &  titleY 
)
protected

Definition at line 57 of file METMonitor.cc.

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

Referenced by bookHistograms().

58 {
59  me.numerator->setAxisTitle(titleX,1);
60  me.numerator->setAxisTitle(titleY,2);
61  me.denominator->setAxisTitle(titleX,1);
62  me.denominator->setAxisTitle(titleY,2);
63 
64 }
MonitorElement * numerator
Definition: BPHMonitor.h:60
MonitorElement * denominator
Definition: BPHMonitor.h:61
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

METME METMonitor::deltaphij1j2ME_
private

Definition at line 106 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::deltaphimetj1ME_
private

Definition at line 105 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

std::unique_ptr<GenericTriggerEventFlag> METMonitor::den_genTriggerEventFlag_
private

Definition at line 109 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 113 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 93 of file METMonitor.h.

Referenced by analyze().

std::string METMonitor::folderName_
private

Definition at line 88 of file METMonitor.h.

Referenced by bookHistograms().

std::string METMonitor::histoSuffix_
private

Definition at line 89 of file METMonitor.h.

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

Definition at line 112 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 92 of file METMonitor.h.

Referenced by analyze().

MEbinning METMonitor::ls_binning_
private

Definition at line 99 of file METMonitor.h.

Referenced by bookHistograms().

double METMonitor::MAX_PHI = 3.2
staticprivate

Definition at line 120 of file METMonitor.h.

MEbinning METMonitor::met_binning_
private

Definition at line 98 of file METMonitor.h.

Referenced by bookHistograms().

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

Definition at line 97 of file METMonitor.h.

Referenced by bookHistograms().

METME METMonitor::metME_
private

Definition at line 101 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::metME_variableBinning_
private

Definition at line 102 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::metPhiME_
private

Definition at line 104 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 111 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 91 of file METMonitor.h.

Referenced by analyze().

METME METMonitor::metVsLS_
private

Definition at line 103 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 114 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 94 of file METMonitor.h.

Referenced by analyze().

int METMonitor::N_PHI = 64
staticprivate

Definition at line 121 of file METMonitor.h.

unsigned METMonitor::nelectrons_
private

Definition at line 117 of file METMonitor.h.

Referenced by analyze().

unsigned METMonitor::njets_
private

Definition at line 116 of file METMonitor.h.

Referenced by analyze().

unsigned METMonitor::nmuons_
private

Definition at line 118 of file METMonitor.h.

Referenced by analyze().

std::unique_ptr<GenericTriggerEventFlag> METMonitor::num_genTriggerEventFlag_
private

Definition at line 108 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

MEbinning METMonitor::phi_binning_
staticprivate
Initial value:
{
N_PHI, -MAX_PHI, MAX_PHI
}

Definition at line 122 of file METMonitor.h.

Referenced by bookHistograms().

edm::EDGetTokenT<reco::VertexCollection> METMonitor::vtxToken_
private

Definition at line 95 of file METMonitor.h.

Referenced by analyze().