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
HTMonitor Class Reference

#include <HTMonitor.h>

Inheritance diagram for HTMonitor:
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  HTME
 
struct  MEHTbinning
 

Public Member Functions

 HTMonitor (const edm::ParameterSet &)
 
 ~HTMonitor () 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 &, HTME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
 
void bookME (DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX)
 
void bookME (DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, HTME &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 &, HTME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY)
 
void setHTitle (HTME &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 MEHTbinning getHistoLSPSet (const edm::ParameterSet &pset)
 
static MEHTbinning getHistoPSet (const edm::ParameterSet &pset)
 

Private Attributes

HTME deltaphij1j2ME_
 
HTME deltaphimetj1ME_
 
std::unique_ptr< GenericTriggerEventFlagden_genTriggerEventFlag_
 
double dEtaCut_
 
edm::InputTag eleInputTag_
 
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
 
edm::EDGetTokenT< reco::GsfElectronCollectioneleToken_
 
std::string folderName_
 
std::string histoSuffix_
 
MEHTbinning ht_binning_
 
std::vector< double > ht_variable_binning_
 
HTME htVsLS_
 
edm::InputTag jetInputTag_
 
StringCutObjectSelector< reco::Jet, true > jetSelection_
 
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
 
edm::EDGetTokenT< reco::JetViewjetToken_
 
MEHTbinning ls_binning_
 
edm::InputTag metInputTag_
 
StringCutObjectSelector< reco::MET, true > metSelection_
 
edm::EDGetTokenT< reco::PFMETCollectionmetToken_
 
edm::InputTag muoInputTag_
 
StringCutObjectSelector< reco::Muon, true > muoSelection_
 
edm::EDGetTokenT< reco::MuonCollectionmuoToken_
 
unsigned nelectrons_
 
unsigned njets_
 
unsigned nmuons_
 
std::unique_ptr< GenericTriggerEventFlagnum_genTriggerEventFlag_
 
HTME qME_variableBinning_
 
quant quantity_
 
edm::InputTag vtxInputTag_
 
edm::EDGetTokenT< reco::VertexCollectionvtxToken_
 
std::vector< bool > warningPrinted4token_
 

Static Private Attributes

static double MAXedge_PHI = 3.2
 
static int Nbin_PHI = 64
 
static MEHTbinning phi_binning_ {Nbin_PHI, -MAXedge_PHI, MAXedge_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 50 of file HTMonitor.h.

Constructor & Destructor Documentation

HTMonitor::HTMonitor ( const edm::ParameterSet iConfig)

Definition at line 12 of file HTMonitor.cc.

References Exception, edm::ParameterSet::getParameter(), HT, MJJ, MjjMonitor_cfi::quantity, quantity_, SOFTDROP, AlCaHLTBitMon_QueryRunRegistry::string, warningPrinted4token_, and ~HTMonitor().

13  : folderName_(iConfig.getParameter<std::string>("FolderName")),
14  metInputTag_(iConfig.getParameter<edm::InputTag>("met")),
15  jetInputTag_(iConfig.getParameter<edm::InputTag>("jets")),
16  eleInputTag_(iConfig.getParameter<edm::InputTag>("electrons")),
17  muoInputTag_(iConfig.getParameter<edm::InputTag>("muons")),
18  vtxInputTag_(iConfig.getParameter<edm::InputTag>("vertices")),
19  metToken_(consumes<reco::PFMETCollection>(metInputTag_)),
20  jetToken_(mayConsume<reco::JetView>(jetInputTag_)),
21  eleToken_(mayConsume<reco::GsfElectronCollection>(eleInputTag_)),
22  muoToken_(mayConsume<reco::MuonCollection>(muoInputTag_)),
23  vtxToken_(mayConsume<reco::VertexCollection>(vtxInputTag_)),
25  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("htBinning")),
31  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
33  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
34  metSelection_(iConfig.getParameter<std::string>("metSelection")),
35  jetSelection_(iConfig.getParameter<std::string>("jetSelection")),
36  eleSelection_(iConfig.getParameter<std::string>("eleSelection")),
37  muoSelection_(iConfig.getParameter<std::string>("muoSelection")),
38  jetSelection_HT_(iConfig.getParameter<std::string>("jetSelection_HT")),
39  njets_(iConfig.getParameter<unsigned>("njets")),
40  nelectrons_(iConfig.getParameter<unsigned>("nelectrons")),
41  nmuons_(iConfig.getParameter<unsigned>("nmuons")),
42  dEtaCut_(iConfig.getParameter<double>("dEtaCut")) {
43  /* mia: THIS CODE SHOULD BE DELETED !!!! */
44  string quantity = iConfig.getParameter<std::string>("quantity");
45  if (quantity == "HT") {
46  quantity_ = HT;
47  } else if (quantity == "Mjj") {
48  quantity_ = MJJ;
49  } else if (quantity == "softdrop") {
51  } else {
52  throw cms::Exception("quantity not defined")
53  << "the quantity '" << quantity << "' is undefined. Please check your config!" << std::endl;
54  }
55 
56  // this vector has to be alligned to the the number of Tokens accessed by this module
57  warningPrinted4token_.push_back(false); // PFMETCollection
58  warningPrinted4token_.push_back(false); // JetCollection
59  warningPrinted4token_.push_back(false); // GsfElectronCollection
60  warningPrinted4token_.push_back(false); // MuonCollection
61  warningPrinted4token_.push_back(false); // VertexCollection
62 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.h:129
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.h:145
double dEtaCut_
Definition: HTMonitor.h:152
quant quantity_
Definition: HTMonitor.h:118
edm::InputTag muoInputTag_
Definition: HTMonitor.h:123
std::vector< double > ht_variable_binning_
Definition: HTMonitor.h:132
unsigned njets_
Definition: HTMonitor.h:149
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: HTMonitor.h:130
static MEHTbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: HTMonitor.cc:66
edm::InputTag jetInputTag_
Definition: HTMonitor.h:121
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:142
std::vector< bool > warningPrinted4token_
Definition: HTMonitor.h:158
Definition: HTMonitor.h:44
edm::InputTag eleInputTag_
Definition: HTMonitor.h:122
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.h:147
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MEHTbinning ht_binning_
Definition: HTMonitor.h:133
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.h:128
MEHTbinning ls_binning_
Definition: HTMonitor.h:134
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.h:144
edm::InputTag vtxInputTag_
Definition: HTMonitor.h:124
edm::InputTag metInputTag_
Definition: HTMonitor.h:120
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.h:146
unsigned nelectrons_
Definition: HTMonitor.h:150
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.h:127
std::string folderName_
Definition: HTMonitor.h:116
Definition: HTMonitor.h:44
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.h:126
unsigned nmuons_
Definition: HTMonitor.h:151
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.h:148
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:141
HTMonitor::~HTMonitor ( )
overridedefault

Referenced by HTMonitor().

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 218 of file HTMonitor.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, HTMonitor::HTME::denominator, dEtaCut_, MillePedeFileConverter_cfg::e, pwdgSkimBPark_cfi::electrons, eleInputTag_, eleSelection_, eleToken_, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), htVsLS_, edm::EventBase::id(), edm::HandleBase::isValid(), dqmiolumiharvest::j, jetInputTag_, singleTopDQM_cfi::jets, jetSelection_, jetSelection_HT_, jetToken_, edm::InputTag::label(), eostools::ls(), edm::EventID::luminosityBlock(), visualization-live-secondInstance_cfg::m, metInputTag_, metSelection_, metToken_, MJJ, muoInputTag_, PDWG_BPHSkim_cff::muons, muoSelection_, muoToken_, nelectrons_, njets_, nmuons_, num_genTriggerEventFlag_, HTMonitor::HTME::numerator, p4, phi, reco::LeafCandidate::phi(), reco::Vertex::position(), qME_variableBinning_, quantity_, edm::View< T >::size(), SOFTDROP, findQualityFiles::v, badGlobalMuonTaggersAOD_cff::vtx, vtxInputTag_, vtxToken_, and warningPrinted4token_.

218  {
219  // Filter out events if Trigger Filtering is requested
220  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
221  return;
222 
224  iEvent.getByToken(metToken_, metHandle);
225  if (!metHandle.isValid()) {
226  if (!warningPrinted4token_[0]) {
227  edm::LogWarning("HTMonitor") << "skipping events because the collection " << metInputTag_.label().c_str()
228  << " is not available";
229  warningPrinted4token_[0] = true;
230  }
231  return;
232  }
233  reco::PFMET pfmet = metHandle->front();
234  if (!metSelection_(pfmet))
235  return;
236 
237  edm::Handle<reco::JetView> jetHandle; //add a configurable jet collection & jet pt selection
238  iEvent.getByToken(jetToken_, jetHandle);
239  if (!jetHandle.isValid()) {
240  if (!warningPrinted4token_[1]) {
241  edm::LogWarning("HTMonitor") << "skipping events because the collection " << jetInputTag_.label().c_str()
242  << " is not available";
243  warningPrinted4token_[1] = true;
244  }
245  return;
246  }
247  std::vector<reco::Jet> jets;
248  if (jetHandle->size() < njets_)
249  return;
250  for (auto const& j : *jetHandle) {
251  if (jetSelection_(j)) {
252  jets.push_back(j);
253  }
254  }
255 
256  if (jets.size() < njets_)
257  return;
258 
259  float deltaPhi_met_j1 = 10.0;
260  float deltaPhi_j1_j2 = 10.0;
261 
262  if (!jets.empty())
263  deltaPhi_met_j1 = fabs(deltaPhi(pfmet.phi(), jets[0].phi()));
264  if (jets.size() >= 2)
265  deltaPhi_j1_j2 = fabs(deltaPhi(jets[0].phi(), jets[1].phi()));
266 
267  std::vector<reco::GsfElectron> electrons;
269  iEvent.getByToken(eleToken_, eleHandle);
270  if (eleHandle.isValid()) {
271  if (eleHandle->size() < nelectrons_)
272  return;
273  for (auto const& e : *eleHandle) {
274  if (eleSelection_(e))
275  electrons.push_back(e);
276  }
277  if (electrons.size() < nelectrons_)
278  return;
279  } else {
280  if (!warningPrinted4token_[2]) {
281  warningPrinted4token_[2] = true;
282  if (eleInputTag_.label().empty())
283  edm::LogWarning("HTMonitor") << "GsfElectronCollection not set";
284  else
285  edm::LogWarning("HTMonitor") << "skipping events because the collection " << eleInputTag_.label().c_str()
286  << " is not available";
287  }
288  if (!eleInputTag_.label().empty())
289  return;
290  }
291 
294  iEvent.getByToken(vtxToken_, vtxHandle);
295  if (vtxHandle.isValid()) {
296  for (auto const& v : *vtxHandle) {
297  bool isFake = v.isFake();
298 
299  if (!isFake) {
300  vtx = v;
301  break;
302  }
303  }
304  } else {
305  if (!warningPrinted4token_[3]) {
306  warningPrinted4token_[3] = true;
307  if (vtxInputTag_.label().empty())
308  edm::LogWarning("HTMonitor") << "VertexCollection not set";
309  else
310  edm::LogWarning("HTMonitor") << "skipping events because the collection " << vtxInputTag_.label().c_str()
311  << " is not available";
312  }
313  if (!vtxInputTag_.label().empty())
314  return;
315  }
316 
317  std::vector<reco::Muon> muons;
319  iEvent.getByToken(muoToken_, muoHandle);
320  if (muoHandle.isValid()) {
321  if (muoHandle->size() < nmuons_)
322  return;
323  for (auto const& m : *muoHandle) {
324  if (muoSelection_(m) && m.isGlobalMuon() && m.isPFMuon() && m.globalTrack()->normalizedChi2() < 10. &&
325  m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && m.numberOfMatchedStations() > 1 &&
326  fabs(m.muonBestTrack()->dxy(vtx.position())) < 0.2 && fabs(m.muonBestTrack()->dz(vtx.position())) < 0.5 &&
327  m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
328  m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5)
329  muons.push_back(m);
330  }
331  if (muons.size() < nmuons_)
332  return;
333  } else {
334  if (!warningPrinted4token_[4]) {
335  warningPrinted4token_[4] = true;
336  if (muoInputTag_.label().empty())
337  edm::LogWarning("HTMonitor") << "MuonCollection not set";
338  else
339  edm::LogWarning("HTMonitor") << "skipping events because the collection " << muoInputTag_.label().c_str()
340  << " is not available";
341  }
342  if (!muoInputTag_.label().empty())
343  return;
344  }
345 
346  // fill histograms
347  switch (quantity_) {
348  case HT: {
349  float ht = 0.0;
350  for (auto const& j : *jetHandle) {
351  if (jetSelection_HT_(j))
352  ht += j.pt();
353  }
354 
355  // filling histograms (denominator)
357 
358  deltaphimetj1ME_.denominator->Fill(deltaPhi_met_j1);
359  deltaphij1j2ME_.denominator->Fill(deltaPhi_j1_j2);
360 
361  int ls = iEvent.id().luminosityBlock();
362  htVsLS_.denominator->Fill(ls, ht);
363 
364  // applying selection for numerator
365  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
366  return;
367 
368  // filling histograms (num_genTriggerEventFlag_)
370 
371  htVsLS_.numerator->Fill(ls, ht);
372  deltaphimetj1ME_.numerator->Fill(deltaPhi_met_j1);
373  deltaphij1j2ME_.numerator->Fill(deltaPhi_j1_j2);
374  break;
375  }
376 
377  case MJJ: {
378  if (jets.size() < 2)
379  return;
380 
381  // deltaEta cut
382  if (fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_)
383  return;
384  float mjj = (jets[0].p4() + jets[1].p4()).M();
385 
387 
388  // applying selection for numerator
389  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
390  return;
391 
393  break;
394  }
395 
396  case SOFTDROP: {
397  if (jets.size() < 2)
398  return;
399 
400  // deltaEta cut
401  if (fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_)
402  return;
403 
404  float softdrop = jets[0].p4().M();
405 
407 
408  // applying selection for numerator
409  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
410  return;
411 
413  break;
414  }
415  }
416 }
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.h:129
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.h:145
double dEtaCut_
Definition: HTMonitor.h:152
MonitorElement * denominator
Definition: HTMonitor.h:60
quant quantity_
Definition: HTMonitor.h:118
HTME qME_variableBinning_
Definition: HTMonitor.h:136
edm::InputTag muoInputTag_
Definition: HTMonitor.h:123
size_type size() const
unsigned njets_
Definition: HTMonitor.h:149
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: HTMonitor.h:130
edm::InputTag jetInputTag_
Definition: HTMonitor.h:121
const Point & position() const
position
Definition: Vertex.h:113
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:142
void Fill(long long x)
std::vector< bool > warningPrinted4token_
Definition: HTMonitor.h:158
Definition: HTMonitor.h:44
int iEvent
Definition: GenABIO.cc:224
edm::InputTag eleInputTag_
Definition: HTMonitor.h:122
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.h:147
double p4[4]
Definition: TauolaWrapper.h:92
MonitorElement * numerator
Definition: HTMonitor.h:59
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.h:128
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.h:144
def ls(path, rec=False)
Definition: eostools.py:349
edm::InputTag vtxInputTag_
Definition: HTMonitor.h:124
edm::InputTag metInputTag_
Definition: HTMonitor.h:120
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.h:146
unsigned nelectrons_
Definition: HTMonitor.h:150
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.h:127
std::string const & label() const
Definition: InputTag.h:36
HTME deltaphimetj1ME_
Definition: HTMonitor.h:138
HTME deltaphij1j2ME_
Definition: HTMonitor.h:139
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.h:126
Definition: HT.h:21
HTME htVsLS_
Definition: HTMonitor.h:137
double phi() const final
momentum azimuthal angle
unsigned nmuons_
Definition: HTMonitor.h:151
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.h:148
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:141
void HTMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 152 of file HTMonitor.cc.

References bookME(), deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, folderName_, ht_binning_, ht_variable_binning_, htVsLS_, ls_binning_, MJJ, HTMonitor::MEHTbinning::nbins, num_genTriggerEventFlag_, phi_binning_, qME_variableBinning_, quantity_, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), setHTitle(), SOFTDROP, AlCaHLTBitMon_QueryRunRegistry::string, HTMonitor::MEHTbinning::xmax, and HTMonitor::MEHTbinning::xmin.

152  {
153  std::string histname, histtitle;
154 
155  std::string currentFolder = folderName_;
156  ibooker.setCurrentFolder(currentFolder);
157 
158  switch (quantity_) {
159  case HT: {
160  histname = "ht_variable";
161  histtitle = "HT";
162  bookME(ibooker, qME_variableBinning_, histname, histtitle, ht_variable_binning_);
163  setHTitle(qME_variableBinning_, "HT [GeV]", "events / [GeV]");
164 
165  histname = "htVsLS";
166  histtitle = "HT vs LS";
167  bookME(ibooker,
168  htVsLS_,
169  histname,
170  histtitle,
175  ht_binning_.xmax);
176  setHTitle(htVsLS_, "LS", "HT [GeV]");
177 
178  histname = "deltaphi_metjet1";
179  histtitle = "DPHI_METJ1";
180  bookME(ibooker, deltaphimetj1ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
181  setHTitle(deltaphimetj1ME_, "delta phi (met, j1)", "events / 0.1 rad");
182 
183  histname = "deltaphi_jet1jet2";
184  histtitle = "DPHI_J1J2";
185  bookME(ibooker, deltaphij1j2ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
186  setHTitle(deltaphij1j2ME_, "delta phi (j1, j2)", "events / 0.1 rad");
187  break;
188  }
189 
190  case MJJ: {
191  histname = "mjj_variable";
192  histtitle = "Mjj";
193  bookME(ibooker, qME_variableBinning_, histname, histtitle, ht_variable_binning_);
194  setHTitle(qME_variableBinning_, "Mjj [GeV]", "events / [GeV]");
195  break;
196  }
197 
198  case SOFTDROP: {
199  histname = "softdrop_variable";
200  histtitle = "softdropmass";
201  bookME(ibooker, qME_variableBinning_, histname, histtitle, ht_variable_binning_);
202  setHTitle(qME_variableBinning_, "leading jet softdropmass [GeV]", "events / [GeV]");
203  break;
204  }
205  }
206 
207  // Initialize the GenericTriggerEventFlag
209  num_genTriggerEventFlag_->initRun(iRun, iSetup);
211  den_genTriggerEventFlag_->initRun(iRun, iSetup);
212 }
quant quantity_
Definition: HTMonitor.h:118
void setHTitle(HTME &me, const std::string &titleX, const std::string &titleY)
Definition: HTMonitor.cc:78
void bookME(DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: HTMonitor.cc:85
HTME qME_variableBinning_
Definition: HTMonitor.h:136
std::vector< double > ht_variable_binning_
Definition: HTMonitor.h:132
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:142
Definition: HTMonitor.h:44
MEHTbinning ht_binning_
Definition: HTMonitor.h:133
MEHTbinning ls_binning_
Definition: HTMonitor.h:134
std::string folderName_
Definition: HTMonitor.h:116
HTME deltaphimetj1ME_
Definition: HTMonitor.h:138
HTME deltaphij1j2ME_
Definition: HTMonitor.h:139
Definition: HT.h:21
HTME htVsLS_
Definition: HTMonitor.h:137
static MEHTbinning phi_binning_
Definition: HTMonitor.h:156
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:141
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbins,
double  xmin,
double  xmax 
)
protected

Definition at line 85 of file HTMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), HTMonitor::HTME::denominator, and HTMonitor::HTME::numerator.

Referenced by bookHistograms().

91  {
92  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, min, max);
93  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, min, max);
94 }
T min(T a, T b)
Definition: MathUtil.h:58
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX 
)
protected

Definition at line 95 of file HTMonitor.cc.

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

99  {
100  int nbins = binning.size() - 1;
101  std::vector<float> fbinning(binning.begin(), binning.end());
102  float* arr = &fbinning[0];
103  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, arr);
104  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, arr);
105 }
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
protected

Definition at line 106 of file HTMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), HTMonitor::HTME::denominator, and HTMonitor::HTME::numerator.

114  {
115  me.numerator =
116  ibooker.bookProfile(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, ymin, ymax);
117  me.denominator =
118  ibooker.bookProfile(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, ymin, ymax);
119 }
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
int  nbinsY,
double  ymin,
double  ymax 
)
protected
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX,
const std::vector< double > &  binningY 
)
protected

Definition at line 135 of file HTMonitor.cc.

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

140  {
141  int nbinsX = binningX.size() - 1;
142  std::vector<float> fbinningX(binningX.begin(), binningX.end());
143  float* arrX = &fbinningX[0];
144  int nbinsY = binningY.size() - 1;
145  std::vector<float> fbinningY(binningY.begin(), binningY.end());
146  float* arrY = &fbinningY[0];
147 
148  me.numerator = ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, arrX, nbinsY, arrY);
149  me.denominator = ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, arrX, nbinsY, arrY);
150 }
void HTMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 430 of file HTMonitor.cc.

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

430  {
432  desc.add<std::string>("FolderName", "HLT/HT");
433  desc.add<std::string>("quantity", "HT");
434 
435  desc.add<edm::InputTag>("met", edm::InputTag("pfMet"));
436  desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
437  desc.add<edm::InputTag>("electrons", edm::InputTag("gedGsfElectrons"));
438  desc.add<edm::InputTag>("muons", edm::InputTag("muons"));
439  desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
440  desc.add<std::string>("metSelection", "pt > 0");
441  desc.add<std::string>("jetSelection", "pt > 0");
442  desc.add<std::string>("eleSelection", "pt > 0");
443  desc.add<std::string>("muoSelection", "pt > 0");
444  desc.add<std::string>("jetSelection_HT", "pt > 30 && eta < 2.5");
445  desc.add<unsigned>("njets", 0);
446  desc.add<unsigned>("nelectrons", 0);
447  desc.add<unsigned>("nmuons", 0);
448  desc.add<double>("dEtaCut", 1.3);
449 
451  genericTriggerEventPSet.add<bool>("andOr");
452  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi"));
453  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions", {});
454  genericTriggerEventPSet.add<bool>("andOrDcs", false);
455  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
456  genericTriggerEventPSet.add<std::string>("dbLabel", "");
457  genericTriggerEventPSet.add<bool>("andOrHlt", true);
458  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT"));
459  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths", {});
460  genericTriggerEventPSet.add<std::string>("hltDBKey", "");
461  genericTriggerEventPSet.add<bool>("errorReplyHlt", false);
462  genericTriggerEventPSet.add<unsigned int>("verbosityLevel", 1);
463 
464  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
465  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
466 
469  fillHistoPSetDescription(htPSet);
471  std::vector<double> bins = {0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140.,
472  150., 160., 170., 180., 190., 200., 220., 240., 260., 280., 300.,
473  350., 400., 450., 500., 550., 600., 650., 700., 750., 800., 850.,
474  900., 950., 1000., 1050., 1100., 1200., 1300., 1400., 1500., 2000., 2500.};
475  histoPSet.add<std::vector<double> >("htBinning", bins);
476 
480 
481  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
482 
483  descriptions.add("htMonitoring", desc);
484 }
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: HTMonitor.cc:424
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: HTMonitor.cc:418
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HTMonitor::fillHistoLSPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 424 of file HTMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

424  {
425  pset.add<unsigned int>("nbins", 2500);
426  pset.add<double>("xmin", 0.);
427  pset.add<double>("xmax", 2500.);
428 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void HTMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 418 of file HTMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

418  {
419  pset.add<unsigned int>("nbins");
420  pset.add<double>("xmin");
421  pset.add<double>("xmax");
422 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HTMonitor::MEHTbinning HTMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 74 of file HTMonitor.cc.

References edm::ParameterSet::getParameter().

74  {
75  return HTMonitor::MEHTbinning{pset.getParameter<unsigned>("nbins"), 0., double(pset.getParameter<unsigned>("nbins"))};
76 }
T getParameter(std::string const &) const
HTMonitor::MEHTbinning HTMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 66 of file HTMonitor.cc.

References edm::ParameterSet::getParameter().

66  {
68  pset.getParameter<unsigned>("nbins"),
69  pset.getParameter<double>("xmin"),
70  pset.getParameter<double>("xmax"),
71  };
72 }
T getParameter(std::string const &) const
void HTMonitor::setHTitle ( HTME me,
const std::string &  titleX,
const std::string &  titleY 
)
protected

Definition at line 78 of file HTMonitor.cc.

References HTMonitor::HTME::denominator, HTMonitor::HTME::numerator, and dqm::impl::MonitorElement::setAxisTitle().

Referenced by bookHistograms().

78  {
79  me.numerator->setAxisTitle(titleX, 1);
80  me.numerator->setAxisTitle(titleY, 2);
81  me.denominator->setAxisTitle(titleX, 1);
82  me.denominator->setAxisTitle(titleY, 2);
83 }

Member Data Documentation

HTME HTMonitor::deltaphij1j2ME_
private

Definition at line 139 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

HTME HTMonitor::deltaphimetj1ME_
private

Definition at line 138 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 142 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

double HTMonitor::dEtaCut_
private

Definition at line 152 of file HTMonitor.h.

Referenced by analyze().

edm::InputTag HTMonitor::eleInputTag_
private

Definition at line 122 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 146 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 128 of file HTMonitor.h.

Referenced by analyze().

std::string HTMonitor::folderName_
private

Definition at line 116 of file HTMonitor.h.

Referenced by bookHistograms().

std::string HTMonitor::histoSuffix_
private

Definition at line 117 of file HTMonitor.h.

MEHTbinning HTMonitor::ht_binning_
private

Definition at line 133 of file HTMonitor.h.

Referenced by bookHistograms().

std::vector<double> HTMonitor::ht_variable_binning_
private

Definition at line 132 of file HTMonitor.h.

Referenced by bookHistograms().

HTME HTMonitor::htVsLS_
private

Definition at line 137 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag HTMonitor::jetInputTag_
private

Definition at line 121 of file HTMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::Jet, true> HTMonitor::jetSelection_
private

Definition at line 145 of file HTMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::Jet, true> HTMonitor::jetSelection_HT_
private

Definition at line 148 of file HTMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::JetView> HTMonitor::jetToken_
private

Definition at line 127 of file HTMonitor.h.

Referenced by analyze().

MEHTbinning HTMonitor::ls_binning_
private

Definition at line 134 of file HTMonitor.h.

Referenced by bookHistograms().

double HTMonitor::MAXedge_PHI = 3.2
staticprivate

Definition at line 154 of file HTMonitor.h.

edm::InputTag HTMonitor::metInputTag_
private

Definition at line 120 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 144 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 126 of file HTMonitor.h.

Referenced by analyze().

edm::InputTag HTMonitor::muoInputTag_
private

Definition at line 123 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 147 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 129 of file HTMonitor.h.

Referenced by analyze().

int HTMonitor::Nbin_PHI = 64
staticprivate

Definition at line 155 of file HTMonitor.h.

unsigned HTMonitor::nelectrons_
private

Definition at line 150 of file HTMonitor.h.

Referenced by analyze().

unsigned HTMonitor::njets_
private

Definition at line 149 of file HTMonitor.h.

Referenced by analyze().

unsigned HTMonitor::nmuons_
private

Definition at line 151 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 141 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

MEHTbinning HTMonitor::phi_binning_ {Nbin_PHI, -MAXedge_PHI, MAXedge_PHI}
staticprivate

Definition at line 156 of file HTMonitor.h.

Referenced by bookHistograms().

HTME HTMonitor::qME_variableBinning_
private

Definition at line 136 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

quant HTMonitor::quantity_
private

Definition at line 118 of file HTMonitor.h.

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

edm::InputTag HTMonitor::vtxInputTag_
private

Definition at line 124 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 130 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 158 of file HTMonitor.h.

Referenced by analyze(), and HTMonitor().