CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FourVectorHLTOnline.h
Go to the documentation of this file.
1 #ifndef FOURVECTORHLTONLINE_H
2 #define FOURVECTORHLTONLINE_H
3 // -*- C++ -*-
4 //
5 // Package: FourVectorHLTOnline
6 // Class: FourVectorHLTOnline
7 //
16 //
17 // Original Author: Jeffrey Berryhill
18 // Created: June 2008
19 // Rewritten by: Vladimir Rekovic
20 // Date: May 2009
21 //
22 //
23 //
24 
25 // system include files
26 #include <memory>
27 #include <unistd.h>
28 
29 
30 // user include files
33 
39 
45 
46 // added VR
52 
54 
57 
59 
61 
62 
63 
64 #include <iostream>
65 #include <fstream>
66 #include <vector>
67 
68 namespace edm {
69  class TriggerNames;
70 }
71 
72 typedef std::multimap<float,int> fimmap ;
73 typedef std::set<fimmap , std::less<fimmap> > mmset;
74 
76 
77  public:
78  explicit FourVectorHLTOnline(const edm::ParameterSet&);
80 
81  void cleanDRMatchSet(mmset& tempSet);
82 
84 
85  private:
86  virtual void beginJob() ;
87  virtual void analyze(const edm::Event&, const edm::EventSetup&);
88  virtual void endJob() ;
89 
90  // BeginRun
91  void beginRun(const edm::Run& run, const edm::EventSetup& c);
92 
93  // EndRun
94  void endRun(const edm::Run& run, const edm::EventSetup& c);
95  void fillHltMatrix(const edm::TriggerNames & triggerNames);
96  void setupHltMatrix(std::string label, std::vector<std::string> paths);
97 
98  void setupHltLsPlots();
99  void setupHltBxPlots();
100  void countHLTPathHitsEndLumiBlock(const int& lumi);
101  void countHLTGroupHitsEndLumiBlock(const int& lumi);
102  void countHLTGroupL1HitsEndLumiBlock(const int& lumi);
103  void countHLTGroupBXHitsEndLumiBlock(const int& lumi);
106  bool hasL1Passed(const std::string& pathname, const edm::TriggerNames & triggerNames);
107  bool hasHLTPassed(const std::string& pathname, const edm::TriggerNames& triggerNames);
108 
109  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
110  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
111 
112  // ----------member data ---------------------------
113  int nev_;
115  bool fLumiFlag;
116 
117  /*
118  MonitorElement* total_;
119  MonitorElement* ME_HLTPassPass_;
120  MonitorElement* ME_HLTPassPass_Normalized_;
121  MonitorElement* ME_HLTPass_Normalized_Any_;
122  MonitorElement* ME_HLTPassFail_;
123  MonitorElement* ME_HLTPassFail_Normalized_;
124 
125  std::vector<MonitorElement*> v_ME_HLTPassPass_;
126  std::vector<MonitorElement*> v_ME_HLTPassPass_Normalized_;
127  std::vector<MonitorElement*> v_ME_HLTPass_Normalized_Any_;
128  */
129 
133  std::vector<MonitorElement*> v_ME_HLTAll_LS_;
134 
143 
144  std::vector<std::string> fGroupName;
145 
146  unsigned int nLS_;
147  unsigned int referenceBX_;
148  unsigned int Nbx_;
149 
150  bool plotAll_;
151  bool resetMe_;
153 
154  unsigned int nBins_;
155  unsigned int nBinsOneOverEt_;
156  double ptMin_ ;
157  double ptMax_ ;
158 
162  double muonEtaMax_;
163  double muonEtMin_;
164  double muonDRMatch_;
165  double tauEtaMax_;
166  double tauEtMin_;
167  double tauDRMatch_;
168  double jetEtaMax_;
169  double jetEtMin_;
170  double jetDRMatch_;
171  double bjetEtaMax_;
172  double bjetEtMin_;
173  double bjetDRMatch_;
175  double photonEtMin_;
177  double trackEtaMax_;
178  double trackEtMin_;
180  double metEtaMax_;
181  double metMin_;
182  double metDRMatch_;
183  double htEtaMax_;
184  double htMin_;
185  double htDRMatch_;
186  double sumEtMin_;
187 
188  std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
189 
190  std::vector <std::vector <std::string> > triggerFilters_;
191  std::vector <std::vector <uint> > triggerFilterIndices_;
192  std::vector <std::pair<std::string, int> > fPathTempCountPair;
193  std::vector <std::pair<std::string, std::vector<int> > > fPathBxTempCountPair;
194  std::vector <std::pair<std::string, int> > fGroupTempCountPair;
195  std::vector <std::pair<std::string, int> > fGroupL1TempCountPair;
196  std::vector <std::pair<std::string, std::vector<std::string> > > fGroupNamePathsPair;
197 
198  std::vector<std::string> specialPaths_;
199 
208  // data across paths
210  // helper class to store the data path
211 
213 
214  //define Token(-s)
228 
229  class PathInfo {
230 
232  pathIndex_(-1), denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), processName_("unset"), objectType_(-1) {};
233 
234  public:
235 
237  {
238  filters_ = filters;
239  }
240 
241  void setHistos(
242 
243  MonitorElement* const NOn,
244  MonitorElement* const onEtOn,
245  MonitorElement* const onOneOverEtOn,
246  MonitorElement* const onEtavsonPhiOn,
247  MonitorElement* const NOff,
248  MonitorElement* const offEtOff,
249  MonitorElement* const offEtavsoffPhiOff,
250  MonitorElement* const NL1,
251  MonitorElement* const l1EtL1,
252  MonitorElement* const l1Etavsl1PhiL1,
253  MonitorElement* const NL1On,
254  MonitorElement* const l1EtL1On,
255  MonitorElement* const l1Etavsl1PhiL1On,
256  MonitorElement* const NL1Off,
257  MonitorElement* const offEtL1Off,
258  MonitorElement* const offEtavsoffPhiL1Off,
259  MonitorElement* const NOnOff,
260  MonitorElement* const offEtOnOff,
261  MonitorElement* const offEtavsoffPhiOnOff,
262  MonitorElement* const NL1OnUM,
263  MonitorElement* const l1EtL1OnUM,
264  MonitorElement* const l1Etavsl1PhiL1OnUM,
265  MonitorElement* const NL1OffUM,
266  MonitorElement* const offEtL1OffUM,
267  MonitorElement* const offEtavsoffPhiL1OffUM,
268  MonitorElement* const NOnOffUM,
269  MonitorElement* const offEtOnOffUM,
270  MonitorElement* const offEtavsoffPhiOnOffUM,
271  MonitorElement* const offDRL1Off,
272  MonitorElement* const offDROnOff,
273  MonitorElement* const l1DRL1On)
274  {
275 
276  NOn_ = NOn;
277  onEtOn_ = onEtOn;
278  onOneOverEtOn_ = onOneOverEtOn;
279  onEtavsonPhiOn_ = onEtavsonPhiOn;
280  //NOff_ = NOff;
281  //offEtOff_ = offEtOff;
282  //offEtavsoffPhiOff_ = offEtavsoffPhiOff;
283  NL1_ = NL1;
284  l1EtL1_ = l1EtL1;
285  l1Etavsl1PhiL1_ = l1Etavsl1PhiL1;
286  NL1On_ = NL1On;
287  l1EtL1On_ = l1EtL1On;
288  l1Etavsl1PhiL1On_ = l1Etavsl1PhiL1On;
289  NL1Off_ = NL1Off;
290  offEtL1Off_ = offEtL1Off;
291  offEtavsoffPhiL1Off_ = offEtavsoffPhiL1Off;
292  NOnOff_ = NOnOff;
293  offEtOnOff_ = offEtOnOff;
294  offEtavsoffPhiOnOff_ = offEtavsoffPhiOnOff;
295  NL1OnUM_ = NL1OnUM;
296  l1EtL1OnUM_ = l1EtL1OnUM;
297  l1Etavsl1PhiL1OnUM_ = l1Etavsl1PhiL1OnUM;
298  NL1OffUM_ = NL1OffUM;
299  offEtL1OffUM_ = offEtL1OffUM;
300  offEtavsoffPhiL1OffUM_ = offEtavsoffPhiL1OffUM;
301  NOnOffUM_ = NOnOffUM;
302  offEtOnOffUM_ = offEtOnOffUM;
303  offEtavsoffPhiOnOffUM_ = offEtavsoffPhiOnOffUM;
304  offDRL1Off_ = offDRL1Off;
305  offDROnOff_ = offDROnOff;
306  l1DRL1On_ = l1DRL1On;
307 
308  }
309 
311  return NOn_;
312  }
314  return onEtOn_;
315  }
317  return onOneOverEtOn_;
318  }
320  return onEtavsonPhiOn_;
321  }
322  // MonitorElement * getNOffHisto() {
323  // return NOff_;
324  // }
325  // MonitorElement * getOffEtOffHisto() {
326  // return offEtOff_;
327  // }
328  // MonitorElement * getOffEtaVsOffPhiOffHisto() {
329  // return offEtavsoffPhiOff_;
330  // }
332  return NL1_;
333  }
335  return l1EtL1_;
336  }
338  return l1Etavsl1PhiL1_;
339  }
341  return NL1On_;
342  }
344  return l1EtL1On_;
345  }
347  return l1Etavsl1PhiL1On_;
348  }
350  return NL1Off_;
351  }
353  return offEtL1Off_;
354  }
356  return offEtavsoffPhiL1Off_;
357  }
359  return NOnOff_;
360  }
362  return offEtOnOff_;
363  }
365  return offEtavsoffPhiOnOff_;
366  }
368  return NL1OnUM_;
369  }
371  return l1EtL1OnUM_;
372  }
374  return l1Etavsl1PhiL1OnUM_;
375  }
377  return NL1OffUM_;
378  }
380  return offEtL1OffUM_;
381  }
383  return offEtavsoffPhiL1OffUM_;
384  }
386  return NOnOffUM_;
387  }
389  return offEtOnOffUM_;
390  }
392  return offEtavsoffPhiOnOffUM_;
393  }
395  return offDRL1Off_;
396  }
398  return offDROnOff_;
399  }
401  return l1DRL1On_;
402  }
404  return filters_;
405  }
406  const std::string getLabel(void ) const {
407  return filterName_;
408  }
409  void setLabel(std::string labelName){
410  filterName_ = labelName;
411  return;
412  }
413  const std::string getPath(void ) const {
414  return pathName_;
415  }
416  const std::string getl1Path(void ) const {
417  return l1pathName_;
418  }
419  const std::string getDenomPath(void ) const {
420  return denomPathName_;
421  }
422  const std::string getProcess(void ) const {
423  return processName_;
424  }
425  const int getObjectType(void ) const {
426  return objectType_;
427  }
428 
429  const edm::InputTag getTag(void) const{
431  return tagName;
432  }
433 
434  ~PathInfo() {};
435 
436  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type, float ptmin, float ptmax):
437 
438  denomPathName_(denomPathName),
439  pathName_(pathName),
440  l1pathName_(l1pathName),
441  filterName_(filterName),
442  processName_(processName),
443  objectType_(type),
444  NOn_(0), onEtOn_(0), onOneOverEtOn_(0), onEtavsonPhiOn_(0),
445 
446  NL1_(0), l1EtL1_(0), l1Etavsl1PhiL1_(0),
453  offDRL1Off_(0), offDROnOff_(0), l1DRL1On_(0), filters_(0),
454  ptmin_(ptmin), ptmax_(ptmax)
455 
456  {
457  };
458 
459  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type,
460  MonitorElement *NOn,
461  MonitorElement *onEtOn,
462  MonitorElement *onOneOverEtOn,
463  MonitorElement *onEtavsonPhiOn,
464  MonitorElement *NOff,
465  MonitorElement *offEtOff,
466  MonitorElement *offEtavsoffPhiOff,
467  MonitorElement *NL1,
468  MonitorElement *l1EtL1,
469  MonitorElement *l1Etavsl1PhiL1,
470  MonitorElement *NL1On,
471  MonitorElement *l1EtL1On,
472  MonitorElement *l1Etavsl1PhiL1On,
473  MonitorElement *NL1Off,
474  MonitorElement *offEtL1Off,
475  MonitorElement *offEtavsoffPhiL1Off,
476  MonitorElement *NOnOff,
477  MonitorElement *offEtOnOff,
478  MonitorElement *offEtavsoffPhiOnOff,
479  MonitorElement *NL1OnUM,
480  MonitorElement *l1EtL1OnUM,
481  MonitorElement *l1Etavsl1PhiL1OnUM,
482  MonitorElement *NL1OffUM,
483  MonitorElement *offEtL1OffUM,
484  MonitorElement *offEtavsoffPhiL1OffUM,
485  MonitorElement *NOnOffUM,
486  MonitorElement *offEtOnOffUM,
487  MonitorElement *offEtavsoffPhiOnOffUM,
488  MonitorElement *offDRL1Off,
489  MonitorElement *offDROnOff,
490  MonitorElement *l1DRL1On,
492  float ptmin, float ptmax
493  ):
494 
495  denomPathName_(denomPathName),
496  pathName_(pathName), l1pathName_(l1pathName),
497  filterName_(filterName), processName_(processName), objectType_(type),
498  NOn_(NOn), onEtOn_(onEtOn), onOneOverEtOn_(onOneOverEtOn), onEtavsonPhiOn_(onEtavsonPhiOn),
499  NL1_(NL1), l1EtL1_(l1EtL1), l1Etavsl1PhiL1_(l1Etavsl1PhiL1),
500  NL1On_(NL1On), l1EtL1On_(l1EtL1On), l1Etavsl1PhiL1On_(l1Etavsl1PhiL1On),
501  NL1Off_(NL1Off), offEtL1Off_(offEtL1Off), offEtavsoffPhiL1Off_(offEtavsoffPhiL1Off),
502  NOnOff_(NOnOff), offEtOnOff_(offEtOnOff), offEtavsoffPhiOnOff_(offEtavsoffPhiOnOff),
503  NL1OnUM_(NL1OnUM), l1EtL1OnUM_(l1EtL1OnUM), l1Etavsl1PhiL1OnUM_(l1Etavsl1PhiL1OnUM),
504  NL1OffUM_(NL1OffUM), offEtL1OffUM_(offEtL1OffUM), offEtavsoffPhiL1OffUM_(offEtavsoffPhiL1OffUM),
505  NOnOffUM_(NOnOffUM), offEtOnOffUM_(offEtOnOffUM), offEtavsoffPhiOnOffUM_(offEtavsoffPhiOnOffUM),
506  offDRL1Off_(offDRL1Off),
507  offDROnOff_(offDROnOff),
508  l1DRL1On_(l1DRL1On),
509  filters_(filters),
510  ptmin_(ptmin), ptmax_(ptmax)
511  {
512  };
513 
514  bool operator==(const std::string& v)
515  {
516  return v==filterName_;
517  }
518 
519  bool operator!=(const std::string& v)
520  {
521  return v!=filterName_;
522  }
523 
524  float getPtMin() const { return ptmin_; }
525  float getPtMax() const { return ptmax_; }
526 
527  std::vector< std::pair<std::string,unsigned int> > filtersAndIndices;
528 
529 
530  private:
531 
539 
540  // we don't own this data
542  // MonitorElement *NOff_, *offEtOff_, *offEtavsoffPhiOff_;
552 
553  float ptmin_, ptmax_;
554 
555  const int index() {
556  return pathIndex_;
557  }
558  const int type() {
559  return objectType_;
560  }
561 
562 
563  };
564 
565 
566  public:
567 
568  // simple collection - just
569  class PathInfoCollection: public std::vector<PathInfo> {
570  public:
571 
572  PathInfoCollection(): std::vector<PathInfo>()
573  {};
574  std::vector<PathInfo>::iterator find(std::string pathName) {
575  return std::find(begin(), end(), pathName);
576  }
577  };
578 
580 
582 
583 };
584 
585 
587 {
588  public:
589  virtual void clearSets( void ) = 0;
590  virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v) = 0;
591  virtual void monitorL1( const int l1Index, FourVectorHLTOnline* fv) = 0;
592  virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv) = 0;
593 
594  virtual void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn) = 0;
595 
596  virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline* fv) = 0;
597 
598  virtual bool isTriggerType(int t) = 0;
599  virtual ~BaseMonitor(){}
600 
601 };
602 
603 template <class T>
604 class objMonData:public BaseMonitor {
605 public:
606  objMonData() { EtaMax_= 2.5; EtMin_=3.0; GenJetsFlag_ = false; BJetsFlag_ = false; }
607  void setLimits(float etaMax, float etMin, float drMatch)
608  {
609  EtaMax_= etaMax;
610  EtMin_= etMin;
611  DRMatch_= drMatch;
612  }
613  void setTriggerType(const std::vector<int>& trigType) { triggerType_ = trigType; }
614  void pushTriggerType(int trigType) { triggerType_.push_back(trigType); }
615  void setL1TriggerType(const std::vector<int>& trigType) { l1triggerType_ = trigType; }
616  void pushL1TriggerType(int trigType) { l1triggerType_.push_back(trigType); }
617  void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v) { v_ = v; }
618  void setReco(edm::Handle<T> offColl) { offColl_ = offColl; }
619 
620 
621  // Monitor methods
622 
623  void monitorL1(const int l1Index, FourVectorHLTOnline* fv);
624  void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv);
625  void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn);
626  void fillOnlineMatch(const int l1Index, FourVectorHLTOnline* fv);
627  void fillOnL1Match(const int l1Index, FourVectorHLTOnline* fv);
628 
629  void clearSets();
630 
631  bool isTriggerType(int t);
632  bool isL1TriggerType(int t);
633 
640 
641 
642  void setBJetsFlag(bool flag)
643  {
644  BJetsFlag_ = flag;
645  }
646 
647 
648 private:
649 
650  int pdgId_;
652 
653  float EtaMax_;
654  float EtMin_;
655 
656  float DRMatch_;
657 
660 
661  std::vector<int> triggerType_;
662  std::vector<int> l1triggerType_;
663 
665 
666  FourVectorHLTOnline::PathInfoCollection::iterator v_;
667 
668 };
669 
670 
671 template <class T>
673 {
674  bool rc = false;
675 
676  for(std::vector<int>::const_iterator it = triggerType_.begin(); it != triggerType_.end(); ++it)
677  {
678 
679  if(t == *it) { rc = true; break; }
680 
681  } // end for
682 
683  if (t==0) rc = true;
684 
685  return rc;
686 
687 }
688 
689 
690 template <class T>
692 {
693  bool rc = false;
694 
695  for(std::vector<int>::const_iterator it = l1triggerType_.begin(); it != l1triggerType_.end(); ++it)
696  {
697 
698  if(fabs(t) == fabs(*it)) { rc = true; break; }
699 
700  } // end for
701 
702  return rc;
703 
704 }
705 
706 
707 template <class T>
708 void objMonData<T>::monitorL1(const int l1Index, FourVectorHLTOnline* fv)
709 {
710 
711  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
712 
713  unsigned int NL1=0;
714  unsigned int NL1OffUM=0;
715 
716  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
717  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
718  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
719  bool l1accept = l1k.size() > 0;
720 
721  if(!l1accept) return;
722 
723  trigger::Vids::const_iterator idtypeiter = idtype.begin();
724 
725  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
726 
727  trigger::TriggerObject l1FV = toc[*l1ki];
728  if(isL1TriggerType(*idtypeiter))
729  {
730 
731 
732 
733  if (fabs(l1FV.eta()) <= EtaMax_ && l1FV.pt() >= EtMin_)
734  {
735 
736  NL1++;
737 
738  v_->getL1EtL1Histo()->Fill(l1FV.pt());
739  v_->getL1EtaVsL1PhiL1Histo()->Fill(l1FV.eta(), l1FV.phi());
740 
741  }
742  else {
743 
744  continue;
745 
746  }
747 
748  } // end if isL1TriggerType
749  ++idtypeiter;
750 
751  } // end for l1ki
752 
753  if(NL1 > 0) v_->getNL1Histo()->Fill(NL1);
754  if(NL1OffUM > 0) v_->getNL1OffUMHisto()->Fill(NL1OffUM);
755 
756 }
757 
758 
759 template <class T>
760 void objMonData<T>::monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv)
761 {
762 
763  //if(! isTriggerType(v_->getObjectType()) ) return;
764 
765  // Get keys of objects passed by the last filter
766  const trigger::Keys & k = fv->fTriggerObj->filterKeys(hltIndex);
767 
768  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
769 
770  unsigned int NOn=0;
771 
772  // Loop over HLT objects
773  for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
774 
775  trigger::TriggerObject onlineFV = toc[*ki];
776 
777  if (fabs(onlineFV.eta()) <= EtaMax_ && onlineFV.pt() >= EtMin_)
778  {
779 
780  NOn++;
781 
782  v_->getOnEtOnHisto()->Fill(onlineFV.pt());
783  v_->getOnOneOverEtOnHisto()->Fill(1./onlineFV.pt());
784  v_->getOnEtaVsOnPhiOnHisto()->Fill(onlineFV.eta(), onlineFV.phi());
785 
786  }
787  else {
788 
789  return;
790 
791  }
792 
793  matchOnlineL1(onlineFV,l1Index, fv, NOn);
794 
795  } // end loop over HLT objects
796 
797  if(NOn>0) v_->getNOnHisto()->Fill(NOn);
798 
799 }
800 
801 template <class T>
802 void objMonData<T>::matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn)
803 {
804 
805  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
806 
807  unsigned int NOnL1UM=0;
808 
809  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
810  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
811  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
812 
813  fimmap OnL1DRMatchMap;
814  int j=0;
815  trigger::Vids::const_iterator idtypeiter = idtype.begin();
816  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki )
817  {
818 
819 
820 
821  if(isL1TriggerType(*idtypeiter))
822  {
823 
824  trigger::TriggerObject l1FV = toc[*l1ki];
825 
826  if ( fabs(l1FV.eta()) <= EtaMax_ && l1FV.pt() >= EtMin_ )
827  {
828 
829  // fill UM histos (no matching required)
830  if(NOn == 1) {
831 
832  NOnL1UM++;
833  v_->getL1EtL1OnUMHisto()->Fill(l1FV.pt());
834  v_->getL1EtaVsL1PhiL1OnUMHisto()->Fill(l1FV.eta(),l1FV.phi());
835 
836  }
837 
838 
839  float dR = reco::deltaR(l1FV.eta(),l1FV.phi(),onlineFV.eta(),onlineFV.phi());
840 
841  if ( dR < 1.0)
842  {
843 
844  OnL1DRMatchMap.insert(std::pair<float,int>(dR,j));
845 
846  }
847 
848  } // end if l1FV eta, pt
849 
850  } // end if isL1TriggerType
851 
852  ++idtypeiter;
853  j++;
854 
855  } // end for
856 
857  if(! OnL1DRMatchMap.empty()) OnL1DRMatchSet.insert(OnL1DRMatchMap);
858 
859 }
860 
861 template <class T>
863 {
864 
865  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
866  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
867 
868  unsigned int NOnL1=0;
869 
870  // clean the set On-L1
871  if(OnL1DRMatchSet.size() > 1) {
872 
873  LogDebug("FourVectorHLTOnline") << " Cleaning L1On mmset" << std::endl;
874  fv->cleanDRMatchSet(OnL1DRMatchSet);
875 
876  }
877  // now fill histos
878  for ( mmset::iterator setIter = OnL1DRMatchSet.begin( ); setIter != OnL1DRMatchSet.end( ); setIter++ )
879  {
880 
881  fimmap tempMap = *setIter;
882 
883  fimmap::iterator it = tempMap.begin();
884  int i = (*it).second ;
885  float dR = (*it).first;
886  v_->getL1DROnL1Histo()->Fill(dR);
887 
888  if (dR > DRMatch_) continue;
889 
890  trigger::Keys::const_iterator l1ki = l1k.begin();
891  for (int count = 0; count < i; count++) l1ki++;
892 
893  NOnL1++;
894  v_->getL1EtL1OnHisto()->Fill(toc[*l1ki].pt());
895  v_->getL1EtaVsL1PhiL1OnHisto()->Fill(toc[*l1ki].eta(),toc[*l1ki].phi());
896 
897  }
898 
899  v_->getNL1OnHisto()->Fill(NOnL1);
900 
901 }
902 
903 template <class T>
905 {
906 
907 
908  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
909  fillOnL1Match(l1Index, fv);
910 
911 }
912 
913 
914 template <class T>
916 {
917 
918  L1OffDRMatchSet.clear();
919  L1MCDRMatchSet.clear();
920  OnOffDRMatchSet.clear();
921  OnMCDRMatchSet.clear();
922  OnL1DRMatchSet.clear();
923  OffMCDRMatchSet.clear();
924 
925 }
926 
927 
928 
929 #endif
#define LogDebug(id)
type
Definition: HCALResponse.h:21
edm::Handle< trigger::TriggerEvent > fTriggerObj
PathInfoCollection hltPathsDiagonal_
edm::EDGetTokenT< edm::TriggerResults > jetProbabilityBJetTagsToken_
int i
Definition: DBlmapReader.cc:9
const std::string getL1ConditionModuleName(const std::string &pathname)
bool operator==(const std::string &v)
edm::Handle< T > offColl_
MonitorElement * getOnOneOverEtOnHisto()
edm::InputTag triggerSummaryLabel_
std::string pathsSummaryHLTPathsPerBXFolder_
virtual ~BaseMonitor()
virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline *fv)=0
MonitorElement * getOffEtaVsOffPhiOnOffHisto()
MonitorElement * getOffEtOnOffUMHisto()
MonitorElement * scalersSelect
std::vector< std::pair< std::string, std::vector< int > > > fPathBxTempCountPair
virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline *fv)=0
bool isL1TriggerType(int t)
const std::string getPath(void) const
void setupHltMatrix(std::string label, std::vector< std::string > paths)
bool isTriggerType(int t)
void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v)
float phi() const
Definition: TriggerObject.h:58
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken_
tuple lumi
Definition: fjr2json.py:35
bool operator!=(const std::string &v)
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
MonitorElement * getOnEtaVsOnPhiOnHisto()
void countHLTGroupBXHitsEndLumiBlock(const int &lumi)
void fillHltMatrix(const edm::TriggerNames &triggerNames)
void matchOnlineL1(const trigger::TriggerObject &onlineFV, const int &l1Index, FourVectorHLTOnline *fv, const int &NOn)
std::vector< int > l1triggerType_
std::multimap< float, int > fimmap
edm::Handle< edm::TriggerResults > triggerResults_
void countHLTPathHitsEndLumiBlock(const int &lumi)
std::vector< int > triggerType_
float eta() const
Definition: TriggerObject.h:57
std::vector< std::pair< std::string, int > > fPathTempCountPair
T eta() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void fillOnlineMatch(const int l1Index, FourVectorHLTOnline *fv)
void cleanDRMatchSet(mmset &tempSet)
Clean DR Match Set.
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
std::vector< std::vector< uint > > triggerFilterIndices_
std::vector< TPRegexp > filters
Definition: eve_filter.cc:25
std::string pathsIndividualHLTPathsPerLSFolder_
virtual bool isTriggerType(int t)=0
void setL1TriggerType(const std::vector< int > &trigType)
PathInfoCollection hltPaths_
std::set< fimmap, std::less< fimmap > > mmset
MonitorElement * getOffEtaVsOffPhiL1OffUMHisto()
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
std::string pathsSummaryHLTPathsPerLSFolder_
MonitorElement * getOffEtaVsOffPhiOnOffUMHisto()
FourVectorHLTOnline::PathInfoCollection::iterator v_
edm::EDGetTokenT< edm::TriggerResults > softMuonBJetTagsToken_
void pushTriggerType(int trigType)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string pathsSummaryFilterEfficiencyFolder_
edm::EDGetTokenT< edm::TriggerResults > metToken_
void setLimits(float etaMax, float etMin, float drMatch)
void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline *fv)
std::vector< std::pair< std::string, unsigned int > > filtersAndIndices
std::vector< std::pair< std::string, int > > fGroupTempCountPair
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< edm::TriggerResults > muonRecoCollectionNameToken_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsTokenFU_
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
const std::string getProcess(void) const
virtual void matchOnlineL1(const trigger::TriggerObject &onlineFV, const int &l1Index, FourVectorHLTOnline *fv, const int &NOn)=0
MonitorElement * getL1EtaVsL1PhiL1Histo()
#define end
Definition: vmac.h:37
std::vector< MonitorElement * > v_ME_HLTAll_LS_
MonitorElement * ME_HLT_BX_
std::vector< std::vector< std::string > > triggerFilters_
MonitorElement * ME_HLT_CUSTOM_BX_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryLabelFUToken_
edm::EDGetTokenT< edm::TriggerResults > gsfElectronsToken_
edm::EDGetTokenT< edm::TriggerResults > caloRecoTauProducerToken_
int k[5][pyjets_maxn]
edm::EDGetTokenT< edm::TriggerResults > pixelTracksToken_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
virtual void clearSets(void)=0
void monitorL1(const int l1Index, FourVectorHLTOnline *fv)
void countHLTGroupL1HitsEndLumiBlock(const int &lumi)
HLTConfigProvider hltConfig_
std::string muonRecoCollectionName_
std::string pathsSummaryFilterCountsFolder_
MonitorElement * ME_HLTAll_LS_
std::vector< PathInfo >::iterator find(std::string pathName)
std::vector< std::string > specialPaths_
bool hasL1Passed(const std::string &pathname, const edm::TriggerNames &triggerNames)
std::vector< size_type > Keys
const std::string getl1Path(void) const
std::vector< std::string > fGroupName
const edm::InputTag getTag(void) const
MonitorElement * getL1EtaVsL1PhiL1OnUMHisto()
const std::string getDenomPath(void) const
std::vector< std::pair< std::string, std::vector< std::string > > > fGroupNamePathsPair
const int getObjectType(void) const
virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v)=0
void setFilterHistos(MonitorElement *const filters)
double ptmin
Definition: HydjetWrapper.h:85
std::vector< std::pair< std::string, int > > fGroupL1TempCountPair
bool hasHLTPassed(const std::string &pathname, const edm::TriggerNames &triggerNames)
#define begin
Definition: vmac.h:30
FourVectorHLTOnline(const edm::ParameterSet &)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
int getTriggerTypeParsePathName(const std::string &pathname)
void setTriggerType(const std::vector< int > &trigType)
void fillOnL1Match(const int l1Index, FourVectorHLTOnline *fv)
void countHLTGroupHitsEndLumiBlock(const int &lumi)
virtual void monitorL1(const int l1Index, FourVectorHLTOnline *fv)=0
PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type, MonitorElement *NOn, MonitorElement *onEtOn, MonitorElement *onOneOverEtOn, MonitorElement *onEtavsonPhiOn, MonitorElement *NOff, MonitorElement *offEtOff, MonitorElement *offEtavsoffPhiOff, MonitorElement *NL1, MonitorElement *l1EtL1, MonitorElement *l1Etavsl1PhiL1, MonitorElement *NL1On, MonitorElement *l1EtL1On, MonitorElement *l1Etavsl1PhiL1On, MonitorElement *NL1Off, MonitorElement *offEtL1Off, MonitorElement *offEtavsoffPhiL1Off, MonitorElement *NOnOff, MonitorElement *offEtOnOff, MonitorElement *offEtavsoffPhiOnOff, MonitorElement *NL1OnUM, MonitorElement *l1EtL1OnUM, MonitorElement *l1Etavsl1PhiL1OnUM, MonitorElement *NL1OffUM, MonitorElement *offEtL1OffUM, MonitorElement *offEtavsoffPhiL1OffUM, MonitorElement *NOnOffUM, MonitorElement *offEtOnOffUM, MonitorElement *offEtavsoffPhiOnOffUM, MonitorElement *offDRL1Off, MonitorElement *offDROnOff, MonitorElement *l1DRL1On, MonitorElement *filters, float ptmin, float ptmax)
const std::string getLabel(void) const
MonitorElement * getOffEtL1OffUMHisto()
void pushL1TriggerType(int trigType)
PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type, float ptmin, float ptmax)
void setReco(edm::Handle< T > offColl)
edm::EDGetTokenT< edm::TriggerResults > iterativeCone5CaloJetsToken_
MonitorElement * getL1EtaVsL1PhiL1OnHisto()
std::vector< int > Vids
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
MonitorElement * getOffEtaVsOffPhiL1OffHisto()
std::string pathsSummaryHLTCorrelationsFolder_
Definition: Run.h:41
edm::InputTag triggerResultsLabel_
void setHistos(MonitorElement *const NOn, MonitorElement *const onEtOn, MonitorElement *const onOneOverEtOn, MonitorElement *const onEtavsonPhiOn, MonitorElement *const NOff, MonitorElement *const offEtOff, MonitorElement *const offEtavsoffPhiOff, MonitorElement *const NL1, MonitorElement *const l1EtL1, MonitorElement *const l1Etavsl1PhiL1, MonitorElement *const NL1On, MonitorElement *const l1EtL1On, MonitorElement *const l1Etavsl1PhiL1On, MonitorElement *const NL1Off, MonitorElement *const offEtL1Off, MonitorElement *const offEtavsoffPhiL1Off, MonitorElement *const NOnOff, MonitorElement *const offEtOnOff, MonitorElement *const offEtavsoffPhiOnOff, MonitorElement *const NL1OnUM, MonitorElement *const l1EtL1OnUM, MonitorElement *const l1Etavsl1PhiL1OnUM, MonitorElement *const NL1OffUM, MonitorElement *const offEtL1OffUM, MonitorElement *const offEtavsoffPhiL1OffUM, MonitorElement *const NOnOffUM, MonitorElement *const offEtOnOffUM, MonitorElement *const offEtavsoffPhiOnOffUM, MonitorElement *const offDRL1Off, MonitorElement *const offDROnOff, MonitorElement *const l1DRL1On)
void setLabel(std::string labelName)
Definition: DDAxes.h:10
edm::EDGetTokenT< edm::TriggerResults > photonsToken_
void setBJetsFlag(bool flag)