CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Static Private Attributes
HTMonitor Class Reference
Inheritance diagram for HTMonitor:
DQMEDAnalyzer TriggerDQMBase edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Types

typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Types inherited from TriggerDQMBase
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

 HTMonitor (const edm::ParameterSet &)
 
 ~HTMonitor () override throw ()
 
- 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
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
- Public Member Functions inherited from TriggerDQMBase
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbinsX, const double xmin, const double xmax, const double ymin, const double ymax, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbinsX, const double xmin, const double xmax, const uint nbinsY, const double ymin, const double ymax, const bool bookDen=true)
 
void bookME (DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY, const bool bookDen=true)
 
void setMETitle (ObjME &me, const std::string &titleX, const std::string &titleY)
 
 TriggerDQMBase ()=default
 
virtual ~TriggerDQMBase ()=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Static Public Member Functions inherited from TriggerDQMBase
static void fillHistoLSPSetDescription (edm::ParameterSetDescription &pset)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 
static MEbinning getHistoLSPSet (const edm::ParameterSet &pset)
 
static MEbinning getHistoPSet (const edm::ParameterSet &pset)
 

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
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Types

enum  quant { HT, MJJ, SOFTDROP }
 

Private Attributes

ObjME deltaphij1j2ME_
 
ObjME deltaphimetj1ME_
 
std::unique_ptr
< GenericTriggerEventFlag
den_genTriggerEventFlag_
 
double dEtaCut_
 
edm::InputTag eleInputTag_
 
StringCutObjectSelector
< reco::GsfElectron, true > 
eleSelection_
 
edm::EDGetTokenT
< reco::GsfElectronCollection
eleToken_
 
const std::string folderName_
 
bool hltPathsAreValid_
 
MEbinning ht_binning_
 
std::vector< double > ht_variable_binning_
 
ObjME htVsLS_
 
edm::InputTag jetInputTag_
 
StringCutObjectSelector
< reco::Jet, true > 
jetSelection_
 
StringCutObjectSelector
< reco::Jet, true > 
jetSelection_HT_
 
edm::EDGetTokenT< reco::JetViewjetToken_
 
MEbinning ls_binning_
 
edm::InputTag metInputTag_
 
StringCutObjectSelector
< reco::MET, true > 
metSelection_
 
edm::EDGetTokenT
< reco::PFMETCollection
metToken_
 
edm::InputTag muoInputTag_
 
StringCutObjectSelector
< reco::Muon, true > 
muoSelection_
 
edm::EDGetTokenT
< reco::MuonCollection
muoToken_
 
unsigned nelectrons_
 
unsigned njets_
 
unsigned nmuons_
 
std::unique_ptr
< GenericTriggerEventFlag
num_genTriggerEventFlag_
 
ObjME qME_variableBinning_
 
quant quantity_
 
const bool requireValidHLTPaths_
 
edm::InputTag vtxInputTag_
 
edm::EDGetTokenT
< reco::VertexCollection
vtxToken_
 
bool warningWasPrinted_
 

Static Private Attributes

static constexpr double MAXedge_PHI = 3.2
 
static constexpr int Nbin_PHI = 64
 
static constexpr MEbinning phi_binning_ {Nbin_PHI, -MAXedge_PHI, MAXedge_PHI}
 

Additional Inherited Members

- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 38 of file HTMonitor.cc.

Member Typedef Documentation

Definition at line 41 of file HTMonitor.cc.

Definition at line 40 of file HTMonitor.cc.

Member Enumeration Documentation

enum HTMonitor::quant
private
Enumerator
HT 
MJJ 
SOFTDROP 

Definition at line 97 of file HTMonitor.cc.

Constructor & Destructor Documentation

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

Definition at line 101 of file HTMonitor.cc.

References Exception, edm::ParameterSet::getParameter(), HT, MJJ, quantity_, SOFTDROP, and AlCaHLTBitMon_QueryRunRegistry::string.

102  : folderName_(iConfig.getParameter<std::string>("FolderName")),
103  requireValidHLTPaths_(iConfig.getParameter<bool>("requireValidHLTPaths")),
104  hltPathsAreValid_(false),
105  metInputTag_(iConfig.getParameter<edm::InputTag>("met")),
106  jetInputTag_(iConfig.getParameter<edm::InputTag>("jets")),
107  eleInputTag_(iConfig.getParameter<edm::InputTag>("electrons")),
108  muoInputTag_(iConfig.getParameter<edm::InputTag>("muons")),
109  vtxInputTag_(iConfig.getParameter<edm::InputTag>("vertices")),
110  metToken_(consumes<reco::PFMETCollection>(metInputTag_)),
111  jetToken_(mayConsume<reco::JetView>(jetInputTag_)),
112  eleToken_(mayConsume<reco::GsfElectronCollection>(eleInputTag_)),
113  muoToken_(mayConsume<reco::MuonCollection>(muoInputTag_)),
114  vtxToken_(mayConsume<reco::VertexCollection>(vtxInputTag_)),
116  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("htBinning")),
117  ht_binning_(
118  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("htPSet"))),
119  ls_binning_(
120  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("lsPSet"))),
122  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
124  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
125  metSelection_(iConfig.getParameter<std::string>("metSelection")),
126  jetSelection_(iConfig.getParameter<std::string>("jetSelection")),
127  eleSelection_(iConfig.getParameter<std::string>("eleSelection")),
128  muoSelection_(iConfig.getParameter<std::string>("muoSelection")),
129  jetSelection_HT_(iConfig.getParameter<std::string>("jetSelection_HT")),
130  njets_(iConfig.getParameter<unsigned>("njets")),
131  nelectrons_(iConfig.getParameter<unsigned>("nelectrons")),
132  nmuons_(iConfig.getParameter<unsigned>("nmuons")),
133  dEtaCut_(iConfig.getParameter<double>("dEtaCut")),
134  warningWasPrinted_(false) {
135  /* mia: THIS CODE SHOULD BE DELETED !!!! */
136  string quantity = iConfig.getParameter<std::string>("quantity");
137  if (quantity == "HT") {
138  quantity_ = HT;
139  } else if (quantity == "Mjj") {
140  quantity_ = MJJ;
141  } else if (quantity == "softdrop") {
143  } else {
144  throw cms::Exception("quantity not defined")
145  << "the quantity '" << quantity << "' is undefined. Please check your config!" << std::endl;
146  }
147 }
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.cc:66
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.cc:82
double dEtaCut_
Definition: HTMonitor.cc:89
quant quantity_
Definition: HTMonitor.cc:98
const bool requireValidHLTPaths_
Definition: HTMonitor.cc:54
edm::InputTag muoInputTag_
Definition: HTMonitor.cc:60
std::vector< double > ht_variable_binning_
Definition: HTMonitor.cc:69
unsigned njets_
Definition: HTMonitor.cc:86
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.cc:67
edm::InputTag jetInputTag_
Definition: HTMonitor.cc:58
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.cc:79
MEbinning ht_binning_
Definition: HTMonitor.cc:70
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
edm::InputTag eleInputTag_
Definition: HTMonitor.cc:59
MEbinning ls_binning_
Definition: HTMonitor.cc:71
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.cc:84
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.cc:65
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.cc:81
edm::InputTag vtxInputTag_
Definition: HTMonitor.cc:61
edm::InputTag metInputTag_
Definition: HTMonitor.cc:57
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.cc:83
unsigned nelectrons_
Definition: HTMonitor.cc:87
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.cc:64
const std::string folderName_
Definition: HTMonitor.cc:52
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool warningWasPrinted_
Definition: HTMonitor.cc:95
bool hltPathsAreValid_
Definition: HTMonitor.cc:55
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.cc:63
unsigned nmuons_
Definition: HTMonitor.cc:88
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.cc:85
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.cc:78
HTMonitor::~HTMonitor ( )
throw (
)
override

Definition at line 149 of file HTMonitor.cc.

References den_genTriggerEventFlag_, and num_genTriggerEventFlag_.

149  {
151  num_genTriggerEventFlag_.reset();
152  }
154  den_genTriggerEventFlag_.reset();
155  }
156 }
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.cc:79
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.cc:78

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 233 of file HTMonitor.cc.

References srCondWrite_cfg::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, TriggerDQMBase::ObjME::denominator, dEtaCut_, alignCSCRings::e, HI_PhotonSkim_cff::electrons, eleInputTag_, eleSelection_, eleToken_, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), hltPathsAreValid_, htVsLS_, edm::EventBase::id(), edm::HandleBase::isValid(), dqmiolumiharvest::j, jetInputTag_, fwrapper::jets, jetSelection_, jetSelection_HT_, jetToken_, edm::InputTag::label(), eostools::ls(), edm::EventID::luminosityBlock(), visualization-live-secondInstance_cfg::m, metInputTag_, metSelection_, metToken_, MJJ, muoInputTag_, patZpeak::muons, muoSelection_, muoToken_, nelectrons_, njets_, nmuons_, num_genTriggerEventFlag_, TriggerDQMBase::ObjME::numerator, phi, reco::LeafCandidate::phi(), reco::Vertex::position(), qME_variableBinning_, quantity_, requireValidHLTPaths_, SOFTDROP, findQualityFiles::v, vtxInputTag_, vtxToken_, and warningWasPrinted_.

233  {
234  // if valid HLT paths are required,
235  // analyze event only if all paths are valid
237  return;
238  }
239 
240  // Filter out events if Trigger Filtering is requested
241  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
242  return;
243 
245  iEvent.getByToken(metToken_, metHandle);
246  if (not metHandle.isValid()) {
247  if (not warningWasPrinted_) {
248  edm::LogWarning("HTMonitor") << "skipping events because the collection " << metInputTag_.label().c_str()
249  << " is not available";
250  warningWasPrinted_ = true;
251  }
252  return;
253  }
254  reco::PFMET pfmet = metHandle->front();
255  if (!metSelection_(pfmet))
256  return;
257 
258  edm::Handle<reco::JetView> jetHandle; //add a configurable jet collection & jet pt selection
259  iEvent.getByToken(jetToken_, jetHandle);
260  if (!jetHandle.isValid()) {
261  if (not warningWasPrinted_) {
262  edm::LogWarning("HTMonitor") << "skipping events because the collection " << jetInputTag_.label().c_str()
263  << " is not available";
264  warningWasPrinted_ = true;
265  }
266  return;
267  }
268  std::vector<reco::Jet> jets;
269  if (jetHandle->size() < njets_)
270  return;
271  for (auto const& j : *jetHandle) {
272  if (jetSelection_(j)) {
273  jets.push_back(j);
274  }
275  }
276 
277  if (jets.size() < njets_)
278  return;
279 
280  float deltaPhi_met_j1 = 10.0;
281  float deltaPhi_j1_j2 = 10.0;
282 
283  if (!jets.empty())
284  deltaPhi_met_j1 = fabs(deltaPhi(pfmet.phi(), jets[0].phi()));
285  if (jets.size() >= 2)
286  deltaPhi_j1_j2 = fabs(deltaPhi(jets[0].phi(), jets[1].phi()));
287 
288  std::vector<reco::GsfElectron> electrons;
290  iEvent.getByToken(eleToken_, eleHandle);
291  if (eleHandle.isValid()) {
292  if (eleHandle->size() < nelectrons_)
293  return;
294  for (auto const& e : *eleHandle) {
295  if (eleSelection_(e))
296  electrons.push_back(e);
297  }
298  if (electrons.size() < nelectrons_)
299  return;
300  } else {
301  if (not warningWasPrinted_) {
302  if (eleInputTag_.label().empty())
303  edm::LogWarning("HTMonitor") << "GsfElectronCollection not set";
304  else
305  edm::LogWarning("HTMonitor") << "skipping events because the collection " << eleInputTag_.label().c_str()
306  << " is not available";
307 
308  warningWasPrinted_ = true;
309  }
310  if (!eleInputTag_.label().empty())
311  return;
312  }
313 
314  reco::Vertex vtx;
316  iEvent.getByToken(vtxToken_, vtxHandle);
317  if (vtxHandle.isValid()) {
318  for (auto const& v : *vtxHandle) {
319  bool isFake = v.isFake();
320 
321  if (!isFake) {
322  vtx = v;
323  break;
324  }
325  }
326  } else {
327  if (not warningWasPrinted_) {
328  if (vtxInputTag_.label().empty())
329  edm::LogWarning("HTMonitor") << "VertexCollection not set";
330  else
331  edm::LogWarning("HTMonitor") << "skipping events because the collection " << vtxInputTag_.label().c_str()
332  << " is not available";
333 
334  warningWasPrinted_ = true;
335  }
336  if (!vtxInputTag_.label().empty())
337  return;
338  }
339 
340  std::vector<reco::Muon> muons;
342  iEvent.getByToken(muoToken_, muoHandle);
343  if (muoHandle.isValid()) {
344  if (muoHandle->size() < nmuons_)
345  return;
346  for (auto const& m : *muoHandle) {
347  if (muoSelection_(m) && m.isGlobalMuon() && m.isPFMuon() && m.globalTrack()->normalizedChi2() < 10. &&
348  m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && m.numberOfMatchedStations() > 1 &&
349  fabs(m.muonBestTrack()->dxy(vtx.position())) < 0.2 && fabs(m.muonBestTrack()->dz(vtx.position())) < 0.5 &&
350  m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
351  m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5)
352  muons.push_back(m);
353  }
354  if (muons.size() < nmuons_)
355  return;
356  } else {
357  if (not warningWasPrinted_) {
358  if (muoInputTag_.label().empty())
359  edm::LogWarning("HTMonitor") << "MuonCollection not set";
360  else
361  edm::LogWarning("HTMonitor") << "skipping events because the collection " << muoInputTag_.label().c_str()
362  << " is not available";
363 
364  warningWasPrinted_ = true;
365  }
366  if (!muoInputTag_.label().empty())
367  return;
368  }
369 
370  // fill histograms
371  switch (quantity_) {
372  case HT: {
373  float ht = 0.0;
374  for (auto const& j : *jetHandle) {
375  if (jetSelection_HT_(j))
376  ht += j.pt();
377  }
378 
379  // filling histograms (denominator)
381 
382  deltaphimetj1ME_.denominator->Fill(deltaPhi_met_j1);
383  deltaphij1j2ME_.denominator->Fill(deltaPhi_j1_j2);
384 
385  int ls = iEvent.id().luminosityBlock();
386  htVsLS_.denominator->Fill(ls, ht);
387 
388  // applying selection for numerator
389  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
390  return;
391 
392  // filling histograms (num_genTriggerEventFlag_)
394 
395  htVsLS_.numerator->Fill(ls, ht);
396  deltaphimetj1ME_.numerator->Fill(deltaPhi_met_j1);
397  deltaphij1j2ME_.numerator->Fill(deltaPhi_j1_j2);
398  break;
399  }
400 
401  case MJJ: {
402  if (jets.size() < 2)
403  return;
404 
405  // deltaEta cut
406  if (fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_)
407  return;
408  float mjj = (jets[0].p4() + jets[1].p4()).M();
409 
411 
412  // applying selection for numerator
413  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
414  return;
415 
417  break;
418  }
419 
420  case SOFTDROP: {
421  if (jets.size() < 2)
422  return;
423 
424  // deltaEta cut
425  if (fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_)
426  return;
427 
428  float softdrop = jets[0].p4().M();
429 
431 
432  // applying selection for numerator
433  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
434  return;
435 
437  break;
438  }
439  }
440 }
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.cc:66
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.cc:82
double dEtaCut_
Definition: HTMonitor.cc:89
quant quantity_
Definition: HTMonitor.cc:98
const bool requireValidHLTPaths_
Definition: HTMonitor.cc:54
edm::InputTag muoInputTag_
Definition: HTMonitor.cc:60
def ls
Definition: eostools.py:349
ObjME deltaphij1j2ME_
Definition: HTMonitor.cc:76
unsigned njets_
Definition: HTMonitor.cc:86
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: HTMonitor.cc:67
edm::InputTag jetInputTag_
Definition: HTMonitor.cc:58
const Point & position() const
position
Definition: Vertex.h:127
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.cc:79
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
edm::InputTag eleInputTag_
Definition: HTMonitor.cc:59
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.cc:84
vector< PseudoJet > jets
MonitorElement * denominator
MonitorElement * numerator
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.cc:65
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.cc:81
edm::InputTag vtxInputTag_
Definition: HTMonitor.cc:61
edm::InputTag metInputTag_
Definition: HTMonitor.cc:57
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.cc:83
unsigned nelectrons_
Definition: HTMonitor.cc:87
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.cc:64
ObjME deltaphimetj1ME_
Definition: HTMonitor.cc:75
std::string const & label() const
Definition: InputTag.h:36
bool warningWasPrinted_
Definition: HTMonitor.cc:95
tuple muons
Definition: patZpeak.py:41
ObjME htVsLS_
Definition: HTMonitor.cc:74
bool hltPathsAreValid_
Definition: HTMonitor.cc:55
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.cc:63
Log< level::Warning, false > LogWarning
Definition: HT.h:21
ObjME qME_variableBinning_
Definition: HTMonitor.cc:73
double phi() const final
momentum azimuthal angle
unsigned nmuons_
Definition: HTMonitor.cc:88
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.cc:85
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.cc:78
void HTMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 158 of file HTMonitor.cc.

References TriggerDQMBase::bookME(), deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, folderName_, hltPathsAreValid_, ht_binning_, ht_variable_binning_, htVsLS_, ls_binning_, MJJ, TriggerDQMBase::MEbinning::nbins, num_genTriggerEventFlag_, phi_binning_, qME_variableBinning_, quantity_, requireValidHLTPaths_, dqm::implementation::NavigatorBase::setCurrentFolder(), TriggerDQMBase::setMETitle(), SOFTDROP, AlCaHLTBitMon_QueryRunRegistry::string, TriggerDQMBase::MEbinning::xmax, and TriggerDQMBase::MEbinning::xmin.

158  {
159  // Initialize the GenericTriggerEventFlag
161  num_genTriggerEventFlag_->initRun(iRun, iSetup);
162  }
164  den_genTriggerEventFlag_->initRun(iRun, iSetup);
165  }
166 
167  // check if every HLT path specified in numerator and denominator has a valid match in the HLT Menu
169  den_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->allHLTPathsAreValid() &&
170  den_genTriggerEventFlag_->allHLTPathsAreValid());
171 
172  // if valid HLT paths are required,
173  // create DQM outputs only if all paths are valid
175  return;
176  }
177 
178  std::string histname, histtitle;
179 
180  std::string currentFolder = folderName_;
181  ibooker.setCurrentFolder(currentFolder);
182 
183  switch (quantity_) {
184  case HT: {
185  histname = "ht_variable";
186  histtitle = "HT";
187  bookME(ibooker, qME_variableBinning_, histname, histtitle, ht_variable_binning_);
188  setMETitle(qME_variableBinning_, "HT [GeV]", "events / [GeV]");
189 
190  histname = "htVsLS";
191  histtitle = "HT vs LS";
192  bookME(ibooker,
193  htVsLS_,
194  histname,
195  histtitle,
200  ht_binning_.xmax);
201  setMETitle(htVsLS_, "LS", "HT [GeV]");
202 
203  histname = "deltaphi_metjet1";
204  histtitle = "DPHI_METJ1";
205  bookME(ibooker, deltaphimetj1ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
206  setMETitle(deltaphimetj1ME_, "delta phi (met, j1)", "events / 0.1 rad");
207 
208  histname = "deltaphi_jet1jet2";
209  histtitle = "DPHI_J1J2";
210  bookME(ibooker, deltaphij1j2ME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
211  setMETitle(deltaphij1j2ME_, "delta phi (j1, j2)", "events / 0.1 rad");
212  break;
213  }
214 
215  case MJJ: {
216  histname = "mjj_variable";
217  histtitle = "Mjj";
218  bookME(ibooker, qME_variableBinning_, histname, histtitle, ht_variable_binning_);
219  setMETitle(qME_variableBinning_, "Mjj [GeV]", "events / [GeV]");
220  break;
221  }
222 
223  case SOFTDROP: {
224  histname = "softdrop_variable";
225  histtitle = "softdropmass";
226  bookME(ibooker, qME_variableBinning_, histname, histtitle, ht_variable_binning_);
227  setMETitle(qME_variableBinning_, "leading jet softdropmass [GeV]", "events / [GeV]");
228  break;
229  }
230  }
231 }
quant quantity_
Definition: HTMonitor.cc:98
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
const bool requireValidHLTPaths_
Definition: HTMonitor.cc:54
std::vector< double > ht_variable_binning_
Definition: HTMonitor.cc:69
ObjME deltaphij1j2ME_
Definition: HTMonitor.cc:76
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.cc:79
MEbinning ht_binning_
Definition: HTMonitor.cc:70
MEbinning ls_binning_
Definition: HTMonitor.cc:71
static constexpr MEbinning phi_binning_
Definition: HTMonitor.cc:93
const std::string folderName_
Definition: HTMonitor.cc:52
ObjME deltaphimetj1ME_
Definition: HTMonitor.cc:75
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
ObjME htVsLS_
Definition: HTMonitor.cc:74
bool hltPathsAreValid_
Definition: HTMonitor.cc:55
Definition: HT.h:21
ObjME qME_variableBinning_
Definition: HTMonitor.cc:73
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.cc:78
void HTMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 442 of file HTMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, TriggerDQMBase::fillHistoLSPSetDescription(), TriggerDQMBase::fillHistoPSetDescription(), GenericTriggerEventFlag::fillPSetDescription(), HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

442  {
444  desc.add<std::string>("FolderName", "HLT/HT");
445  desc.add<bool>("requireValidHLTPaths", true);
446 
447  desc.add<edm::InputTag>("met", edm::InputTag("pfMet"));
448  desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
449  desc.add<edm::InputTag>("electrons", edm::InputTag("gedGsfElectrons"));
450  desc.add<edm::InputTag>("muons", edm::InputTag("muons"));
451  desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
452  desc.add<std::string>("metSelection", "pt > 0");
453  desc.add<std::string>("jetSelection", "pt > 0");
454  desc.add<std::string>("eleSelection", "pt > 0");
455  desc.add<std::string>("muoSelection", "pt > 0");
456  desc.add<std::string>("jetSelection_HT", "pt > 30 && eta < 2.5");
457  desc.add<unsigned>("njets", 0);
458  desc.add<unsigned>("nelectrons", 0);
459  desc.add<unsigned>("nmuons", 0);
460  desc.add<double>("dEtaCut", 1.3);
461 
462  edm::ParameterSetDescription genericTriggerEventPSet;
463  GenericTriggerEventFlag::fillPSetDescription(genericTriggerEventPSet);
464  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
465  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
466 
469  fillHistoPSetDescription(htPSet);
470  histoPSet.add<edm::ParameterSetDescription>("htPSet", 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 
479  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
480 
481  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
482 
483  desc.add<std::string>("quantity", "HT");
484 
485  descriptions.add("htMonitoring", desc);
486 }
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillPSetDescription(edm::ParameterSetDescription &desc)

Member Data Documentation

ObjME HTMonitor::deltaphij1j2ME_
private

Definition at line 76 of file HTMonitor.cc.

Referenced by analyze(), and bookHistograms().

ObjME HTMonitor::deltaphimetj1ME_
private

Definition at line 75 of file HTMonitor.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 79 of file HTMonitor.cc.

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

double HTMonitor::dEtaCut_
private

Definition at line 89 of file HTMonitor.cc.

Referenced by analyze().

edm::InputTag HTMonitor::eleInputTag_
private

Definition at line 59 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 83 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 65 of file HTMonitor.cc.

Referenced by analyze().

const std::string HTMonitor::folderName_
private

Definition at line 52 of file HTMonitor.cc.

Referenced by bookHistograms().

bool HTMonitor::hltPathsAreValid_
private

Definition at line 55 of file HTMonitor.cc.

Referenced by analyze(), and bookHistograms().

MEbinning HTMonitor::ht_binning_
private

Definition at line 70 of file HTMonitor.cc.

Referenced by bookHistograms().

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

Definition at line 69 of file HTMonitor.cc.

Referenced by bookHistograms().

ObjME HTMonitor::htVsLS_
private

Definition at line 74 of file HTMonitor.cc.

Referenced by analyze(), and bookHistograms().

edm::InputTag HTMonitor::jetInputTag_
private

Definition at line 58 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 82 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 85 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 64 of file HTMonitor.cc.

Referenced by analyze().

MEbinning HTMonitor::ls_binning_
private

Definition at line 71 of file HTMonitor.cc.

Referenced by bookHistograms().

constexpr double HTMonitor::MAXedge_PHI = 3.2
staticprivate

Definition at line 91 of file HTMonitor.cc.

edm::InputTag HTMonitor::metInputTag_
private

Definition at line 57 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 81 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 63 of file HTMonitor.cc.

Referenced by analyze().

edm::InputTag HTMonitor::muoInputTag_
private

Definition at line 60 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 84 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 66 of file HTMonitor.cc.

Referenced by analyze().

constexpr int HTMonitor::Nbin_PHI = 64
staticprivate

Definition at line 92 of file HTMonitor.cc.

unsigned HTMonitor::nelectrons_
private

Definition at line 87 of file HTMonitor.cc.

Referenced by analyze().

unsigned HTMonitor::njets_
private

Definition at line 86 of file HTMonitor.cc.

Referenced by analyze().

unsigned HTMonitor::nmuons_
private

Definition at line 88 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 78 of file HTMonitor.cc.

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

constexpr MEbinning HTMonitor::phi_binning_ {Nbin_PHI, -MAXedge_PHI, MAXedge_PHI}
staticprivate

Definition at line 93 of file HTMonitor.cc.

Referenced by bookHistograms().

ObjME HTMonitor::qME_variableBinning_
private

Definition at line 73 of file HTMonitor.cc.

Referenced by analyze(), and bookHistograms().

quant HTMonitor::quantity_
private

Definition at line 98 of file HTMonitor.cc.

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

const bool HTMonitor::requireValidHLTPaths_
private

Definition at line 54 of file HTMonitor.cc.

Referenced by analyze(), and bookHistograms().

edm::InputTag HTMonitor::vtxInputTag_
private

Definition at line 61 of file HTMonitor.cc.

Referenced by analyze().

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

Definition at line 67 of file HTMonitor.cc.

Referenced by analyze().

bool HTMonitor::warningWasPrinted_
private

Definition at line 95 of file HTMonitor.cc.

Referenced by analyze().