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::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > 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 &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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_
 
edm::InputTag eleInputTag_
 
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
 
edm::EDGetTokenT< reco::GsfElectronCollectioneleToken_
 
std::string folderName_
 
std::string histoSuffix_
 
edm::InputTag jetInputTag_
 
StringCutObjectSelector< reco::PFJet, true > jetSelection_
 
edm::EDGetTokenT< reco::PFJetCollectionjetToken_
 
MEbinning ls_binning_
 
MEbinning met_binning_
 
std::vector< double > met_variable_binning_
 
edm::InputTag metInputTag_
 
METME metME_
 
METME metME_variableBinning_
 
METME metPhiME_
 
StringCutObjectSelector< reco::MET, true > metSelection_
 
edm::EDGetTokenT< reco::PFMETCollectionmetToken_
 
METME metVsLS_
 
edm::InputTag muoInputTag_
 
StringCutObjectSelector< reco::Muon, true > muoSelection_
 
edm::EDGetTokenT< reco::MuonCollectionmuoToken_
 
unsigned nelectrons_
 
unsigned njets_
 
unsigned nmuons_
 
std::unique_ptr< GenericTriggerEventFlagnum_genTriggerEventFlag_
 
edm::InputTag vtxInputTag_
 
edm::EDGetTokenT< reco::VertexCollectionvtxToken_
 
std::vector< bool > warningPrinted4token_
 

Static Private Attributes

static double MAX_PHI = 3.2
 
static int N_PHI = 64
 
static MEbinning phi_binning_ {N_PHI, -MAX_PHI, MAX_PHI}
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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 warningPrinted4token_, and ~METMonitor().

16  : folderName_(iConfig.getParameter<std::string>("FolderName")),
17  metInputTag_(iConfig.getParameter<edm::InputTag>("met")),
18  jetInputTag_(iConfig.getParameter<edm::InputTag>("jets")),
19  eleInputTag_(iConfig.getParameter<edm::InputTag>("electrons")),
20  muoInputTag_(iConfig.getParameter<edm::InputTag>("muons")),
21  vtxInputTag_(iConfig.getParameter<edm::InputTag>("vertices")),
22  metToken_(consumes<reco::PFMETCollection>(metInputTag_)),
23  jetToken_(mayConsume<reco::PFJetCollection>(jetInputTag_)),
24  eleToken_(mayConsume<reco::GsfElectronCollection>(eleInputTag_)),
25  muoToken_(mayConsume<reco::MuonCollection>(muoInputTag_)),
26  vtxToken_(mayConsume<reco::VertexCollection>(vtxInputTag_)),
28  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning")),
30  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("metPSet"))),
34  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
36  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
37  metSelection_(iConfig.getParameter<std::string>("metSelection")),
38  jetSelection_(iConfig.getParameter<std::string>("jetSelection")),
39  eleSelection_(iConfig.getParameter<std::string>("eleSelection")),
40  muoSelection_(iConfig.getParameter<std::string>("muoSelection")),
41  njets_(iConfig.getParameter<unsigned>("njets")),
42  nelectrons_(iConfig.getParameter<unsigned>("nelectrons")),
43  nmuons_(iConfig.getParameter<unsigned>("nmuons")) {
44  // this vector has to be alligned to the the number of Tokens accessed by this module
45  warningPrinted4token_.push_back(false); // PFMETCollection
46  warningPrinted4token_.push_back(false); // JetCollection
47  warningPrinted4token_.push_back(false); // GsfElectronCollection
48  warningPrinted4token_.push_back(false); // MuonCollection
49  warningPrinted4token_.push_back(false); // VertexCollection
50 }
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:146
T getParameter(std::string const &) const
unsigned nmuons_
Definition: METMonitor.h:152
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:143
edm::InputTag vtxInputTag_
Definition: METMonitor.h:123
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:147
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: METMonitor.cc:54
edm::InputTag muoInputTag_
Definition: METMonitor.h:122
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.h:129
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:142
edm::InputTag eleInputTag_
Definition: METMonitor.h:121
std::string folderName_
Definition: METMonitor.h:116
unsigned njets_
Definition: METMonitor.h:150
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:127
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MEbinning met_binning_
Definition: METMonitor.h:132
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:126
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:125
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.h:148
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:128
unsigned nelectrons_
Definition: METMonitor.h:151
std::vector< double > met_variable_binning_
Definition: METMonitor.h:131
edm::InputTag metInputTag_
Definition: METMonitor.h:119
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:145
MEbinning ls_binning_
Definition: METMonitor.h:133
edm::InputTag jetInputTag_
Definition: METMonitor.h:120
std::vector< bool > warningPrinted4token_
Definition: METMonitor.h:158
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 195 of file METMonitor.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, METMonitor::METME::denominator, MillePedeFileConverter_cfg::e, pwdgSkimBPark_cfi::electrons, eleInputTag_, eleSelection_, eleToken_, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), edm::EventBase::id(), edm::HandleBase::isValid(), dqmiolumiharvest::j, jetInputTag_, singleTopDQM_cfi::jets, jetSelection_, jetToken_, edm::InputTag::label(), eostools::ls(), edm::EventID::luminosityBlock(), visualization-live-secondInstance_cfg::m, BTaggingMonitor_cfi::met, metInputTag_, metME_, metME_variableBinning_, metPhiME_, metSelection_, metToken_, metVsLS_, muoInputTag_, PDWG_BPHSkim_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, vtxInputTag_, vtxToken_, and warningPrinted4token_.

195  {
196  // Filter out events if Trigger Filtering is requested
197  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
198  return;
200  iEvent.getByToken(metToken_, metHandle);
201  if (!metHandle.isValid()) {
202  if (!warningPrinted4token_[0]) {
203  edm::LogWarning("METMonitor") << "skipping events because the collection " << metInputTag_.label().c_str()
204  << " is not available";
205  warningPrinted4token_[0] = true;
206  }
207  return;
208  }
209  reco::PFMET pfmet = metHandle->front();
210  if (!metSelection_(pfmet))
211  return;
212 
213  float met = pfmet.pt();
214  float phi = pfmet.phi();
215 
216  std::vector<reco::PFJet> jets;
218  iEvent.getByToken(jetToken_, jetHandle);
219  if (jetHandle.isValid()) {
220  if (jetHandle->size() < njets_)
221  return;
222  for (auto const& j : *jetHandle) {
223  if (jetSelection_(j)) {
224  jets.push_back(j);
225  }
226  }
227  } else {
228  if (!warningPrinted4token_[1]) {
229  if (jetInputTag_.label().empty())
230  edm::LogWarning("METMonitor") << "JetCollection not set";
231  else
232  edm::LogWarning("METMonitor") << "skipping events because the collection " << jetInputTag_.label().c_str()
233  << " is not available";
234  warningPrinted4token_[1] = true;
235  }
236  // if Handle is not valid, because the InputTag has been mis-configured, then skip the event
237  if (!jetInputTag_.label().empty())
238  return;
239  }
240  float deltaPhi_met_j1 = 10.0;
241  float deltaPhi_j1_j2 = 10.0;
242 
243  if (!jets.empty())
244  deltaPhi_met_j1 = fabs(deltaPhi(pfmet.phi(), jets[0].phi()));
245  if (jets.size() >= 2)
246  deltaPhi_j1_j2 = fabs(deltaPhi(jets[0].phi(), jets[1].phi()));
247 
248  std::vector<reco::GsfElectron> electrons;
250  iEvent.getByToken(eleToken_, eleHandle);
251  if (eleHandle.isValid()) {
252  if (eleHandle->size() < nelectrons_)
253  return;
254  for (auto const& e : *eleHandle) {
255  if (eleSelection_(e))
256  electrons.push_back(e);
257  }
258  if (electrons.size() < nelectrons_)
259  return;
260  } else {
261  if (!warningPrinted4token_[2]) {
262  warningPrinted4token_[2] = true;
263  if (eleInputTag_.label().empty())
264  edm::LogWarning("METMonitor") << "GsfElectronCollection not set";
265  else
266  edm::LogWarning("METMonitor") << "skipping events because the collection " << eleInputTag_.label().c_str()
267  << " is not available";
268  }
269  if (!eleInputTag_.label().empty())
270  return;
271  }
272 
275  iEvent.getByToken(vtxToken_, vtxHandle);
276  if (vtxHandle.isValid()) {
277  for (auto const& v : *vtxHandle) {
278  bool isFake = v.isFake();
279 
280  if (!isFake) {
281  vtx = v;
282  break;
283  }
284  }
285  } else {
286  if (!warningPrinted4token_[3]) {
287  warningPrinted4token_[3] = true;
288  if (vtxInputTag_.label().empty())
289  edm::LogWarning("METMonitor") << "VertexCollection is not set";
290  else
291  edm::LogWarning("METMonitor") << "skipping events because the collection " << vtxInputTag_.label().c_str()
292  << " is not available";
293  }
294  if (!vtxInputTag_.label().empty())
295  return;
296  }
297 
298  std::vector<reco::Muon> muons;
300  iEvent.getByToken(muoToken_, muoHandle);
301  if (muoHandle.isValid()) {
302  if (muoHandle->size() < nmuons_)
303  return;
304  for (auto const& m : *muoHandle) {
305  bool pass = m.isGlobalMuon() && m.isPFMuon() && m.globalTrack()->normalizedChi2() < 10. &&
306  m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && m.numberOfMatchedStations() > 1 &&
307  fabs(m.muonBestTrack()->dxy(vtx.position())) < 0.2 &&
308  fabs(m.muonBestTrack()->dz(vtx.position())) < 0.5 &&
309  m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
310  m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5;
311  if (muoSelection_(m) && pass)
312  muons.push_back(m);
313  }
314  if (muons.size() < nmuons_)
315  return;
316  } else {
317  if (!warningPrinted4token_[4]) {
318  warningPrinted4token_[4] = true;
319  if (muoInputTag_.label().empty())
320  edm::LogWarning("METMonitor") << "MuonCollection not set";
321  else
322  edm::LogWarning("METMonitor") << "skipping events because the collection " << muoInputTag_.label().c_str()
323  << " is not available";
324  }
325  if (!muoInputTag_.label().empty())
326  return;
327  }
328 
329  // filling histograms (denominator)
330  metME_.denominator->Fill(met);
332  metPhiME_.denominator->Fill(phi);
333  deltaphimetj1ME_.denominator->Fill(deltaPhi_met_j1);
334  deltaphij1j2ME_.denominator->Fill(deltaPhi_j1_j2);
335 
336  int ls = iEvent.id().luminosityBlock();
337  metVsLS_.denominator->Fill(ls, met);
338  // applying selection for numerator
339  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
340  return;
341 
342  // filling histograms (num_genTriggerEventFlag_)
343  metME_.numerator->Fill(met);
345  metPhiME_.numerator->Fill(phi);
346  metVsLS_.numerator->Fill(ls, met);
347  deltaphimetj1ME_.numerator->Fill(deltaPhi_met_j1);
348  deltaphij1j2ME_.numerator->Fill(deltaPhi_j1_j2);
349 }
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:146
unsigned nmuons_
Definition: METMonitor.h:152
edm::InputTag vtxInputTag_
Definition: METMonitor.h:123
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:143
MonitorElement * numerator
Definition: METMonitor.h:58
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:147
edm::InputTag muoInputTag_
Definition: METMonitor.h:122
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.h:129
double pt() const final
transverse momentum
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:142
edm::InputTag eleInputTag_
Definition: METMonitor.h:121
METME metME_variableBinning_
Definition: METMonitor.h:136
const Point & position() const
position
Definition: Vertex.h:113
unsigned njets_
Definition: METMonitor.h:150
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:127
MonitorElement * denominator
Definition: METMonitor.h:59
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:126
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:125
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.h:148
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:128
METME deltaphij1j2ME_
Definition: METMonitor.h:140
bool isValid() const
Definition: HandleBase.h:70
def ls(path, rec=False)
Definition: eostools.py:349
unsigned nelectrons_
Definition: METMonitor.h:151
METME metPhiME_
Definition: METMonitor.h:138
METME metVsLS_
Definition: METMonitor.h:137
std::string const & label() const
Definition: InputTag.h:36
edm::InputTag metInputTag_
Definition: METMonitor.h:119
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:145
edm::InputTag jetInputTag_
Definition: METMonitor.h:120
METME deltaphimetj1ME_
Definition: METMonitor.h:139
std::vector< bool > warningPrinted4token_
Definition: METMonitor.h:158
METME metME_
Definition: METMonitor.h:135
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 140 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_, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), setMETitle(), AlCaHLTBitMon_QueryRunRegistry::string, METMonitor::MEbinning::xmax, and METMonitor::MEbinning::xmin.

140  {
141  std::string histname, histtitle;
142 
143  std::string currentFolder = folderName_;
144  ibooker.setCurrentFolder(currentFolder);
145 
146  histname = "deltaphi_metjet1";
147  histtitle = "DPHI_METJ1";
148  bookME(ibooker, deltaphimetj1ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
149  setMETitle(deltaphimetj1ME_, "delta phi (met, j1)", "events / 0.1 rad");
150 
151  histname = "deltaphi_jet1jet2";
152  histtitle = "DPHI_J1J2";
153  bookME(ibooker, deltaphij1j2ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
154  setMETitle(deltaphij1j2ME_, "delta phi (j1, j2)", "events / 0.1 rad");
155 
156  histname = "met";
157  histtitle = "PFMET";
158  bookME(ibooker, metME_, histname, histtitle, met_binning_.nbins, met_binning_.xmin, met_binning_.xmax);
159  setMETitle(metME_, "PF MET [GeV]", "events / [GeV]");
160 
161  histname = "met_variable";
162  histtitle = "PFMET";
163  bookME(ibooker, metME_variableBinning_, histname, histtitle, met_variable_binning_);
164  setMETitle(metME_variableBinning_, "PF MET [GeV]", "events / [GeV]");
165 
166  histname = "metVsLS";
167  histtitle = "PFMET vs LS";
168  bookME(ibooker,
169  metVsLS_,
170  histname,
171  histtitle,
177  setMETitle(metVsLS_, "LS", "PF MET [GeV]");
178 
179  histname = "metPhi";
180  histtitle = "PFMET phi";
181  bookME(ibooker, metPhiME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
182  setMETitle(metPhiME_, "PF MET #phi", "events / 0.1 rad");
183 
184  // Initialize the GenericTriggerEventFlag
186  num_genTriggerEventFlag_->initRun(iRun, iSetup);
188  den_genTriggerEventFlag_->initRun(iRun, iSetup);
189 }
void setMETitle(METME &me, const std::string &titleX, const std::string &titleY)
Definition: METMonitor.cc:66
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:143
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:142
METME metME_variableBinning_
Definition: METMonitor.h:136
std::string folderName_
Definition: METMonitor.h:116
MEbinning met_binning_
Definition: METMonitor.h:132
METME deltaphij1j2ME_
Definition: METMonitor.h:140
void bookME(DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: METMonitor.cc:73
static MEbinning phi_binning_
Definition: METMonitor.h:156
std::vector< double > met_variable_binning_
Definition: METMonitor.h:131
METME metPhiME_
Definition: METMonitor.h:138
METME metVsLS_
Definition: METMonitor.h:137
MEbinning ls_binning_
Definition: METMonitor.h:133
METME deltaphimetj1ME_
Definition: METMonitor.h:139
METME metME_
Definition: METMonitor.h:135
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 73 of file METMonitor.cc.

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

Referenced by bookHistograms().

79  {
80  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, min, max);
81  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, min, max);
82 }
dqm::reco::MonitorElement * denominator
Definition: BPHMonitor.h:69
dqm::reco::MonitorElement * numerator
Definition: BPHMonitor.h:68
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 83 of file METMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), METMonitor::METME::denominator, LaserClient_cfi::nbins, and METMonitor::METME::numerator.

87  {
88  int nbins = binning.size() - 1;
89  std::vector<float> fbinning(binning.begin(), binning.end());
90  float* arr = &fbinning[0];
91  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, arr);
92  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, arr);
93 }
dqm::reco::MonitorElement * denominator
Definition: BPHMonitor.h:69
dqm::reco::MonitorElement * numerator
Definition: BPHMonitor.h:68
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 94 of file METMonitor.cc.

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

102  {
103  me.numerator =
104  ibooker.bookProfile(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, ymin, ymax);
105  me.denominator =
106  ibooker.bookProfile(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, ymin, ymax);
107 }
dqm::reco::MonitorElement * denominator
Definition: BPHMonitor.h:69
dqm::reco::MonitorElement * numerator
Definition: BPHMonitor.h:68
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 108 of file METMonitor.cc.

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

117  {
118  me.numerator =
119  ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
120  me.denominator =
121  ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
122 }
dqm::reco::MonitorElement * denominator
Definition: BPHMonitor.h:69
dqm::reco::MonitorElement * numerator
Definition: BPHMonitor.h:68
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 123 of file METMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), METMonitor::METME::denominator, hlt_dqm_clientPB-live_cfg::nbinsX, hlt_dqm_clientPB-live_cfg::nbinsY, and METMonitor::METME::numerator.

128  {
129  int nbinsX = binningX.size() - 1;
130  std::vector<float> fbinningX(binningX.begin(), binningX.end());
131  float* arrX = &fbinningX[0];
132  int nbinsY = binningY.size() - 1;
133  std::vector<float> fbinningY(binningY.begin(), binningY.end());
134  float* arrY = &fbinningY[0];
135 
136  me.numerator = ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, arrX, nbinsY, arrY);
137  me.denominator = ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, arrX, nbinsY, arrY);
138 }
dqm::reco::MonitorElement * denominator
Definition: BPHMonitor.h:69
dqm::reco::MonitorElement * numerator
Definition: BPHMonitor.h:68
void METMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 363 of file METMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), trigObjTnPSource_cfi::bins, DEFINE_FWK_MODULE, fillHistoLSPSetDescription(), fillHistoPSetDescription(), SiStripSourceConfigTier0_cff::genericTriggerEventPSet, LumiMonitor_cff::histoPSet, HLT_2018_cff::InputTag, LumiMonitor_cff::lsPSet, BTaggingMonitor_cfi::metPSet, and AlCaHLTBitMon_QueryRunRegistry::string.

363  {
365  desc.add<std::string>("FolderName", "HLT/MET");
366 
367  desc.add<edm::InputTag>("met", edm::InputTag("pfMet"));
368  desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
369  desc.add<edm::InputTag>("electrons", edm::InputTag("gedGsfElectrons"));
370  desc.add<edm::InputTag>("muons", edm::InputTag("muons"));
371  desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
372  desc.add<std::string>("metSelection", "pt > 0");
373  desc.add<std::string>("jetSelection", "pt > 0");
374  desc.add<std::string>("eleSelection", "pt > 0");
375  desc.add<std::string>("muoSelection", "pt > 0");
376  desc.add<unsigned>("njets", 0);
377  desc.add<unsigned>("nelectrons", 0);
378  desc.add<unsigned>("nmuons", 0);
379 
381  genericTriggerEventPSet.add<bool>("andOr");
382  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi"));
383  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions", {});
384  genericTriggerEventPSet.add<bool>("andOrDcs", false);
385  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
386  genericTriggerEventPSet.add<std::string>("dbLabel", "");
387  genericTriggerEventPSet.add<bool>("andOrHlt", true);
388  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT"));
389  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths", {});
390  genericTriggerEventPSet.add<std::string>("hltDBKey", "");
391  genericTriggerEventPSet.add<bool>("errorReplyHlt", false);
392  genericTriggerEventPSet.add<unsigned int>("verbosityLevel", 1);
393 
394  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
395  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
396 
399  fillHistoPSetDescription(metPSet);
400  histoPSet.add<edm::ParameterSetDescription>("metPSet", metPSet);
401  std::vector<double> bins = {0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140., 150., 160.,
402  170., 180., 190., 200., 220., 240., 260., 280., 300., 350., 400., 450., 1000.};
403  histoPSet.add<std::vector<double> >("metBinning", bins);
404 
407  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
408 
409  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
410 
411  descriptions.add("metMonitoring", desc);
412 }
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:351
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:357
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 357 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

357  {
358  pset.add<unsigned int>("nbins", 2500);
359  pset.add<double>("xmin", 0.);
360  pset.add<double>("xmax", 2500.);
361 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void METMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 351 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

351  {
352  pset.add<unsigned>("nbins");
353  pset.add<double>("xmin");
354  pset.add<double>("xmax");
355 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
METMonitor::MEbinning METMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 62 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

62  {
63  return METMonitor::MEbinning{pset.getParameter<unsigned>("nbins"), 0., double(pset.getParameter<unsigned>("nbins"))};
64 }
T getParameter(std::string const &) const
METMonitor::MEbinning METMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 54 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

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

Definition at line 66 of file METMonitor.cc.

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

Referenced by bookHistograms().

66  {
67  me.numerator->setAxisTitle(titleX, 1);
68  me.numerator->setAxisTitle(titleY, 2);
69  me.denominator->setAxisTitle(titleX, 1);
70  me.denominator->setAxisTitle(titleY, 2);
71 }
dqm::reco::MonitorElement * denominator
Definition: BPHMonitor.h:69
dqm::reco::MonitorElement * numerator
Definition: BPHMonitor.h:68
virtual 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 140 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::deltaphimetj1ME_
private

Definition at line 139 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 143 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag METMonitor::eleInputTag_
private

Definition at line 121 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 147 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 127 of file METMonitor.h.

Referenced by analyze().

std::string METMonitor::folderName_
private

Definition at line 116 of file METMonitor.h.

Referenced by bookHistograms().

std::string METMonitor::histoSuffix_
private

Definition at line 117 of file METMonitor.h.

edm::InputTag METMonitor::jetInputTag_
private

Definition at line 120 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 146 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 126 of file METMonitor.h.

Referenced by analyze().

MEbinning METMonitor::ls_binning_
private

Definition at line 133 of file METMonitor.h.

Referenced by bookHistograms().

double METMonitor::MAX_PHI = 3.2
staticprivate

Definition at line 154 of file METMonitor.h.

MEbinning METMonitor::met_binning_
private

Definition at line 132 of file METMonitor.h.

Referenced by bookHistograms().

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

Definition at line 131 of file METMonitor.h.

Referenced by bookHistograms().

edm::InputTag METMonitor::metInputTag_
private

Definition at line 119 of file METMonitor.h.

Referenced by analyze().

METME METMonitor::metME_
private

Definition at line 135 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::metME_variableBinning_
private

Definition at line 136 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::metPhiME_
private

Definition at line 138 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 145 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 125 of file METMonitor.h.

Referenced by analyze().

METME METMonitor::metVsLS_
private

Definition at line 137 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag METMonitor::muoInputTag_
private

Definition at line 122 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 148 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 128 of file METMonitor.h.

Referenced by analyze().

int METMonitor::N_PHI = 64
staticprivate

Definition at line 155 of file METMonitor.h.

unsigned METMonitor::nelectrons_
private

Definition at line 151 of file METMonitor.h.

Referenced by analyze().

unsigned METMonitor::njets_
private

Definition at line 150 of file METMonitor.h.

Referenced by analyze().

unsigned METMonitor::nmuons_
private

Definition at line 152 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 142 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 156 of file METMonitor.h.

Referenced by bookHistograms().

edm::InputTag METMonitor::vtxInputTag_
private

Definition at line 123 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 129 of file METMonitor.h.

Referenced by analyze().

std::vector<bool> METMonitor::warningPrinted4token_
private

Definition at line 158 of file METMonitor.h.

Referenced by analyze(), and METMonitor().