CMS 3D CMS Logo

HLTObjectMonitorProtonLead.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: QM/HLTObjectMonitorProtonLead
4 // Class: HLTObjectMonitorProtonLead
5 //
13 //
14 // Original Author: Varun Sharma
15 // Created: Fri, 21 Oct 2016 12:29:00 GMT
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 #include <sys/time.h>
22 #include <cstdlib>
23 
24 // user include files
29 
35 
37 
38 //for collections
48 
51 
52 #include "TMath.h"
53 #include "TStyle.h"
54 #include "TLorentzVector.h"
55 
56 #include <unordered_map>
57 //
58 // class declaration
59 //
60 
61 //using namespace edm;
62 using namespace trigger;
63 using std::string;
64 using std::unordered_map;
65 using std::vector;
66 
68  struct hltPlot {
70  string pathName;
71  string pathNameOR;
72  string moduleName;
73  string moduleNameOR;
74  int pathIndex = -99;
75  int pathIndexOR = -99;
76  string plotLabel;
77  string xAxisLabel;
78  int nBins;
79  double xMin;
80  double xMax;
82  };
83 
84 public:
86  ~HLTObjectMonitorProtonLead() override;
87 
88  // static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
89 
90 private:
91  void analyze(const edm::Event&, const edm::EventSetup&) override;
92  void bookHistograms(DQMStore::IBooker& i, edm::Run const&, edm::EventSetup const&) override;
93  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
94  vector<hltPlot*> plotList;
95  //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
96  //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
97  double get_wall_time(void);
98  // ----------member data ---------------------------
99 
104  string backupFolder;
105  unordered_map<string, bool> acceptMap;
106  unordered_map<hltPlot*, edm::ParameterSet*> plotMap;
107 
108  //set Token(-s)
111 
112  //declare params
113  //pPb run
154 
155  string processName_;
156 
197 };
198 
199 //
200 // constants, enums and typedefs
201 //
202 
203 //
204 // static data member definitions
205 //
206 
207 //
208 // constructors and destructor
209 //
211 
212 {
213  //now do what ever initialization is needed
214  debugPrint = false;
215 
216  topDirectoryName = "HLT/ObjectMonitor";
217  mainShifterFolder = topDirectoryName + "/MainShifter";
218  backupFolder = topDirectoryName + "/Backup";
219 
220  //parse params
221  processName_ = iConfig.getParameter<string>("processName");
222 
223  caloAK4JetPt_pset = iConfig.getParameter<edm::ParameterSet>("caloAK4JetPt");
224  plotMap[&caloAK4JetPt_] = &caloAK4JetPt_pset;
225  caloAK4JetEta_pset = iConfig.getParameter<edm::ParameterSet>("caloAK4JetEta");
226  plotMap[&caloAK4JetEta_] = &caloAK4JetEta_pset;
227  caloAK4JetPhi_pset = iConfig.getParameter<edm::ParameterSet>("caloAK4JetPhi");
228  plotMap[&caloAK4JetPhi_] = &caloAK4JetPhi_pset;
229  pfAK4JetPt_pset = iConfig.getParameter<edm::ParameterSet>("pfAK4JetPt");
230  plotMap[&pfAK4JetPt_] = &pfAK4JetPt_pset;
231  pfAK4JetEta_pset = iConfig.getParameter<edm::ParameterSet>("pfAK4JetEta");
232  plotMap[&pfAK4JetEta_] = &pfAK4JetEta_pset;
233  pfAK4JetPhi_pset = iConfig.getParameter<edm::ParameterSet>("pfAK4JetPhi");
234  plotMap[&pfAK4JetPhi_] = &pfAK4JetPhi_pset;
235  caloDiAK4JetPt_pset = iConfig.getParameter<edm::ParameterSet>("caloDiAK4JetPt");
236  plotMap[&caloDiAK4JetPt_] = &caloDiAK4JetPt_pset;
237  caloDiAK4JetEta_pset = iConfig.getParameter<edm::ParameterSet>("caloDiAK4JetEta");
238  plotMap[&caloDiAK4JetEta_] = &caloDiAK4JetEta_pset;
239  caloDiAK4JetPhi_pset = iConfig.getParameter<edm::ParameterSet>("caloDiAK4JetPhi");
240  plotMap[&caloDiAK4JetPhi_] = &caloDiAK4JetPhi_pset;
241  pfDiAK4JetPt_pset = iConfig.getParameter<edm::ParameterSet>("pfDiAK4JetPt");
242  plotMap[&pfDiAK4JetPt_] = &pfDiAK4JetPt_pset;
243  pfDiAK4JetEta_pset = iConfig.getParameter<edm::ParameterSet>("pfDiAK4JetEta");
244  plotMap[&pfDiAK4JetEta_] = &pfDiAK4JetEta_pset;
245  pfDiAK4JetPhi_pset = iConfig.getParameter<edm::ParameterSet>("pfDiAK4JetPhi");
246  plotMap[&pfDiAK4JetPhi_] = &pfDiAK4JetPhi_pset;
247  photonPt_pset = iConfig.getParameter<edm::ParameterSet>("photonPt");
248  plotMap[&photonPt_] = &photonPt_pset;
249  photonEta_pset = iConfig.getParameter<edm::ParameterSet>("photonEta");
250  plotMap[&photonEta_] = &photonEta_pset;
251  photonPhi_pset = iConfig.getParameter<edm::ParameterSet>("photonPhi");
252  plotMap[&photonPhi_] = &photonPhi_pset;
253  photonPPPt_pset = iConfig.getParameter<edm::ParameterSet>("photonPPPt");
254  plotMap[&photonPPPt_] = &photonPPPt_pset;
255  photonPPEta_pset = iConfig.getParameter<edm::ParameterSet>("photonPPEta");
256  plotMap[&photonPPEta_] = &photonPPEta_pset;
257  photonPPPhi_pset = iConfig.getParameter<edm::ParameterSet>("photonPPPhi");
258  plotMap[&photonPPPhi_] = &photonPPPhi_pset;
259  caloBJetPt_pset = iConfig.getParameter<edm::ParameterSet>("caloBJetPt");
260  plotMap[&caloBJetPt_] = &caloBJetPt_pset;
261  caloBJetEta_pset = iConfig.getParameter<edm::ParameterSet>("caloBJetEta");
262  plotMap[&caloBJetEta_] = &caloBJetEta_pset;
263  caloBJetPhi_pset = iConfig.getParameter<edm::ParameterSet>("caloBJetPhi");
264  plotMap[&caloBJetPhi_] = &caloBJetPhi_pset;
265  pfBJetPt_pset = iConfig.getParameter<edm::ParameterSet>("pfBJetPt");
266  plotMap[&pfBJetPt_] = &pfBJetPt_pset;
267  pfBJetEta_pset = iConfig.getParameter<edm::ParameterSet>("pfBJetEta");
268  plotMap[&pfBJetEta_] = &pfBJetEta_pset;
269  pfBJetPhi_pset = iConfig.getParameter<edm::ParameterSet>("pfBJetPhi");
270  plotMap[&pfBJetPhi_] = &pfBJetPhi_pset;
271  electronPt_pset = iConfig.getParameter<edm::ParameterSet>("electronPt");
272  plotMap[&electronPt_] = &electronPt_pset;
273  electronEta_pset = iConfig.getParameter<edm::ParameterSet>("electronEta");
274  plotMap[&electronEta_] = &electronEta_pset;
275  electronPhi_pset = iConfig.getParameter<edm::ParameterSet>("electronPhi");
276  plotMap[&electronPhi_] = &electronPhi_pset;
277  l3muon3Pt_pset = iConfig.getParameter<edm::ParameterSet>("l3muon3Pt");
278  plotMap[&l3muon3Pt_] = &l3muon3Pt_pset;
279  l3muon3Eta_pset = iConfig.getParameter<edm::ParameterSet>("l3muon3Eta");
280  plotMap[&l3muon3Eta_] = &l3muon3Eta_pset;
281  l3muon3Phi_pset = iConfig.getParameter<edm::ParameterSet>("l3muon3Phi");
282  plotMap[&l3muon3Phi_] = &l3muon3Phi_pset;
283  l2muon12Pt_pset = iConfig.getParameter<edm::ParameterSet>("l2muon12Pt");
284  plotMap[&l2muon12Pt_] = &l2muon12Pt_pset;
285  l2muon12Eta_pset = iConfig.getParameter<edm::ParameterSet>("l2muon12Eta");
286  plotMap[&l2muon12Eta_] = &l2muon12Eta_pset;
287  l2muon12Phi_pset = iConfig.getParameter<edm::ParameterSet>("l2muon12Phi");
288  plotMap[&l2muon12Phi_] = &l2muon12Phi_pset;
289  l3muon12Pt_pset = iConfig.getParameter<edm::ParameterSet>("l3muon12Pt");
290  plotMap[&l3muon12Pt_] = &l3muon12Pt_pset;
291  l3muon12Eta_pset = iConfig.getParameter<edm::ParameterSet>("l3muon12Eta");
292  plotMap[&l3muon12Eta_] = &l3muon12Eta_pset;
293  l3muon12Phi_pset = iConfig.getParameter<edm::ParameterSet>("l3muon12Phi");
294  plotMap[&l3muon12Phi_] = &l3muon12Phi_pset;
295  pAL1DoubleMuZMass_pset = iConfig.getParameter<edm::ParameterSet>("pAL1DoubleMuZMass");
296  plotMap[&pAL1DoubleMuZMass_] = &pAL1DoubleMuZMass_pset;
297  pAL2DoubleMuZMass_pset = iConfig.getParameter<edm::ParameterSet>("pAL2DoubleMuZMass");
298  plotMap[&pAL2DoubleMuZMass_] = &pAL2DoubleMuZMass_pset;
299  pAL3DoubleMuZMass_pset = iConfig.getParameter<edm::ParameterSet>("pAL3DoubleMuZMass");
300  plotMap[&pAL3DoubleMuZMass_] = &pAL3DoubleMuZMass_pset;
301  wallTime_pset = iConfig.getParameter<edm::ParameterSet>("wallTime");
302  plotMap[&wallTime_] = &wallTime_pset;
303 
304  for (auto item = plotMap.begin(); item != plotMap.end(); item++) {
305  (*item->first).pathName = (*item->second).getParameter<string>("pathName");
306  (*item->first).moduleName = (*item->second).getParameter<string>("moduleName");
307  (*item->first).nBins = (*item->second).getParameter<int>("NbinsX");
308  (*item->first).xMin = (*item->second).getParameter<double>("Xmin");
309  (*item->first).xMax = (*item->second).getParameter<double>("Xmax");
310  (*item->first).xAxisLabel = (*item->second).getParameter<string>("axisLabel");
311  (*item->first).plotLabel = (*item->second).getParameter<string>("plotLabel");
312  (*item->first).displayInPrimary = (*item->second).getParameter<bool>("mainWorkspace");
313 
314  if ((*item->second).exists("pathName_OR")) {
315  (*item->first).pathNameOR = (*item->second).getParameter<string>("pathName_OR");
316  }
317  if ((*item->second).exists("moduleName_OR")) {
318  (*item->first).moduleNameOR = (*item->second).getParameter<string>("moduleName_OR");
319  }
320 
321  plotList.push_back(item->first);
322  }
323  plotMap.clear();
324 
325  //set Token(s)
326  triggerResultsToken_ = consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("triggerResults"));
327  aodTriggerToken_ = consumes<trigger::TriggerEvent>(iConfig.getParameter<edm::InputTag>("triggerEvent"));
328 }
329 
331  // do anything here that needs to be done at desctruction time
332  // (e.g. close files, deallocate resources etc.)
333 }
334 
335 //
336 // member functions
337 //
338 
339 // ------------ method called for each event ------------
341  double start = get_wall_time();
342 
343  using namespace edm;
344 
345  if (debugPrint)
346  std::cout << "Inside analyze(). " << std::endl;
347 
348  // access trigger results
350  iEvent.getByToken(triggerResultsToken_, triggerResults);
351  if (!triggerResults.isValid())
352  return;
353 
354  edm::Handle<trigger::TriggerEvent> aodTriggerEvent;
355  iEvent.getByToken(aodTriggerToken_, aodTriggerEvent);
356  if (!aodTriggerEvent.isValid())
357  return;
358 
359  //reset everything to not accepted at beginning of each event
360  unordered_map<string, bool> firedMap = acceptMap;
361  for (auto plot : plotList) //loop over paths
362  {
363  if (firedMap[plot->pathName])
364  continue;
365  bool triggerAccept = false;
366  const TriggerObjectCollection objects = aodTriggerEvent->getObjects();
367  edm::InputTag moduleFilter;
369  if (plot->pathIndex > 0 && triggerResults->accept(plot->pathIndex) && hltConfig_.saveTags(plot->moduleName)) {
370  moduleFilter = edm::InputTag(plot->moduleName, "", processName_);
371  pathName = plot->pathName;
372  triggerAccept = true;
373  } else if (plot->pathIndexOR > 0 && triggerResults->accept(plot->pathIndexOR) &&
374  hltConfig_.saveTags(plot->moduleNameOR)) {
375  if (firedMap[plot->pathNameOR])
376  continue;
377  moduleFilter = edm::InputTag(plot->moduleNameOR, "", processName_);
378  pathName = plot->pathNameOR;
379  triggerAccept = true;
380  }
381 
382  if (triggerAccept) {
383  unsigned int moduleFilterIndex = aodTriggerEvent->filterIndex(moduleFilter);
384 
385  if (moduleFilterIndex + 1 > aodTriggerEvent->sizeFilters())
386  return;
387  const Keys& keys = aodTriggerEvent->filterKeys(moduleFilterIndex);
388 
394 
395  //calo AK4 jet pt + eta + phi
396  if (pathName == caloAK4JetPt_.pathName) {
397  for (const auto& key : keys) {
398  caloAK4JetPt_.ME->Fill(objects[key].pt());
399  caloAK4JetEta_.ME->Fill(objects[key].eta());
400  caloAK4JetPhi_.ME->Fill(objects[key].phi());
401  }
402  }
403  //pf AK4 jet pt + eta + phi
404  else if (pathName == pfAK4JetPt_.pathName) {
405  for (const auto& key : keys) {
406  pfAK4JetPt_.ME->Fill(objects[key].pt());
407  pfAK4JetEta_.ME->Fill(objects[key].eta());
408  pfAK4JetPhi_.ME->Fill(objects[key].phi());
409  }
410  }
411  //calo AK4 di jet pt + eta + phi
412  else if (pathName == caloDiAK4JetPt_.pathName) {
413  for (const auto& key : keys) {
414  caloDiAK4JetPt_.ME->Fill(objects[key].pt());
415  caloDiAK4JetEta_.ME->Fill(objects[key].eta());
416  caloDiAK4JetPhi_.ME->Fill(objects[key].phi());
417  }
418  }
419  //pf AK4 di jet pt + eta + phi
420  else if (pathName == pfDiAK4JetPt_.pathName) {
421  for (const auto& key : keys) {
422  pfDiAK4JetPt_.ME->Fill(objects[key].pt());
423  pfDiAK4JetEta_.ME->Fill(objects[key].eta());
424  pfDiAK4JetPhi_.ME->Fill(objects[key].phi());
425  }
426  }
427  //photon pt + eta + phi
428  else if (pathName == photonPt_.pathName) {
429  for (const auto& key : keys) {
430  photonPt_.ME->Fill(objects[key].pt());
431  photonEta_.ME->Fill(objects[key].eta());
432  photonPhi_.ME->Fill(objects[key].phi());
433  }
434  }
435  //photon PPStyle pt + eta + phi
436  else if (pathName == photonPPPt_.pathName) {
437  for (const auto& key : keys) {
438  photonPPPt_.ME->Fill(objects[key].pt());
439  photonPPEta_.ME->Fill(objects[key].eta());
440  photonPPPhi_.ME->Fill(objects[key].phi());
441  }
442  }
443  //calo Bjet pt + eta + phi
444  else if (pathName == caloBJetPt_.pathName) {
445  for (const auto& key : keys) {
446  caloBJetPt_.ME->Fill(objects[key].pt());
447  caloBJetEta_.ME->Fill(objects[key].eta());
448  caloBJetPhi_.ME->Fill(objects[key].phi());
449  }
450  }
451  //PF Bjet pt + eta + phi
452  else if (pathName == pfBJetPt_.pathName) {
453  for (const auto& key : keys) {
454  pfBJetPt_.ME->Fill(objects[key].pt());
455  pfBJetEta_.ME->Fill(objects[key].eta());
456  pfBJetPhi_.ME->Fill(objects[key].phi());
457  }
458  }
459  //electron pt + eta + phi
460  else if (pathName == electronPt_.pathName) {
461  for (const auto& key : keys) {
462  electronPt_.ME->Fill(objects[key].pt());
463  electronEta_.ME->Fill(objects[key].eta());
464  electronPhi_.ME->Fill(objects[key].phi());
465  }
466  } else if (pathName == l3muon3Pt_.pathName) {
467  for (const auto& key : keys) {
468  l3muon3Pt_.ME->Fill(objects[key].pt());
469  l3muon3Eta_.ME->Fill(objects[key].eta());
470  l3muon3Phi_.ME->Fill(objects[key].phi());
471  }
472  } else if (pathName == l2muon12Pt_.pathName) {
473  for (const auto& key : keys) {
474  l2muon12Pt_.ME->Fill(objects[key].pt());
475  l2muon12Eta_.ME->Fill(objects[key].eta());
476  l2muon12Phi_.ME->Fill(objects[key].phi());
477  }
478  } else if (pathName == l3muon12Pt_.pathName) {
479  for (const auto& key : keys) {
480  l3muon12Pt_.ME->Fill(objects[key].pt());
481  l3muon12Eta_.ME->Fill(objects[key].eta());
482  l3muon12Phi_.ME->Fill(objects[key].phi());
483  }
484  }
485 
486  // ////////////////////////////////
487  // ///
488  // /// double-object plots
489  // ///
490  // ////////////////////////////////
491 
492  else if (pathName == pAL1DoubleMuZMass_.pathName) {
493  const double mu_mass(.105658);
494  unsigned int kCnt0 = 0;
495  for (const auto& key0 : keys) {
496  unsigned int kCnt1 = 0;
497  for (const auto& key1 : keys) {
498  if (key0 != key1 &&
499  kCnt1 > kCnt0) { // avoid filling hists with same objs && avoid double counting separate objs
500  // if (abs(objects[key0].id()) == 13 && (objects[key0].id()+objects[key1].id()==0)) // id is not filled for l1 stage2 muons
501  TLorentzVector mu1, mu2, dimu;
502  mu1.SetPtEtaPhiM(objects[key0].pt(), objects[key0].eta(), objects[key0].phi(), mu_mass);
503  mu2.SetPtEtaPhiM(objects[key1].pt(), objects[key1].eta(), objects[key1].phi(), mu_mass);
504  dimu = mu1 + mu2;
505  if (dimu.M() > pAL1DoubleMuZMass_.xMin && dimu.M() < pAL1DoubleMuZMass_.xMax)
506  pAL1DoubleMuZMass_.ME->Fill(dimu.M());
507  }
508  kCnt1 += 1;
509  }
510  kCnt0 += 1;
511  }
512  } else if (pathName == pAL2DoubleMuZMass_.pathName) {
513  const double mu_mass(.105658);
514  unsigned int kCnt0 = 0;
515  for (const auto& key0 : keys) {
516  unsigned int kCnt1 = 0;
517  for (const auto& key1 : keys) {
518  if (key0 != key1 &&
519  kCnt1 > kCnt0) { // avoid filling hists with same objs && avoid double counting separate objs
520  if (abs(objects[key0].id()) == 13 &&
521  (objects[key0].id() + objects[key1].id() == 0)) { // check muon id and dimuon charge
522  TLorentzVector mu1, mu2, dimu;
523  mu1.SetPtEtaPhiM(objects[key0].pt(), objects[key0].eta(), objects[key0].phi(), mu_mass);
524  mu2.SetPtEtaPhiM(objects[key1].pt(), objects[key1].eta(), objects[key1].phi(), mu_mass);
525  dimu = mu1 + mu2;
526  if (dimu.M() > pAL2DoubleMuZMass_.xMin && dimu.M() < pAL2DoubleMuZMass_.xMax)
527  pAL2DoubleMuZMass_.ME->Fill(dimu.M());
528  }
529  }
530  kCnt1 += 1;
531  }
532  kCnt0 += 1;
533  }
534  } else if (pathName == pAL3DoubleMuZMass_.pathName) {
535  const double mu_mass(.105658);
536  unsigned int kCnt0 = 0;
537  for (const auto& key0 : keys) {
538  unsigned int kCnt1 = 0;
539  for (const auto& key1 : keys) {
540  if (key0 != key1 &&
541  kCnt1 > kCnt0) { // avoid filling hists with same objs && avoid double counting separate objs
542  if (abs(objects[key0].id()) == 13 &&
543  (objects[key0].id() + objects[key1].id() == 0)) { // check muon id and dimuon charge
544  TLorentzVector mu1, mu2, dimu;
545  mu1.SetPtEtaPhiM(objects[key0].pt(), objects[key0].eta(), objects[key0].phi(), mu_mass);
546  mu2.SetPtEtaPhiM(objects[key1].pt(), objects[key1].eta(), objects[key1].phi(), mu_mass);
547  dimu = mu1 + mu2;
548  if (dimu.M() > pAL3DoubleMuZMass_.xMin && dimu.M() < pAL3DoubleMuZMass_.xMax)
549  pAL3DoubleMuZMass_.ME->Fill(dimu.M());
550  }
551  }
552  kCnt1 += 1;
553  }
554  kCnt0 += 1;
555  }
556  }
557 
558  firedMap[pathName] = true;
559  } //end if trigger accept
560  } //end loop over plots/paths
561 
562  // sleep(1); //sleep for 1s, used to calibrate timing
563  double end = get_wall_time();
564  double wallTime = end - start;
565  wallTime_.ME->Fill(wallTime);
566 }
567 
568 // ------------ method called when starting to processes a run ------------
570  if (debugPrint)
571  std::cout << "Calling beginRun. " << std::endl;
572  bool changed = true;
573  if (hltConfig_.init(iRun, iSetup, processName_, changed)) {
574  if (debugPrint)
575  std::cout << "Extracting HLTconfig. " << std::endl;
576  }
577 
578  //get path indicies from menu
579  string pathName_noVersion;
580  vector<string> triggerPaths = hltConfig_.triggerNames();
581 
582  for (const auto& pathName : triggerPaths) {
583  pathName_noVersion = hltConfig_.removeVersion(pathName);
584  for (auto plot : plotList) {
585  if (plot->pathName == pathName_noVersion) {
586  (*plot).pathIndex = hltConfig_.triggerIndex(pathName);
587  } else if (plot->pathNameOR == pathName_noVersion) {
588  (*plot).pathIndexOR = hltConfig_.triggerIndex(pathName);
589  }
590  }
591  }
592  vector<hltPlot*> plotList_temp;
593  for (auto plot : plotList) {
594  if (plot->pathIndex > 0 || plot->pathIndexOR > 0) {
595  plotList_temp.push_back(plot);
596  acceptMap[plot->pathName] = false;
597  if (plot->pathIndexOR > 0)
598  acceptMap[plot->pathNameOR] = false;
599  }
600  }
601  //now re-assign plotList to contain only the plots with paths in the menu.
602  plotList = plotList_temp;
603  plotList_temp.clear();
604 }
605 
606 // ------------ method called when ending the processing of a run ------------
607 
609  edm::Run const& iRun,
610  edm::EventSetup const& iSetup) {
616 
617  //book wall time separately
618  ibooker.setCurrentFolder(mainShifterFolder);
619  wallTime_.ME =
620  ibooker.book1D(wallTime_.plotLabel, wallTime_.pathName, wallTime_.nBins, wallTime_.xMin, wallTime_.xMax);
621  wallTime_.ME->setAxisTitle(wallTime_.xAxisLabel);
622 
623  for (auto plot : plotList) {
624  std::string display_pathNames = plot->pathName;
625  if (!plot->pathNameOR.empty())
626  display_pathNames = plot->pathName + " OR " + plot->pathNameOR;
627 
628  if (plot->displayInPrimary) {
629  ibooker.setCurrentFolder(mainShifterFolder);
630  (*plot).ME = ibooker.book1D(plot->plotLabel, display_pathNames.c_str(), plot->nBins, plot->xMin, plot->xMax);
631  (*plot).ME->setAxisTitle(plot->xAxisLabel);
632  //need to add OR statement
633  } else {
634  ibooker.setCurrentFolder(backupFolder);
635  (*plot).ME = ibooker.book1D(plot->plotLabel, display_pathNames.c_str(), plot->nBins, plot->xMin, plot->xMax);
636  (*plot).ME->setAxisTitle(plot->xAxisLabel);
637  }
638  }
639 }
640 
642  struct timeval time;
643  if (gettimeofday(&time, nullptr))
644  return 0;
645  return (double)time.tv_sec + (double)time.tv_usec * .000001;
646 }
647 
648 // ------------ method called when starting to processes a luminosity block ------------
649 /*
650 void
651 HLTObjectMonitorProtonLead::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
652 {
653 }
654 */
655 
656 // ------------ method called when ending the processing of a luminosity block ------------
657 /*
658 void
659 HLTObjectMonitorProtonLead::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
660 {
661 }
662 */
663 
664 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
665 // void
666 // HLTObjectMonitorProtonLead::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
667 // //The following says we do not know what parameters are allowed so do no validation
668 // // Please change this to state exactly what you do use, even if it is no parameters
669 // edm::ParameterSetDescription desc;
670 // desc.setUnknown();
671 // descriptions.addDefault(desc);
672 // }
673 
674 //define this as a plug-in
Definition: start.py:1
edm::EDGetTokenT< trigger::TriggerEvent > aodTriggerToken_
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:118
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:146
unordered_map< string, bool > acceptMap
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
int iEvent
Definition: GenABIO.cc:224
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
static std::string const triggerResults
Definition: EdmProvDump.cc:44
unordered_map< hltPlot *, edm::ParameterSet * > plotMap
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:132
static constexpr float mu_mass
std::vector< size_type > Keys
HLTObjectMonitorProtonLead(const edm::ParameterSet &)
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
static std::string const triggerPaths
Definition: EdmProvDump.cc:45
Definition: Run.h:45
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void analyze(const edm::Event &, const edm::EventSetup &) override