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 // $Id: FourVectorHLTOnline.h,v 1.18 2011/09/20 21:49:27 slaunwhj Exp $
23 //
24 //
25 
26 // system include files
27 #include <memory>
28 #include <unistd.h>
29 
30 
31 // user include files
34 
40 
46 
47 // added VR
53 
55 
58 
60 
62 
63 
64 
65 #include <iostream>
66 #include <fstream>
67 #include <vector>
68 
69 namespace edm {
70  class TriggerNames;
71 }
72 
73 typedef std::multimap<float,int> fimmap ;
74 typedef std::set<fimmap , std::less<fimmap> > mmset;
75 
77 
78  public:
79  explicit FourVectorHLTOnline(const edm::ParameterSet&);
81 
82  void cleanDRMatchSet(mmset& tempSet);
83 
85 
86  private:
87  virtual void beginJob() ;
88  virtual void analyze(const edm::Event&, const edm::EventSetup&);
89  virtual void endJob() ;
90 
91  // BeginRun
92  void beginRun(const edm::Run& run, const edm::EventSetup& c);
93 
94  // EndRun
95  void endRun(const edm::Run& run, const edm::EventSetup& c);
96  void fillHltMatrix(const edm::TriggerNames & triggerNames);
97  void setupHltMatrix(std::string label, std::vector<std::string> paths);
98 
99  void setupHltLsPlots();
100  void setupHltBxPlots();
101  void countHLTPathHitsEndLumiBlock(const int& lumi);
102  void countHLTGroupHitsEndLumiBlock(const int& lumi);
103  void countHLTGroupL1HitsEndLumiBlock(const int& lumi);
104  void countHLTGroupBXHitsEndLumiBlock(const int& lumi);
105  int getTriggerTypeParsePathName(const std::string& pathname);
106  const std::string getL1ConditionModuleName(const std::string& pathname);
107  bool hasL1Passed(const std::string& pathname, const edm::TriggerNames & triggerNames);
108  bool hasHLTPassed(const std::string& pathname, const edm::TriggerNames& triggerNames);
109 
110  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
111  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
112 
113  // ----------member data ---------------------------
114  int nev_;
116  bool fLumiFlag;
117 
118  /*
119  MonitorElement* total_;
120  MonitorElement* ME_HLTPassPass_;
121  MonitorElement* ME_HLTPassPass_Normalized_;
122  MonitorElement* ME_HLTPass_Normalized_Any_;
123  MonitorElement* ME_HLTPassFail_;
124  MonitorElement* ME_HLTPassFail_Normalized_;
125 
126  std::vector<MonitorElement*> v_ME_HLTPassPass_;
127  std::vector<MonitorElement*> v_ME_HLTPassPass_Normalized_;
128  std::vector<MonitorElement*> v_ME_HLTPass_Normalized_Any_;
129  */
130 
134  std::vector<MonitorElement*> v_ME_HLTAll_LS_;
135 
136  std::string pathsSummaryFolder_;
143  std::string fCustomBXPath;
144 
145  std::vector<std::string> fGroupName;
146 
147  unsigned int nLS_;
148  unsigned int referenceBX_;
149  unsigned int Nbx_;
150 
151  bool plotAll_;
152  bool resetMe_;
154 
155  unsigned int nBins_;
156  unsigned int nBinsOneOverEt_;
157  double ptMin_ ;
158  double ptMax_ ;
159 
163  double muonEtaMax_;
164  double muonEtMin_;
165  double muonDRMatch_;
166  double tauEtaMax_;
167  double tauEtMin_;
168  double tauDRMatch_;
169  double jetEtaMax_;
170  double jetEtMin_;
171  double jetDRMatch_;
172  double bjetEtaMax_;
173  double bjetEtMin_;
174  double bjetDRMatch_;
176  double photonEtMin_;
178  double trackEtaMax_;
179  double trackEtMin_;
181  double metEtaMax_;
182  double metMin_;
183  double metDRMatch_;
184  double htEtaMax_;
185  double htMin_;
186  double htDRMatch_;
187  double sumEtMin_;
188 
189  std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
190 
191  std::vector <std::vector <std::string> > triggerFilters_;
192  std::vector <std::vector <uint> > triggerFilterIndices_;
193  std::vector <std::pair<std::string, int> > fPathTempCountPair;
194  std::vector <std::pair<std::string, std::vector<int> > > fPathBxTempCountPair;
195  std::vector <std::pair<std::string, int> > fGroupTempCountPair;
196  std::vector <std::pair<std::string, int> > fGroupL1TempCountPair;
197  std::vector <std::pair<std::string, std::vector<std::string> > > fGroupNamePathsPair;
198 
199  std::vector<std::string> specialPaths_;
200 
201  std::string dirname_;
202  std::string processname_;
209  // data across paths
211  // helper class to store the data path
212 
214 
215  class PathInfo {
216 
218  pathIndex_(-1), denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), processName_("unset"), objectType_(-1) {};
219 
220  public:
221 
223  {
224  filters_ = filters;
225  }
226 
227  void setHistos(
228 
229  MonitorElement* const NOn,
230  MonitorElement* const onEtOn,
231  MonitorElement* const onOneOverEtOn,
232  MonitorElement* const onEtavsonPhiOn,
233  MonitorElement* const NOff,
234  MonitorElement* const offEtOff,
235  MonitorElement* const offEtavsoffPhiOff,
236  MonitorElement* const NL1,
237  MonitorElement* const l1EtL1,
238  MonitorElement* const l1Etavsl1PhiL1,
239  MonitorElement* const NL1On,
240  MonitorElement* const l1EtL1On,
241  MonitorElement* const l1Etavsl1PhiL1On,
242  MonitorElement* const NL1Off,
243  MonitorElement* const offEtL1Off,
244  MonitorElement* const offEtavsoffPhiL1Off,
245  MonitorElement* const NOnOff,
246  MonitorElement* const offEtOnOff,
247  MonitorElement* const offEtavsoffPhiOnOff,
248  MonitorElement* const NL1OnUM,
249  MonitorElement* const l1EtL1OnUM,
250  MonitorElement* const l1Etavsl1PhiL1OnUM,
251  MonitorElement* const NL1OffUM,
252  MonitorElement* const offEtL1OffUM,
253  MonitorElement* const offEtavsoffPhiL1OffUM,
254  MonitorElement* const NOnOffUM,
255  MonitorElement* const offEtOnOffUM,
256  MonitorElement* const offEtavsoffPhiOnOffUM,
257  MonitorElement* const offDRL1Off,
258  MonitorElement* const offDROnOff,
259  MonitorElement* const l1DRL1On)
260  {
261 
262  NOn_ = NOn;
263  onEtOn_ = onEtOn;
264  onOneOverEtOn_ = onOneOverEtOn;
265  onEtavsonPhiOn_ = onEtavsonPhiOn;
266  //NOff_ = NOff;
267  //offEtOff_ = offEtOff;
268  //offEtavsoffPhiOff_ = offEtavsoffPhiOff;
269  NL1_ = NL1;
270  l1EtL1_ = l1EtL1;
271  l1Etavsl1PhiL1_ = l1Etavsl1PhiL1;
272  NL1On_ = NL1On;
273  l1EtL1On_ = l1EtL1On;
274  l1Etavsl1PhiL1On_ = l1Etavsl1PhiL1On;
275  NL1Off_ = NL1Off;
276  offEtL1Off_ = offEtL1Off;
277  offEtavsoffPhiL1Off_ = offEtavsoffPhiL1Off;
278  NOnOff_ = NOnOff;
279  offEtOnOff_ = offEtOnOff;
280  offEtavsoffPhiOnOff_ = offEtavsoffPhiOnOff;
281  NL1OnUM_ = NL1OnUM;
282  l1EtL1OnUM_ = l1EtL1OnUM;
283  l1Etavsl1PhiL1OnUM_ = l1Etavsl1PhiL1OnUM;
284  NL1OffUM_ = NL1OffUM;
285  offEtL1OffUM_ = offEtL1OffUM;
286  offEtavsoffPhiL1OffUM_ = offEtavsoffPhiL1OffUM;
287  NOnOffUM_ = NOnOffUM;
288  offEtOnOffUM_ = offEtOnOffUM;
289  offEtavsoffPhiOnOffUM_ = offEtavsoffPhiOnOffUM;
290  offDRL1Off_ = offDRL1Off;
291  offDROnOff_ = offDROnOff;
292  l1DRL1On_ = l1DRL1On;
293 
294  }
295 
297  return NOn_;
298  }
300  return onEtOn_;
301  }
303  return onOneOverEtOn_;
304  }
306  return onEtavsonPhiOn_;
307  }
308  // MonitorElement * getNOffHisto() {
309  // return NOff_;
310  // }
311  // MonitorElement * getOffEtOffHisto() {
312  // return offEtOff_;
313  // }
314  // MonitorElement * getOffEtaVsOffPhiOffHisto() {
315  // return offEtavsoffPhiOff_;
316  // }
318  return NL1_;
319  }
321  return l1EtL1_;
322  }
324  return l1Etavsl1PhiL1_;
325  }
327  return NL1On_;
328  }
330  return l1EtL1On_;
331  }
333  return l1Etavsl1PhiL1On_;
334  }
336  return NL1Off_;
337  }
339  return offEtL1Off_;
340  }
342  return offEtavsoffPhiL1Off_;
343  }
345  return NOnOff_;
346  }
348  return offEtOnOff_;
349  }
351  return offEtavsoffPhiOnOff_;
352  }
354  return NL1OnUM_;
355  }
357  return l1EtL1OnUM_;
358  }
360  return l1Etavsl1PhiL1OnUM_;
361  }
363  return NL1OffUM_;
364  }
366  return offEtL1OffUM_;
367  }
369  return offEtavsoffPhiL1OffUM_;
370  }
372  return NOnOffUM_;
373  }
375  return offEtOnOffUM_;
376  }
378  return offEtavsoffPhiOnOffUM_;
379  }
381  return offDRL1Off_;
382  }
384  return offDROnOff_;
385  }
387  return l1DRL1On_;
388  }
390  return filters_;
391  }
392  const std::string getLabel(void ) const {
393  return filterName_;
394  }
395  void setLabel(std::string labelName){
396  filterName_ = labelName;
397  return;
398  }
399  const std::string getPath(void ) const {
400  return pathName_;
401  }
402  const std::string getl1Path(void ) const {
403  return l1pathName_;
404  }
405  const std::string getDenomPath(void ) const {
406  return denomPathName_;
407  }
408  const std::string getProcess(void ) const {
409  return processName_;
410  }
411  const int getObjectType(void ) const {
412  return objectType_;
413  }
414 
415  const edm::InputTag getTag(void) const{
417  return tagName;
418  }
419 
420  ~PathInfo() {};
421 
422  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type, float ptmin, float ptmax):
423 
424  denomPathName_(denomPathName),
425  pathName_(pathName),
426  l1pathName_(l1pathName),
427  filterName_(filterName),
428  processName_(processName),
429  objectType_(type),
430  NOn_(0), onEtOn_(0), onOneOverEtOn_(0), onEtavsonPhiOn_(0),
431 
432  NL1_(0), l1EtL1_(0), l1Etavsl1PhiL1_(0),
439  offDRL1Off_(0), offDROnOff_(0), l1DRL1On_(0), filters_(0),
440  ptmin_(ptmin), ptmax_(ptmax)
441 
442  {
443  };
444 
445  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type,
446  MonitorElement *NOn,
447  MonitorElement *onEtOn,
448  MonitorElement *onOneOverEtOn,
449  MonitorElement *onEtavsonPhiOn,
450  MonitorElement *NOff,
451  MonitorElement *offEtOff,
452  MonitorElement *offEtavsoffPhiOff,
453  MonitorElement *NL1,
454  MonitorElement *l1EtL1,
455  MonitorElement *l1Etavsl1PhiL1,
456  MonitorElement *NL1On,
457  MonitorElement *l1EtL1On,
458  MonitorElement *l1Etavsl1PhiL1On,
459  MonitorElement *NL1Off,
460  MonitorElement *offEtL1Off,
461  MonitorElement *offEtavsoffPhiL1Off,
462  MonitorElement *NOnOff,
463  MonitorElement *offEtOnOff,
464  MonitorElement *offEtavsoffPhiOnOff,
465  MonitorElement *NL1OnUM,
466  MonitorElement *l1EtL1OnUM,
467  MonitorElement *l1Etavsl1PhiL1OnUM,
468  MonitorElement *NL1OffUM,
469  MonitorElement *offEtL1OffUM,
470  MonitorElement *offEtavsoffPhiL1OffUM,
471  MonitorElement *NOnOffUM,
472  MonitorElement *offEtOnOffUM,
473  MonitorElement *offEtavsoffPhiOnOffUM,
474  MonitorElement *offDRL1Off,
475  MonitorElement *offDROnOff,
476  MonitorElement *l1DRL1On,
478  float ptmin, float ptmax
479  ):
480 
481  denomPathName_(denomPathName),
482  pathName_(pathName), l1pathName_(l1pathName),
483  filterName_(filterName), processName_(processName), objectType_(type),
484  NOn_(NOn), onEtOn_(onEtOn), onOneOverEtOn_(onOneOverEtOn), onEtavsonPhiOn_(onEtavsonPhiOn),
485  NL1_(NL1), l1EtL1_(l1EtL1), l1Etavsl1PhiL1_(l1Etavsl1PhiL1),
486  NL1On_(NL1On), l1EtL1On_(l1EtL1On), l1Etavsl1PhiL1On_(l1Etavsl1PhiL1On),
487  NL1Off_(NL1Off), offEtL1Off_(offEtL1Off), offEtavsoffPhiL1Off_(offEtavsoffPhiL1Off),
488  NOnOff_(NOnOff), offEtOnOff_(offEtOnOff), offEtavsoffPhiOnOff_(offEtavsoffPhiOnOff),
489  NL1OnUM_(NL1OnUM), l1EtL1OnUM_(l1EtL1OnUM), l1Etavsl1PhiL1OnUM_(l1Etavsl1PhiL1OnUM),
490  NL1OffUM_(NL1OffUM), offEtL1OffUM_(offEtL1OffUM), offEtavsoffPhiL1OffUM_(offEtavsoffPhiL1OffUM),
491  NOnOffUM_(NOnOffUM), offEtOnOffUM_(offEtOnOffUM), offEtavsoffPhiOnOffUM_(offEtavsoffPhiOnOffUM),
492  offDRL1Off_(offDRL1Off),
493  offDROnOff_(offDROnOff),
494  l1DRL1On_(l1DRL1On),
495  filters_(filters),
496  ptmin_(ptmin), ptmax_(ptmax)
497  {
498  };
499 
500  bool operator==(const std::string& v)
501  {
502  return v==filterName_;
503  }
504 
505  bool operator!=(const std::string& v)
506  {
507  return v!=filterName_;
508  }
509 
510  float getPtMin() const { return ptmin_; }
511  float getPtMax() const { return ptmax_; }
512 
513  std::vector< std::pair<std::string,unsigned int> > filtersAndIndices;
514 
515 
516  private:
517 
519  std::string denomPathName_;
520  std::string pathName_;
521  std::string l1pathName_;
522  std::string filterName_;
523  std::string processName_;
525 
526  // we don't own this data
528  // MonitorElement *NOff_, *offEtOff_, *offEtavsoffPhiOff_;
538 
539  float ptmin_, ptmax_;
540 
541  const int index() {
542  return pathIndex_;
543  }
544  const int type() {
545  return objectType_;
546  }
547 
548 
549  };
550 
551 
552  public:
553 
554  // simple collection - just
555  class PathInfoCollection: public std::vector<PathInfo> {
556  public:
557 
558  PathInfoCollection(): std::vector<PathInfo>()
559  {};
560  std::vector<PathInfo>::iterator find(std::string pathName) {
561  return std::find(begin(), end(), pathName);
562  }
563  };
564 
566 
568 
569 };
570 
571 
573 {
574  public:
575  virtual void clearSets( void ) = 0;
576  virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v) = 0;
577  virtual void monitorL1( const int l1Index, FourVectorHLTOnline* fv) = 0;
578  virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv) = 0;
579 
580  virtual void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn) = 0;
581 
582  virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline* fv) = 0;
583 
584  virtual bool isTriggerType(int t) = 0;
585  virtual ~BaseMonitor(){}
586 
587 };
588 
589 template <class T>
590 class objMonData:public BaseMonitor {
591 public:
592  objMonData() { EtaMax_= 2.5; EtMin_=3.0; GenJetsFlag_ = false; BJetsFlag_ = false; }
593  void setLimits(float etaMax, float etMin, float drMatch)
594  {
595  EtaMax_= etaMax;
596  EtMin_= etMin;
597  DRMatch_= drMatch;
598  }
599  void setTriggerType(std::vector<int> trigType) { triggerType_ = trigType; }
600  void pushTriggerType(int trigType) { triggerType_.push_back(trigType); }
601  void setL1TriggerType(std::vector<int> trigType) { l1triggerType_ = trigType; }
602  void pushL1TriggerType(int trigType) { l1triggerType_.push_back(trigType); }
603  void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v) { v_ = v; }
604  void setReco(edm::Handle<T> offColl) { offColl_ = offColl; }
605 
606 
607  // Monitor methods
608 
609  void monitorL1(const int l1Index, FourVectorHLTOnline* fv);
610  void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv);
611  void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn);
612  void fillOnlineMatch(const int l1Index, FourVectorHLTOnline* fv);
613  void fillOnL1Match(const int l1Index, FourVectorHLTOnline* fv);
614 
615  void clearSets();
616 
617  bool isTriggerType(int t);
618  bool isL1TriggerType(int t);
619 
626 
627 
628  void setBJetsFlag(bool flag)
629  {
630  BJetsFlag_ = flag;
631  }
632 
633 
634 private:
635 
636  int pdgId_;
638 
639  float EtaMax_;
640  float EtMin_;
641 
642  float DRMatch_;
643 
646 
647  std::vector<int> triggerType_;
648  std::vector<int> l1triggerType_;
649 
651 
652  FourVectorHLTOnline::PathInfoCollection::iterator v_;
653 
654 };
655 
656 
657 template <class T>
659 {
660  bool rc = false;
661 
662  for(std::vector<int>::const_iterator it = triggerType_.begin(); it != triggerType_.end(); ++it)
663  {
664 
665  if(t == *it) { rc = true; break; }
666 
667  } // end for
668 
669  if (t==0) rc = true;
670 
671  return rc;
672 
673 }
674 
675 
676 template <class T>
678 {
679  bool rc = false;
680 
681  for(std::vector<int>::const_iterator it = l1triggerType_.begin(); it != l1triggerType_.end(); ++it)
682  {
683 
684  if(fabs(t) == fabs(*it)) { rc = true; break; }
685 
686  } // end for
687 
688  return rc;
689 
690 }
691 
692 
693 template <class T>
694 void objMonData<T>::monitorL1(const int l1Index, FourVectorHLTOnline* fv)
695 {
696 
697  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
698 
699  unsigned int NL1=0;
700  unsigned int NL1OffUM=0;
701 
702  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
703  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
704  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
705  bool l1accept = l1k.size() > 0;
706 
707  if(!l1accept) return;
708 
709  trigger::Vids::const_iterator idtypeiter = idtype.begin();
710 
711  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
712 
713  trigger::TriggerObject l1FV = toc[*l1ki];
714  if(isL1TriggerType(*idtypeiter))
715  {
716 
717 
718 
719  if (fabs(l1FV.eta()) <= EtaMax_ && l1FV.pt() >= EtMin_)
720  {
721 
722  NL1++;
723 
724  v_->getL1EtL1Histo()->Fill(l1FV.pt());
725  v_->getL1EtaVsL1PhiL1Histo()->Fill(l1FV.eta(), l1FV.phi());
726 
727  }
728  else {
729 
730  continue;
731 
732  }
733 
734  } // end if isL1TriggerType
735  ++idtypeiter;
736 
737  } // end for l1ki
738 
739  if(NL1 > 0) v_->getNL1Histo()->Fill(NL1);
740  if(NL1OffUM > 0) v_->getNL1OffUMHisto()->Fill(NL1OffUM);
741 
742 }
743 
744 
745 template <class T>
746 void objMonData<T>::monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline* fv)
747 {
748 
749  //if(! isTriggerType(v_->getObjectType()) ) return;
750 
751  // Get keys of objects passed by the last filter
752  const trigger::Keys & k = fv->fTriggerObj->filterKeys(hltIndex);
753 
754  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
755 
756  unsigned int NOn=0;
757 
758  // Loop over HLT objects
759  for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
760 
761  trigger::TriggerObject onlineFV = toc[*ki];
762 
763  if (fabs(onlineFV.eta()) <= EtaMax_ && onlineFV.pt() >= EtMin_)
764  {
765 
766  NOn++;
767 
768  v_->getOnEtOnHisto()->Fill(onlineFV.pt());
769  v_->getOnOneOverEtOnHisto()->Fill(1./onlineFV.pt());
770  v_->getOnEtaVsOnPhiOnHisto()->Fill(onlineFV.eta(), onlineFV.phi());
771 
772  }
773  else {
774 
775  return;
776 
777  }
778 
779  matchOnlineL1(onlineFV,l1Index, fv, NOn);
780 
781  } // end loop over HLT objects
782 
783  if(NOn>0) v_->getNOnHisto()->Fill(NOn);
784 
785 }
786 
787 template <class T>
788 void objMonData<T>::matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOnline* fv, const int& NOn)
789 {
790 
791  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
792 
793  unsigned int NOnL1UM=0;
794 
795  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
796  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
797  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
798 
799  fimmap OnL1DRMatchMap;
800  int j=0;
801  trigger::Vids::const_iterator idtypeiter = idtype.begin();
802  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki )
803  {
804 
805 
806 
807  if(isL1TriggerType(*idtypeiter))
808  {
809 
810  trigger::TriggerObject l1FV = toc[*l1ki];
811 
812  if ( fabs(l1FV.eta()) <= EtaMax_ && l1FV.pt() >= EtMin_ )
813  {
814 
815  // fill UM histos (no matching required)
816  if(NOn == 1) {
817 
818  NOnL1UM++;
819  v_->getL1EtL1OnUMHisto()->Fill(l1FV.pt());
820  v_->getL1EtaVsL1PhiL1OnUMHisto()->Fill(l1FV.eta(),l1FV.phi());
821 
822  }
823 
824 
825  float dR = reco::deltaR(l1FV.eta(),l1FV.phi(),onlineFV.eta(),onlineFV.phi());
826 
827  if ( dR < 1.0)
828  {
829 
830  OnL1DRMatchMap.insert(std::pair<float,int>(dR,j));
831 
832  }
833 
834  } // end if l1FV eta, pt
835 
836  } // end if isL1TriggerType
837 
838  ++idtypeiter;
839  j++;
840 
841  } // end for
842 
843  if(! OnL1DRMatchMap.empty()) OnL1DRMatchSet.insert(OnL1DRMatchMap);
844 
845 }
846 
847 template <class T>
849 {
850 
851  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
852  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
853 
854  unsigned int NOnL1=0;
855 
856  // clean the set On-L1
857  if(OnL1DRMatchSet.size() > 1) {
858 
859  LogDebug("FourVectorHLTOnline") << " Cleaning L1On mmset" << std::endl;
860  fv->cleanDRMatchSet(OnL1DRMatchSet);
861 
862  }
863  // now fill histos
864  for ( mmset::iterator setIter = OnL1DRMatchSet.begin( ); setIter != OnL1DRMatchSet.end( ); setIter++ )
865  {
866 
867  fimmap tempMap = *setIter;
868 
869  fimmap::iterator it = tempMap.begin();
870  int i = (*it).second ;
871  float dR = (*it).first;
872  v_->getL1DROnL1Histo()->Fill(dR);
873 
874  if (dR > DRMatch_) continue;
875 
876  trigger::Keys::const_iterator l1ki = l1k.begin();
877  for (int count = 0; count < i; count++) l1ki++;
878 
879  NOnL1++;
880  v_->getL1EtL1OnHisto()->Fill(toc[*l1ki].pt());
881  v_->getL1EtaVsL1PhiL1OnHisto()->Fill(toc[*l1ki].eta(),toc[*l1ki].phi());
882 
883  }
884 
885  v_->getNL1OnHisto()->Fill(NOnL1);
886 
887 }
888 
889 template <class T>
891 {
892 
893 
894  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
895  fillOnL1Match(l1Index, fv);
896 
897 }
898 
899 
900 template <class T>
902 {
903 
904  L1OffDRMatchSet.clear();
905  L1MCDRMatchSet.clear();
906  OnOffDRMatchSet.clear();
907  OnMCDRMatchSet.clear();
908  OnL1DRMatchSet.clear();
909  OffMCDRMatchSet.clear();
910 
911 }
912 
913 
914 
915 #endif
#define LogDebug(id)
type
Definition: HCALResponse.h:22
edm::Handle< trigger::TriggerEvent > fTriggerObj
PathInfoCollection hltPathsDiagonal_
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()
long int flag
Definition: mlp_lapack.h:47
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:60
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:59
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
PathInfoCollection hltPaths_
std::set< fimmap, std::less< fimmap > > mmset
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
MonitorElement * getOffEtaVsOffPhiL1OffUMHisto()
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
std::string pathsSummaryHLTPathsPerLSFolder_
MonitorElement * getOffEtaVsOffPhiOnOffUMHisto()
FourVectorHLTOnline::PathInfoCollection::iterator v_
void pushTriggerType(int trigType)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string pathsSummaryFilterEfficiencyFolder_
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
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:38
std::vector< MonitorElement * > v_ME_HLTAll_LS_
MonitorElement * ME_HLT_BX_
std::vector< std::vector< std::string > > triggerFilters_
MonitorElement * ME_HLT_CUSTOM_BX_
int k[5][pyjets_maxn]
bool etMin(const PFCandidate &cand, double cut)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
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
void setL1TriggerType(std::vector< int > trigType)
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:86
std::vector< std::pair< std::string, int > > fGroupL1TempCountPair
bool hasHLTPassed(const std::string &pathname, const edm::TriggerNames &triggerNames)
#define begin
Definition: vmac.h:31
FourVectorHLTOnline(const edm::ParameterSet &)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
int getTriggerTypeParsePathName(const std::string &pathname)
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)
void setTriggerType(std::vector< int > trigType)
MonitorElement * getL1EtaVsL1PhiL1OnHisto()
mathSSE::Vec4< T > v
std::vector< int > Vids
MonitorElement * getOffEtaVsOffPhiL1OffHisto()
std::string pathsSummaryHLTCorrelationsFolder_
Definition: Run.h:33
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
void setBJetsFlag(bool flag)