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