CMS 3D CMS Logo

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