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 
152  unsigned int nBins_;
153  unsigned int nBinsOneOverEt_;
154  double ptMin_ ;
155  double ptMax_ ;
156 
160  double muonEtaMax_;
161  double muonEtMin_;
162  double muonDRMatch_;
163  double tauEtaMax_;
164  double tauEtMin_;
165  double tauDRMatch_;
166  double jetEtaMax_;
167  double jetEtMin_;
168  double jetDRMatch_;
169  double bjetEtaMax_;
170  double bjetEtMin_;
171  double bjetDRMatch_;
173  double photonEtMin_;
175  double trackEtaMax_;
176  double trackEtMin_;
178  double metEtaMax_;
179  double metMin_;
180  double metDRMatch_;
181  double htEtaMax_;
182  double htMin_;
183  double htDRMatch_;
184  double sumEtMin_;
185 
186  std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
187 
188  std::vector <std::vector <std::string> > triggerFilters_;
189  std::vector <std::vector <uint> > triggerFilterIndices_;
190  std::vector <std::pair<std::string, int> > fPathTempCountPair;
191  std::vector <std::pair<std::string, std::vector<int> > > fPathBxTempCountPair;
192  std::vector <std::pair<std::string, int> > fGroupTempCountPair;
193  std::vector <std::pair<std::string, int> > fGroupL1TempCountPair;
194  std::vector <std::pair<std::string, std::vector<std::string> > > fGroupNamePathsPair;
195 
196  std::vector<std::string> specialPaths_;
197 
204  // data across paths
206  // helper class to store the data path
207 
209 
210  //define Token(-s)
224 
225  class PathInfo {
226 
228  pathIndex_(-1), denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), processName_("unset"), objectType_(-1) {};
229 
230  public:
231 
233  {
234  filters_ = filters;
235  }
236 
237  void setHistos(
238 
239  MonitorElement* const NOn,
240  MonitorElement* const onEtOn,
241  MonitorElement* const onOneOverEtOn,
242  MonitorElement* const onEtavsonPhiOn,
243  MonitorElement* const NOff,
244  MonitorElement* const offEtOff,
245  MonitorElement* const offEtavsoffPhiOff,
246  MonitorElement* const NL1,
247  MonitorElement* const l1EtL1,
248  MonitorElement* const l1Etavsl1PhiL1,
249  MonitorElement* const NL1On,
250  MonitorElement* const l1EtL1On,
251  MonitorElement* const l1Etavsl1PhiL1On,
252  MonitorElement* const NL1Off,
253  MonitorElement* const offEtL1Off,
254  MonitorElement* const offEtavsoffPhiL1Off,
255  MonitorElement* const NOnOff,
256  MonitorElement* const offEtOnOff,
257  MonitorElement* const offEtavsoffPhiOnOff,
258  MonitorElement* const NL1OnUM,
259  MonitorElement* const l1EtL1OnUM,
260  MonitorElement* const l1Etavsl1PhiL1OnUM,
261  MonitorElement* const NL1OffUM,
262  MonitorElement* const offEtL1OffUM,
263  MonitorElement* const offEtavsoffPhiL1OffUM,
264  MonitorElement* const NOnOffUM,
265  MonitorElement* const offEtOnOffUM,
266  MonitorElement* const offEtavsoffPhiOnOffUM,
267  MonitorElement* const offDRL1Off,
268  MonitorElement* const offDROnOff,
269  MonitorElement* const l1DRL1On)
270  {
271 
272  NOn_ = NOn;
273  onEtOn_ = onEtOn;
274  onOneOverEtOn_ = onOneOverEtOn;
275  onEtavsonPhiOn_ = onEtavsonPhiOn;
276  //NOff_ = NOff;
277  //offEtOff_ = offEtOff;
278  //offEtavsoffPhiOff_ = offEtavsoffPhiOff;
279  NL1_ = NL1;
280  l1EtL1_ = l1EtL1;
281  l1Etavsl1PhiL1_ = l1Etavsl1PhiL1;
282  NL1On_ = NL1On;
283  l1EtL1On_ = l1EtL1On;
284  l1Etavsl1PhiL1On_ = l1Etavsl1PhiL1On;
285  NL1Off_ = NL1Off;
286  offEtL1Off_ = offEtL1Off;
287  offEtavsoffPhiL1Off_ = offEtavsoffPhiL1Off;
288  NOnOff_ = NOnOff;
289  offEtOnOff_ = offEtOnOff;
290  offEtavsoffPhiOnOff_ = offEtavsoffPhiOnOff;
291  NL1OnUM_ = NL1OnUM;
292  l1EtL1OnUM_ = l1EtL1OnUM;
293  l1Etavsl1PhiL1OnUM_ = l1Etavsl1PhiL1OnUM;
294  NL1OffUM_ = NL1OffUM;
295  offEtL1OffUM_ = offEtL1OffUM;
296  offEtavsoffPhiL1OffUM_ = offEtavsoffPhiL1OffUM;
297  NOnOffUM_ = NOnOffUM;
298  offEtOnOffUM_ = offEtOnOffUM;
299  offEtavsoffPhiOnOffUM_ = offEtavsoffPhiOnOffUM;
300  offDRL1Off_ = offDRL1Off;
301  offDROnOff_ = offDROnOff;
302  l1DRL1On_ = l1DRL1On;
303 
304  }
305 
307  return NOn_;
308  }
310  return onEtOn_;
311  }
313  return onOneOverEtOn_;
314  }
316  return onEtavsonPhiOn_;
317  }
318  // MonitorElement * getNOffHisto() {
319  // return NOff_;
320  // }
321  // MonitorElement * getOffEtOffHisto() {
322  // return offEtOff_;
323  // }
324  // MonitorElement * getOffEtaVsOffPhiOffHisto() {
325  // return offEtavsoffPhiOff_;
326  // }
328  return NL1_;
329  }
331  return l1EtL1_;
332  }
334  return l1Etavsl1PhiL1_;
335  }
337  return NL1On_;
338  }
340  return l1EtL1On_;
341  }
343  return l1Etavsl1PhiL1On_;
344  }
346  return NL1Off_;
347  }
349  return offEtL1Off_;
350  }
352  return offEtavsoffPhiL1Off_;
353  }
355  return NOnOff_;
356  }
358  return offEtOnOff_;
359  }
361  return offEtavsoffPhiOnOff_;
362  }
364  return NL1OnUM_;
365  }
367  return l1EtL1OnUM_;
368  }
370  return l1Etavsl1PhiL1OnUM_;
371  }
373  return NL1OffUM_;
374  }
376  return offEtL1OffUM_;
377  }
379  return offEtavsoffPhiL1OffUM_;
380  }
382  return NOnOffUM_;
383  }
385  return offEtOnOffUM_;
386  }
388  return offEtavsoffPhiOnOffUM_;
389  }
391  return offDRL1Off_;
392  }
394  return offDROnOff_;
395  }
397  return l1DRL1On_;
398  }
400  return filters_;
401  }
402  const std::string getLabel(void ) const {
403  return filterName_;
404  }
405  void setLabel(std::string labelName){
406  filterName_ = labelName;
407  return;
408  }
409  const std::string getPath(void ) const {
410  return pathName_;
411  }
412  const std::string getl1Path(void ) const {
413  return l1pathName_;
414  }
415  const std::string getDenomPath(void ) const {
416  return denomPathName_;
417  }
418  const std::string getProcess(void ) const {
419  return processName_;
420  }
421  const int getObjectType(void ) const {
422  return objectType_;
423  }
424 
425  const edm::InputTag getTag(void) const{
427  return tagName;
428  }
429 
430  ~PathInfo() {};
431 
432  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type, float ptmin, float ptmax):
433 
434  denomPathName_(denomPathName),
435  pathName_(pathName),
436  l1pathName_(l1pathName),
437  filterName_(filterName),
438  processName_(processName),
439  objectType_(type),
440  NOn_(0), onEtOn_(0), onOneOverEtOn_(0), onEtavsonPhiOn_(0),
441 
442  NL1_(0), l1EtL1_(0), l1Etavsl1PhiL1_(0),
449  offDRL1Off_(0), offDROnOff_(0), l1DRL1On_(0), filters_(0),
450  ptmin_(ptmin), ptmax_(ptmax)
451 
452  {
453  };
454 
455  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type,
456  MonitorElement *NOn,
457  MonitorElement *onEtOn,
458  MonitorElement *onOneOverEtOn,
459  MonitorElement *onEtavsonPhiOn,
460  MonitorElement *NOff,
461  MonitorElement *offEtOff,
462  MonitorElement *offEtavsoffPhiOff,
463  MonitorElement *NL1,
464  MonitorElement *l1EtL1,
465  MonitorElement *l1Etavsl1PhiL1,
466  MonitorElement *NL1On,
467  MonitorElement *l1EtL1On,
468  MonitorElement *l1Etavsl1PhiL1On,
469  MonitorElement *NL1Off,
470  MonitorElement *offEtL1Off,
471  MonitorElement *offEtavsoffPhiL1Off,
472  MonitorElement *NOnOff,
473  MonitorElement *offEtOnOff,
474  MonitorElement *offEtavsoffPhiOnOff,
475  MonitorElement *NL1OnUM,
476  MonitorElement *l1EtL1OnUM,
477  MonitorElement *l1Etavsl1PhiL1OnUM,
478  MonitorElement *NL1OffUM,
479  MonitorElement *offEtL1OffUM,
480  MonitorElement *offEtavsoffPhiL1OffUM,
481  MonitorElement *NOnOffUM,
482  MonitorElement *offEtOnOffUM,
483  MonitorElement *offEtavsoffPhiOnOffUM,
484  MonitorElement *offDRL1Off,
485  MonitorElement *offDROnOff,
486  MonitorElement *l1DRL1On,
488  float ptmin, float ptmax
489  ):
490 
491  denomPathName_(denomPathName),
492  pathName_(pathName), l1pathName_(l1pathName),
493  filterName_(filterName), processName_(processName), objectType_(type),
494  NOn_(NOn), onEtOn_(onEtOn), onOneOverEtOn_(onOneOverEtOn), onEtavsonPhiOn_(onEtavsonPhiOn),
495  NL1_(NL1), l1EtL1_(l1EtL1), l1Etavsl1PhiL1_(l1Etavsl1PhiL1),
496  NL1On_(NL1On), l1EtL1On_(l1EtL1On), l1Etavsl1PhiL1On_(l1Etavsl1PhiL1On),
497  NL1Off_(NL1Off), offEtL1Off_(offEtL1Off), offEtavsoffPhiL1Off_(offEtavsoffPhiL1Off),
498  NOnOff_(NOnOff), offEtOnOff_(offEtOnOff), offEtavsoffPhiOnOff_(offEtavsoffPhiOnOff),
499  NL1OnUM_(NL1OnUM), l1EtL1OnUM_(l1EtL1OnUM), l1Etavsl1PhiL1OnUM_(l1Etavsl1PhiL1OnUM),
500  NL1OffUM_(NL1OffUM), offEtL1OffUM_(offEtL1OffUM), offEtavsoffPhiL1OffUM_(offEtavsoffPhiL1OffUM),
501  NOnOffUM_(NOnOffUM), offEtOnOffUM_(offEtOnOffUM), offEtavsoffPhiOnOffUM_(offEtavsoffPhiOnOffUM),
502  offDRL1Off_(offDRL1Off),
503  offDROnOff_(offDROnOff),
504  l1DRL1On_(l1DRL1On),
505  filters_(filters),
506  ptmin_(ptmin), ptmax_(ptmax)
507  {
508  };
509 
510  bool operator==(const std::string& v)
511  {
512  return v==filterName_;
513  }
514 
515  bool operator!=(const std::string& v)
516  {
517  return v!=filterName_;
518  }
519 
520  float getPtMin() const { return ptmin_; }
521  float getPtMax() const { return ptmax_; }
522 
523  std::vector< std::pair<std::string,unsigned int> > filtersAndIndices;
524 
525 
526  private:
527 
535 
536  // we don't own this data
538  // MonitorElement *NOff_, *offEtOff_, *offEtavsoffPhiOff_;
548 
549  float ptmin_, ptmax_;
550 
551  const int index() {
552  return pathIndex_;
553  }
554  const int type() {
555  return objectType_;
556  }
557 
558 
559  };
560 
561 
562  public:
563 
564  // simple collection - just
565  class PathInfoCollection: public std::vector<PathInfo> {
566  public:
567 
568  PathInfoCollection(): std::vector<PathInfo>()
569  {};
570  std::vector<PathInfo>::iterator find(std::string pathName) {
571  return std::find(begin(), end(), pathName);
572  }
573  };
574 
576 
578 
579 };
580 
581 
583 {
584  public:
585  virtual void clearSets( void ) = 0;
586  virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v) = 0;
587  virtual void monitorL1( const int l1Index, FourVectorHLTOnline* fv) = 0;
588  virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv) = 0;
589 
590  virtual void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn) = 0;
591 
592  virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline* fv) = 0;
593 
594  virtual bool isTriggerType(int t) = 0;
595  virtual ~BaseMonitor(){}
596 
597 };
598 
599 template <class T>
600 class objMonData:public BaseMonitor {
601 public:
602  objMonData() { EtaMax_= 2.5; EtMin_=3.0; GenJetsFlag_ = false; BJetsFlag_ = false; }
603  void setLimits(float etaMax, float etMin, float drMatch)
604  {
605  EtaMax_= etaMax;
606  EtMin_= etMin;
607  DRMatch_= drMatch;
608  }
609  void setTriggerType(const std::vector<int>& trigType) { triggerType_ = trigType; }
610  void pushTriggerType(int trigType) { triggerType_.push_back(trigType); }
611  void setL1TriggerType(const std::vector<int>& trigType) { l1triggerType_ = trigType; }
612  void pushL1TriggerType(int trigType) { l1triggerType_.push_back(trigType); }
613  void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v) { v_ = v; }
614  void setReco(edm::Handle<T> offColl) { offColl_ = offColl; }
615 
616 
617  // Monitor methods
618 
619  void monitorL1(const int l1Index, FourVectorHLTOnline* fv);
620  void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv);
621  void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn);
622  void fillOnlineMatch(const int l1Index, FourVectorHLTOnline* fv);
623  void fillOnL1Match(const int l1Index, FourVectorHLTOnline* fv);
624 
625  void clearSets();
626 
627  bool isTriggerType(int t);
628  bool isL1TriggerType(int t);
629 
636 
637 
638  void setBJetsFlag(bool flag)
639  {
640  BJetsFlag_ = flag;
641  }
642 
643 
644 private:
645 
646  int pdgId_;
648 
649  float EtaMax_;
650  float EtMin_;
651 
652  float DRMatch_;
653 
656 
657  std::vector<int> triggerType_;
658  std::vector<int> l1triggerType_;
659 
661 
662  FourVectorHLTOnline::PathInfoCollection::iterator v_;
663 
664 };
665 
666 
667 template <class T>
669 {
670  bool rc = false;
671 
672  for(std::vector<int>::const_iterator it = triggerType_.begin(); it != triggerType_.end(); ++it)
673  {
674 
675  if(t == *it) { rc = true; break; }
676 
677  } // end for
678 
679  if (t==0) rc = true;
680 
681  return rc;
682 
683 }
684 
685 
686 template <class T>
688 {
689  bool rc = false;
690 
691  for(std::vector<int>::const_iterator it = l1triggerType_.begin(); it != l1triggerType_.end(); ++it)
692  {
693 
694  if(std::abs(t) == std::abs(*it)) { rc = true; break; }
695 
696  } // end for
697 
698  return rc;
699 
700 }
701 
702 
703 template <class T>
704 void objMonData<T>::monitorL1(const int l1Index, FourVectorHLTOnline* fv)
705 {
706 
707  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
708 
709  unsigned int NL1=0;
710  unsigned int NL1OffUM=0;
711 
712  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
713  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
714  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
715  bool l1accept = l1k.size() > 0;
716 
717  if(!l1accept) return;
718 
719  trigger::Vids::const_iterator idtypeiter = idtype.begin();
720 
721  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
722 
723  trigger::TriggerObject l1FV = toc[*l1ki];
724  if(isL1TriggerType(*idtypeiter))
725  {
726 
727 
728 
729  if (fabs(l1FV.eta()) <= EtaMax_ && l1FV.pt() >= EtMin_)
730  {
731 
732  NL1++;
733 
734  v_->getL1EtL1Histo()->Fill(l1FV.pt());
735  v_->getL1EtaVsL1PhiL1Histo()->Fill(l1FV.eta(), l1FV.phi());
736 
737  }
738  else {
739 
740  continue;
741 
742  }
743 
744  } // end if isL1TriggerType
745  ++idtypeiter;
746 
747  } // end for l1ki
748 
749  if(NL1 > 0) v_->getNL1Histo()->Fill(NL1);
750  if(NL1OffUM > 0) v_->getNL1OffUMHisto()->Fill(NL1OffUM);
751 
752 }
753 
754 
755 template <class T>
756 void objMonData<T>::monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv)
757 {
758 
759  //if(! isTriggerType(v_->getObjectType()) ) return;
760 
761  // Get keys of objects passed by the last filter
762  const trigger::Keys & k = fv->fTriggerObj->filterKeys(hltIndex);
763 
764  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
765 
766  unsigned int NOn=0;
767 
768  // Loop over HLT objects
769  for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
770 
771  trigger::TriggerObject onlineFV = toc[*ki];
772 
773  if (fabs(onlineFV.eta()) <= EtaMax_ && onlineFV.pt() >= EtMin_)
774  {
775 
776  NOn++;
777 
778  v_->getOnEtOnHisto()->Fill(onlineFV.pt());
779  v_->getOnOneOverEtOnHisto()->Fill(1./onlineFV.pt());
780  v_->getOnEtaVsOnPhiOnHisto()->Fill(onlineFV.eta(), onlineFV.phi());
781 
782  }
783  else {
784 
785  return;
786 
787  }
788 
789  matchOnlineL1(onlineFV,l1Index, fv, NOn);
790 
791  } // end loop over HLT objects
792 
793  if(NOn>0) v_->getNOnHisto()->Fill(NOn);
794 
795 }
796 
797 template <class T>
798 void objMonData<T>::matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn)
799 {
800 
801  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
802 
803  unsigned int NOnL1UM=0;
804 
805  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
806  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
807  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
808 
809  fimmap OnL1DRMatchMap;
810  int j=0;
811  trigger::Vids::const_iterator idtypeiter = idtype.begin();
812  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki )
813  {
814 
815 
816 
817  if(isL1TriggerType(*idtypeiter))
818  {
819 
820  trigger::TriggerObject l1FV = toc[*l1ki];
821 
822  if ( fabs(l1FV.eta()) <= EtaMax_ && l1FV.pt() >= EtMin_ )
823  {
824 
825  // fill UM histos (no matching required)
826  if(NOn == 1) {
827 
828  NOnL1UM++;
829  v_->getL1EtL1OnUMHisto()->Fill(l1FV.pt());
830  v_->getL1EtaVsL1PhiL1OnUMHisto()->Fill(l1FV.eta(),l1FV.phi());
831 
832  }
833 
834 
835  float dR = reco::deltaR(l1FV.eta(),l1FV.phi(),onlineFV.eta(),onlineFV.phi());
836 
837  if ( dR < 1.0)
838  {
839 
840  OnL1DRMatchMap.insert(std::pair<float,int>(dR,j));
841 
842  }
843 
844  } // end if l1FV eta, pt
845 
846  } // end if isL1TriggerType
847 
848  ++idtypeiter;
849  j++;
850 
851  } // end for
852 
853  if(! OnL1DRMatchMap.empty()) OnL1DRMatchSet.insert(OnL1DRMatchMap);
854 
855 }
856 
857 template <class T>
859 {
860 
861  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
862  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
863 
864  unsigned int NOnL1=0;
865 
866  // clean the set On-L1
867  if(OnL1DRMatchSet.size() > 1) {
868 
869  LogDebug("FourVectorHLTOnline") << " Cleaning L1On mmset" << std::endl;
870  fv->cleanDRMatchSet(OnL1DRMatchSet);
871 
872  }
873  // now fill histos
874  for ( mmset::iterator setIter = OnL1DRMatchSet.begin( ); setIter != OnL1DRMatchSet.end( ); setIter++ )
875  {
876 
877  fimmap tempMap = *setIter;
878 
879  fimmap::iterator it = tempMap.begin();
880  int i = (*it).second ;
881  float dR = (*it).first;
882  v_->getL1DROnL1Histo()->Fill(dR);
883 
884  if (dR > DRMatch_) continue;
885 
886  trigger::Keys::const_iterator l1ki = l1k.begin();
887  for (int count = 0; count < i; count++) l1ki++;
888 
889  NOnL1++;
890  v_->getL1EtL1OnHisto()->Fill(toc[*l1ki].pt());
891  v_->getL1EtaVsL1PhiL1OnHisto()->Fill(toc[*l1ki].eta(),toc[*l1ki].phi());
892 
893  }
894 
895  v_->getNL1OnHisto()->Fill(NOnL1);
896 
897 }
898 
899 template <class T>
901 {
902 
903 
904  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
905  fillOnL1Match(l1Index, fv);
906 
907 }
908 
909 
910 template <class T>
912 {
913 
914  L1OffDRMatchSet.clear();
915  L1MCDRMatchSet.clear();
916  OnOffDRMatchSet.clear();
917  OnMCDRMatchSet.clear();
918  OnL1DRMatchSet.clear();
919  OffMCDRMatchSet.clear();
920 
921 }
922 
923 
924 
925 #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)
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::multimap< float, int > fimmap
edm::Handle< edm::TriggerResults > triggerResults_
void countHLTPathHitsEndLumiBlock(const int &lumi)
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
float eta() const
Definition: TriggerObject.h:57
std::vector< std::pair< std::string, int > > fPathTempCountPair
T eta() const
edm::Handle< T > offColl_
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< int > triggerType_
std::vector< int > l1triggerType_
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)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< edm::TriggerResults > muonRecoCollectionNameToken_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsTokenFU_
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_
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)