CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FourVectorHLTOffline.h
Go to the documentation of this file.
1 #ifndef FOURVECTORHLTOFFLINE_H
2 #define FOURVECTORHLTOFFLINE_H
3 // -*- C++ -*-
4 //
5 // Package: FourVectorHLTOffline
6 // Class: FourVectorHLTOffline
7 //
16 //
17 // Original Author: Jeffrey Berryhill
18 // Created: June 2008
19 // Rewritten by: Vladimir Rekovic
20 // Date: May 2009
21 //
22 // $Id: FourVectorHLTOffline.h,v 1.64 2010/10/26 04:55:28 wmtan Exp $
23 //
24 //
25 // system include files
26 #include <memory>
27 #include <unistd.h>
28 
29 
30 // user include files
33 
40 
46 
47 // added VR
53 
55 
61 
80 
83 
87 
88 /* MC
89 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
90 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
91 #include "DataFormats/JetReco/interface/GenJetCollection.h"
92 #include "DataFormats/METReco/interface/GenMETCollection.h"
93 #include "DataFormats/METReco/interface/GenMET.h"
94 */
97 
99 
100 
101 
102 #include <iostream>
103 #include <fstream>
104 #include <vector>
105 
106 namespace edm {
107  class TriggerNames;
108 }
109 
110 typedef std::multimap<float,int> fimmap ;
111 typedef std::set<fimmap , std::less<fimmap> > mmset;
112 
114 
115  public:
116  explicit FourVectorHLTOffline(const edm::ParameterSet&);
118 
119  void cleanDRMatchSet(mmset& tempSet);
120 
124 
125  private:
126  virtual void beginJob() ;
127  virtual void analyze(const edm::Event&, const edm::EventSetup&);
128  virtual void endJob() ;
129 
130  // BeginRun
131  void beginRun(const edm::Run& run, const edm::EventSetup& c);
132 
133  // EndRun
134  void endRun(const edm::Run& run, const edm::EventSetup& c);
135  void fillHltMatrix(const edm::TriggerNames & triggerNames);
136  void setupHltMatrix(const std::string& label, std::vector<std::string> & paths);
137 
138  void setupHltLsPlots();
139  void setupHltBxPlots();
140  void countHLTPathHitsEndLumiBlock(const int & lumi);
141  void countHLTGroupHitsEndLumiBlock(const int & lumi);
142  void countHLTGroupL1HitsEndLumiBlock(const int & lumi);
143  void countHLTGroupBXHitsEndLumiBlock(const int & lumi);
144  int getTriggerTypeParsePathName(const std::string & pathname);
145  const std::string getL1ConditionModuleName(const std::string & pathname);
146  bool hasL1Passed(const std::string & pathname, const edm::TriggerNames & triggerNames);
147  bool hasHLTPassed(const std::string & pathname, const edm::TriggerNames& triggerNames);
148  int getHltThresholdFromName(const std::string & pathname);
149 
150  void selectMuons(const edm::Handle<reco::MuonCollection> & muonHandle);
151  bool isVBTFMuon(const reco::Muon& muon);
152  void selectElectrons(const edm::Event& iEvent, const edm::EventSetup& iSetup, const edm::Handle<reco::GsfElectronCollection> & eleHandle);
153  void selectPhotons(const edm::Handle<reco::PhotonCollection> & phoHandle);
154  void selectJets(const edm::Event& iEvent,const edm::Handle<reco::CaloJetCollection> & jetHandle);
155  void selectMet(const edm::Handle<reco::CaloMETCollection> & metHandle);
156  void selectTaus(const edm::Event& iEvent);
157  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
158  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);
159 
160  // ----------member data ---------------------------
161  int nev_;
163  bool fLumiFlag;
164  bool fIsSetup;
165 
166  // JetID helper
168 
169  // Tau discriminators
170  std::string tauDscrmtrLabel1_;
171  std::string tauDscrmtrLabel2_;
172  std::string tauDscrmtrLabel3_;
173 
177  std::vector<MonitorElement*> v_ME_HLTAll_LS;
178  std::vector<MonitorElement*> v_ME_Total_BX;
179  std::vector<MonitorElement*> v_ME_Total_BX_Norm;
180 
181  std::string pathsSummaryFolder_;
188  std::string fCustomBXPath;
189 
190  std::vector<std::string> fGroupName;
191 
194 
197 
200 
203 
206 
207  //reco::CaloTauCollection * fSelectedTaus;
208  //edm::Handle<reco::CaloTauCollection> fSelTausHandle;
211 
212  unsigned int nLS_;
213  double LSsize_ ;
215  unsigned int referenceBX_;
216  unsigned int Nbx_;
217 
218  bool plotAll_;
221 
222  unsigned int nBins_;
223  unsigned int nBinsDR_;
224  unsigned int nBins2D_;
225  unsigned int nBinsOneOverEt_;
226  double ptMin_ ;
227  double ptMax_ ;
228  double dRMax_ ;
229 
234  double muonEtaMax_;
235  double muonEtMin_;
236  double muonDRMatch_;
238  double tauEtaMax_;
239  double tauEtMin_;
240  double tauDRMatch_;
242  double jetEtaMax_;
243  double jetEtMin_;
244  double jetDRMatch_;
246  double bjetEtaMax_;
247  double bjetEtMin_;
248  double bjetDRMatch_;
251  double photonEtMin_;
254  double trackEtaMax_;
255  double trackEtMin_;
258  double metEtaMax_;
259  double metMin_;
260  double metDRMatch_;
262  double htEtaMax_;
263  double htMin_;
264  double htDRMatch_;
265  double htL1DRMatch_;
266  double sumEtMin_;
267 
268  // Muon quality cuts
270  double dxyCut_;
277 
278  // Electron quality cuts
281  // Ecal Barrel
289  //spikes
291  // Ecal Endcap
299  //spikes
301 
302  // Jet quality cuts
305  float fHPDJet_;
306  int n90Jet_;
307 
308  std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
309 
310  std::vector <std::vector <std::string> > triggerFilters_;
311  std::vector <std::vector <uint> > triggerFilterIndices_;
312  std::vector <std::pair<std::string, float> > fPathTempCountPair;
313  std::vector <std::pair<std::string, std::vector<int> > > fPathBxTempCountPair;
314  std::vector <std::pair<std::string, float> > fGroupTempCountPair;
315  std::vector <std::pair<std::string, float> > fGroupL1TempCountPair;
316  std::vector <std::pair<std::string, std::vector<std::string> > > fGroupNamePathsPair;
317 
318  std::vector<std::string> specialPaths_;
319 
320  std::string dirname_;
321  std::string processname_;
329  // data across paths
331  // helper class to store the data path
332 
333  class PathInfo {
334 
336  pathIndex_(-1), denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), processName_("unset"), objectType_(-1) {};
337 
338  public:
339 
341  {
342  filters_ = filters;
343  }
344 
345  void setHistos(
346 
347  MonitorElement* const NOn,
348  MonitorElement* const onEtOn,
349  MonitorElement* const onOneOverEtOn,
350  MonitorElement* const onEtavsonPhiOn,
351  MonitorElement* const NOff,
352  MonitorElement* const offEtOff,
353  MonitorElement* const offEtavsoffPhiOff,
354  MonitorElement* const NL1,
355  MonitorElement* const l1EtL1,
356  MonitorElement* const l1Etavsl1PhiL1,
357  MonitorElement* const NL1On,
358  MonitorElement* const l1EtL1On,
359  MonitorElement* const l1Etavsl1PhiL1On,
360  MonitorElement* const NL1Off,
361  MonitorElement* const offEtL1Off,
362  MonitorElement* const offEtavsoffPhiL1Off,
363  MonitorElement* const NOnOff,
364  MonitorElement* const offEtOnOff,
365  MonitorElement* const offEtavsoffPhiOnOff,
366  MonitorElement* const NL1OnUM,
367  MonitorElement* const l1EtL1OnUM,
368  MonitorElement* const l1Etavsl1PhiL1OnUM,
369  MonitorElement* const NL1OffUM,
370  MonitorElement* const offEtL1OffUM,
371  MonitorElement* const offEtavsoffPhiL1OffUM,
372  MonitorElement* const NOnOffUM,
373  MonitorElement* const offEtOnOffUM,
374  MonitorElement* const offEtavsoffPhiOnOffUM,
375  MonitorElement* const offDRL1Off,
376  MonitorElement* const offDROnOff,
377  MonitorElement* const l1DRL1On)
378  {
379 
380  NOn_ = NOn;
381  onEtOn_ = onEtOn;
382  onOneOverEtOn_ = onOneOverEtOn;
383  onEtavsonPhiOn_ = onEtavsonPhiOn;
384  NOff_ = NOff;
385  offEtOff_ = offEtOff;
386  offEtavsoffPhiOff_ = offEtavsoffPhiOff;
387  NL1_ = NL1;
388  l1EtL1_ = l1EtL1;
389  l1Etavsl1PhiL1_ = l1Etavsl1PhiL1;
390  NL1On_ = NL1On;
391  l1EtL1On_ = l1EtL1On;
392  l1Etavsl1PhiL1On_ = l1Etavsl1PhiL1On;
393  NL1Off_ = NL1Off;
394  offEtL1Off_ = offEtL1Off;
395  offEtavsoffPhiL1Off_ = offEtavsoffPhiL1Off;
396  NOnOff_ = NOnOff;
397  offEtOnOff_ = offEtOnOff;
398  offEtavsoffPhiOnOff_ = offEtavsoffPhiOnOff;
399  NL1OnUM_ = NL1OnUM;
400  l1EtL1OnUM_ = l1EtL1OnUM;
401  l1Etavsl1PhiL1OnUM_ = l1Etavsl1PhiL1OnUM;
402  NL1OffUM_ = NL1OffUM;
403  offEtL1OffUM_ = offEtL1OffUM;
404  offEtavsoffPhiL1OffUM_ = offEtavsoffPhiL1OffUM;
405  NOnOffUM_ = NOnOffUM;
406  offEtOnOffUM_ = offEtOnOffUM;
407  offEtavsoffPhiOnOffUM_ = offEtavsoffPhiOnOffUM;
408  offDRL1Off_ = offDRL1Off;
409  offDROnOff_ = offDROnOff;
410  l1DRL1On_ = l1DRL1On;
411 
412  }
413 
415  return NOn_;
416  }
418  return onEtOn_;
419  }
421  return onOneOverEtOn_;
422  }
424  return onEtavsonPhiOn_;
425  }
427  return NOff_;
428  }
430  return offEtOff_;
431  }
433  return offEtavsoffPhiOff_;
434  }
436  return NL1_;
437  }
439  return l1EtL1_;
440  }
442  return l1Etavsl1PhiL1_;
443  }
445  return NL1On_;
446  }
448  return l1EtL1On_;
449  }
451  return l1Etavsl1PhiL1On_;
452  }
454  return NL1Off_;
455  }
457  return offEtL1Off_;
458  }
460  return offEtavsoffPhiL1Off_;
461  }
463  return NOnOff_;
464  }
466  return offEtOnOff_;
467  }
469  return offEtavsoffPhiOnOff_;
470  }
472  return NL1OnUM_;
473  }
475  return l1EtL1OnUM_;
476  }
478  return l1Etavsl1PhiL1OnUM_;
479  }
481  return NL1OffUM_;
482  }
484  return offEtL1OffUM_;
485  }
487  return offEtavsoffPhiL1OffUM_;
488  }
490  return NOnOffUM_;
491  }
493  return offEtOnOffUM_;
494  }
496  return offEtavsoffPhiOnOffUM_;
497  }
499  return offDRL1Off_;
500  }
502  return offDROnOff_;
503  }
505  return l1DRL1On_;
506  }
508  return filters_;
509  }
510  const std::string getLabel(void ) const {
511  return filterName_;
512  }
513  void setLabel(std::string labelName){
514  filterName_ = labelName;
515  return;
516  }
517  const std::string & getPath(void ) const {
518  return pathName_;
519  }
520  const std::string & getl1Path(void ) const {
521  return l1pathName_;
522  }
523  const int getL1ModuleIndex(void ) const {
524  return l1ModuleIndex_;
525  }
526  const std::string & getDenomPath(void ) const {
527  return denomPathName_;
528  }
529  const std::string & getProcess(void ) const {
530  return processName_;
531  }
532  const int getObjectType(void ) const {
533  return objectType_;
534  }
535 
536  const edm::InputTag getTag(void) const{
538  return tagName;
539  }
540 
541  ~PathInfo() {};
542 
543  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, int l1ModuleIndex, std::string filterName, std::string processName, size_t type, float ptmin, float ptmax, float hltThreshold, float l1Threshold):
544 
545  denomPathName_(denomPathName),
546  pathName_(pathName),
547  l1pathName_(l1pathName),
548  l1ModuleIndex_(l1ModuleIndex),
549  filterName_(filterName),
550  processName_(processName),
551  objectType_(type),
552  NOn_(0), onEtOn_(0), onOneOverEtOn_(0), onEtavsonPhiOn_(0),
554  NL1_(0), l1EtL1_(0), l1Etavsl1PhiL1_(0),
561  offDRL1Off_(0), offDROnOff_(0), l1DRL1On_(0), filters_(0),
562  ptmin_(ptmin), ptmax_(ptmax),
563  hltThreshold_(hltThreshold), l1Threshold_(l1Threshold)
564 
565  {
566  };
567 
568  PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type,
569  MonitorElement *NOn,
570  MonitorElement *onEtOn,
571  MonitorElement *onOneOverEtOn,
572  MonitorElement *onEtavsonPhiOn,
573  MonitorElement *NOff,
574  MonitorElement *offEtOff,
575  MonitorElement *offEtavsoffPhiOff,
576  MonitorElement *NL1,
577  MonitorElement *l1EtL1,
578  MonitorElement *l1Etavsl1PhiL1,
579  MonitorElement *NL1On,
580  MonitorElement *l1EtL1On,
581  MonitorElement *l1Etavsl1PhiL1On,
582  MonitorElement *NL1Off,
583  MonitorElement *offEtL1Off,
584  MonitorElement *offEtavsoffPhiL1Off,
585  MonitorElement *NOnOff,
586  MonitorElement *offEtOnOff,
587  MonitorElement *offEtavsoffPhiOnOff,
588  MonitorElement *NL1OnUM,
589  MonitorElement *l1EtL1OnUM,
590  MonitorElement *l1Etavsl1PhiL1OnUM,
591  MonitorElement *NL1OffUM,
592  MonitorElement *offEtL1OffUM,
593  MonitorElement *offEtavsoffPhiL1OffUM,
594  MonitorElement *NOnOffUM,
595  MonitorElement *offEtOnOffUM,
596  MonitorElement *offEtavsoffPhiOnOffUM,
597  MonitorElement *offDRL1Off,
598  MonitorElement *offDROnOff,
599  MonitorElement *l1DRL1On,
601  float ptmin, float ptmax
602  ):
603 
604  denomPathName_(denomPathName),
605  pathName_(pathName), l1pathName_(l1pathName),
606  filterName_(filterName), processName_(processName), objectType_(type),
607  NOn_(NOn), onEtOn_(onEtOn), onOneOverEtOn_(onOneOverEtOn), onEtavsonPhiOn_(onEtavsonPhiOn),
608  NOff_(NOff), offEtOff_(offEtOff), offEtavsoffPhiOff_(offEtavsoffPhiOff),
609  NL1_(NL1), l1EtL1_(l1EtL1), l1Etavsl1PhiL1_(l1Etavsl1PhiL1),
610  NL1On_(NL1On), l1EtL1On_(l1EtL1On), l1Etavsl1PhiL1On_(l1Etavsl1PhiL1On),
611  NL1Off_(NL1Off), offEtL1Off_(offEtL1Off), offEtavsoffPhiL1Off_(offEtavsoffPhiL1Off),
612  NOnOff_(NOnOff), offEtOnOff_(offEtOnOff), offEtavsoffPhiOnOff_(offEtavsoffPhiOnOff),
613  NL1OnUM_(NL1OnUM), l1EtL1OnUM_(l1EtL1OnUM), l1Etavsl1PhiL1OnUM_(l1Etavsl1PhiL1OnUM),
614  NL1OffUM_(NL1OffUM), offEtL1OffUM_(offEtL1OffUM), offEtavsoffPhiL1OffUM_(offEtavsoffPhiL1OffUM),
615  NOnOffUM_(NOnOffUM), offEtOnOffUM_(offEtOnOffUM), offEtavsoffPhiOnOffUM_(offEtavsoffPhiOnOffUM),
616  offDRL1Off_(offDRL1Off),
617  offDROnOff_(offDROnOff),
618  l1DRL1On_(l1DRL1On),
619  filters_(filters),
620  ptmin_(ptmin), ptmax_(ptmax)
621  {
622  };
623 
624  bool operator==(const std::string& v)
625  {
626  return v==filterName_;
627  }
628 
629  bool operator!=(const std::string& v)
630  {
631  return v!=filterName_;
632  }
633 
634  float getPtMin() const { return ptmin_; }
635  float getPtMax() const { return ptmax_; }
636  float getHltThreshold() const { return hltThreshold_; }
637  float getL1Threshold() const { return l1Threshold_; }
638 
639  std::vector< std::pair<std::string,unsigned int> > filtersAndIndices;
640 
641 
642  private:
643 
645  std::string denomPathName_;
646  std::string pathName_;
647  std::string l1pathName_;
649  std::string filterName_;
650  std::string processName_;
652 
653  // we don't own this data
665 
666  float ptmin_, ptmax_;
668 
669  const int index() {
670  return pathIndex_;
671  }
672  const int type() {
673  return objectType_;
674  }
675 
676 
677  };
678 
679 
680  public:
681 
682  // simple collection - just
683  class PathInfoCollection: public std::vector<PathInfo> {
684  public:
685 
686  PathInfoCollection(): std::vector<PathInfo>()
687  {};
688  std::vector<PathInfo>::iterator find(std::string pathName) {
689  return std::find(begin(), end(), pathName);
690  }
691  };
692 
694 
696 
697 };
698 
699 
700 class BaseMonitor
701 {
702  public:
703  virtual void clearSets( void ) = 0;
704  virtual void setPath(FourVectorHLTOffline::PathInfoCollection::iterator v) = 0;
705  virtual void monitorOffline( void ) = 0;
706  virtual void monitorL1( const int l1Index, FourVectorHLTOffline* fv) = 0;
707  virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOffline* fv) = 0;
708 
709  virtual void matchL1Offline(const trigger::TriggerObject& l1FV, FourVectorHLTOffline* fv, const int& NL1, unsigned int& NL1OffUM) = 0;
710  virtual void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOffline* fv, const int& NOn) = 0;
711  virtual void matchOnlineOffline(const trigger::TriggerObject& onlineFV, FourVectorHLTOffline* fv, const int& NOn) = 0;
712 
713  virtual void fillL1Match(FourVectorHLTOffline* fv) = 0;
714  virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOffline* fv) = 0;
715 
716  virtual bool isTriggerType(int t) = 0;
717  virtual ~BaseMonitor(){}
718 
719 };
720 
721 template <class T>
722 class objMonData:public BaseMonitor {
723 public:
724  objMonData() { EtaMax_= 2.5; EtMin_=3.0; GenJetsFlag_ = false; BJetsFlag_ = false; fL2MuFlag = false; }
725  void setLimits(float etaMax, float etMin, float drMatch, float l1drMatch, float dRRange, float thresholdFactor)
726  {
727  EtaMax_= etaMax;
728  EtMin_= etMin;
729  DRMatch_= drMatch;
730  L1DRMatch_= l1drMatch;
731  DRRange_ = dRRange;
732  thresholdFactor_ = thresholdFactor;
733  }
734  void setTriggerType(std::vector<int> trigType) { triggerType_ = trigType; }
735  void pushTriggerType(int trigType) { triggerType_.push_back(trigType); }
736  void setL1TriggerType(std::vector<int> trigType) { l1triggerType_ = trigType; }
737  void pushL1TriggerType(int trigType) { l1triggerType_.push_back(trigType); }
738  void setPath(FourVectorHLTOffline::PathInfoCollection::iterator v) { v_ = v; }
739  void setReco(edm::Handle<T> offColl) { offColl_ = offColl; }
741  void setRecoMu(edm::Handle<reco::MuonCollection> offCollMu) { offCollMu_ = offCollMu; }
743 
744 
745 
746  // Monitor methods
747 
748  void monitorOffline();
749  void monitorL1(const int l1Index, FourVectorHLTOffline* fv);
750  void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOffline* fv);
751  void matchL1Offline(const trigger::TriggerObject& l1FV, FourVectorHLTOffline* fv, const int& NL1, unsigned int& NL1OffUM);
752  void matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOffline* fv, const int& NOn);
753  void matchOnlineOffline(const trigger::TriggerObject& onlineFV, FourVectorHLTOffline* fv, const int& NOn);
754  void fillOnlineMatch(const int l1Index, FourVectorHLTOffline* fv);
756  void fillOnL1Match(const int l1Index, FourVectorHLTOffline* fv);
759 
760  void clearSets();
761 
762  bool isTriggerType(int t);
763  bool isL1TriggerType(int t);
764 
771 
772 
773  void setBJetsFlag(bool flag)
774  {
775  BJetsFlag_ = flag;
776  }
777  void setL2MuFlag(bool flag)
778  {
779  fL2MuFlag = flag;
780  }
781 
782 
783 private:
784 
785  int pdgId_;
786  int pdgStatus_;
787 
788  float EtaMax_;
789  float EtMin_;
790 
791  float DRMatch_;
792  float L1DRMatch_;
793  float DRRange_;
795 
796  bool GenJetsFlag_;
797  bool BJetsFlag_;
798  bool fL2MuFlag;
799 
800  std::vector<int> triggerType_;
801  std::vector<int> l1triggerType_;
802 
807 
808  FourVectorHLTOffline::PathInfoCollection::iterator v_;
809 
810 };
811 
812 
813 template <class T>
815 {
816  bool rc = false;
817 
818  for(std::vector<int>::const_iterator it = triggerType_.begin(); it != triggerType_.end(); ++it)
819  {
820 
821  if(t == *it) { rc = true; break; }
822 
823  } // end for
824 
825  if (t==0) rc = true;
826 
827  return rc;
828 
829 }
830 
831 
832 template <class T>
834 {
835  bool rc = false;
836 
837  for(std::vector<int>::const_iterator it = l1triggerType_.begin(); it != l1triggerType_.end(); ++it)
838  {
839 
840  if(fabs(t) == fabs(*it)) { rc = true; break; }
841 
842  } // end for
843 
844  return rc;
845 
846 }
847 
848 
849 
850 
851 template <class T>
853 {
854 
855  if(! isTriggerType(v_->getObjectType()) ) return;
856 
857  unsigned int NOff = 0;
858 
859  if( offCollB_.isValid()) {
860  typedef typename reco::JetTagCollection::const_iterator const_iterator;
861  for( const_iterator iter = offCollB_->begin(), iend = offCollB_->end(); iter != iend; ++iter )
862  {
863 
864  float recoEta = (*iter).first->eta();
865  float recoPhi = (*iter).first->phi();
866  float recoPt = (*iter).first->pt();
867 
868 
869  if (fabs(recoEta) <= EtaMax_ && recoPt >= EtMin_ )
870  {
871 
872  NOff++;
873  v_->getOffEtOffHisto()->Fill(recoPt);
874  if(recoPt >= thresholdFactor_*v_->getHltThreshold())
875  v_->getOffEtaVsOffPhiOffHisto()->Fill(recoEta, recoPhi);
876 
877  }
878  /*
879  else {
880 
881  continue;
882 
883  }
884  */
885 
886  }
887 
888  }
889  else if(offCollEle_.isValid()) {
890 
891  typedef typename reco::GsfElectronCollection::const_iterator const_iterator;
892  for( const_iterator iter = offCollEle_->begin(), iend = offCollEle_->end(); iter != iend; ++iter )
893  {
894 
895  if (fabs(iter->eta()) <= EtaMax_ && iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()) >= EtMin_ )
896  {
897 
898  NOff++;
899  v_->getOffEtOffHisto()->Fill(iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()));
900 
901  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
902  v_->getOffEtaVsOffPhiOffHisto()->Fill(iter->eta(), iter->phi());
903 
904  }
905  /*
906  else {
907 
908  continue;
909 
910  }
911  */
912 
913  }
914 
915  } // end else if
916  else if(offColl_.isValid()) {
917 
918  typedef typename T::const_iterator const_iterator;
919  for( const_iterator iter = offColl_->begin(), iend = offColl_->end(); iter != iend; ++iter )
920  {
921 
922  if (fabs(iter->eta()) <= EtaMax_ && iter->pt() >= EtMin_ )
923  {
924 
925  NOff++;
926  v_->getOffEtOffHisto()->Fill(iter->pt());
927 
928  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
929  v_->getOffEtaVsOffPhiOffHisto()->Fill(iter->eta(), iter->phi());
930 
931  }
932  /*
933  else {
934 
935  continue;
936 
937  }
938  */
939 
940  }
941 
942  } // end else if
943 
944  if(NOff>0)v_->getNOffHisto()->Fill(NOff);
945 
946 }
947 
948 
949 template <class T>
950 void objMonData<T>::monitorL1(const int l1Index, FourVectorHLTOffline* fv)
951 {
952 
953  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
954 
955  unsigned int NL1=0;
956  unsigned int NL1OffUM=0;
957 
958  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
959  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
960  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
961  bool l1accept = l1k.size() > 0;
962 
963  if(!l1accept) return;
964 
965  trigger::Vids::const_iterator idtypeiter = idtype.begin();
966 
967  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki ) {
968 
969  trigger::TriggerObject l1FV = toc[*l1ki];
970 
971  if(isL1TriggerType(*idtypeiter))
972  {
973 
974  NL1++;
975 
976  v_->getL1EtL1Histo()->Fill(l1FV.pt());
977  v_->getL1EtaVsL1PhiL1Histo()->Fill(l1FV.eta(), l1FV.phi());
978 
979  matchL1Offline(l1FV, fv, NL1, NL1OffUM);
980 
981  } // end if isL1TriggerType
982 
983  ++idtypeiter;
984 
985  } // end for l1ki
986 
987  if(NL1 > 0) v_->getNL1Histo()->Fill(NL1);
988  if(NL1OffUM > 0) v_->getNL1OffUMHisto()->Fill(NL1OffUM);
989 
990 }
991 
992 
993 template <class T>
994 void objMonData<T>::matchL1Offline(const trigger::TriggerObject& l1FV, FourVectorHLTOffline* fv, const int& NL1, unsigned int& NL1OffUM)
995 {
996 
997  fimmap L1OffDRMatchMap;
998 
999  if (offCollB_.isValid()) {
1000 
1001  int j=0;
1002  typedef typename reco::JetTagCollection::const_iterator const_iterator;
1003  for( const_iterator iter = offCollB_->begin(), iend = offCollB_->end(); iter != iend; ++iter )
1004  {
1005 
1006  float recoEta = (*iter).first->eta();
1007  float recoPhi = (*iter).first->phi();
1008  float recoPt = (*iter).first->pt();
1009 
1010  if (fabs(recoEta) <= EtaMax_ && recoPt >= EtMin_ )
1011  {
1012 
1013  // fill UM histos (no matching required)
1014  if(NL1 == 1) {
1015 
1016  NL1OffUM++;
1017  v_->getOffEtL1OffUMHisto()->Fill(recoPt);
1018 
1019  if(recoPt >= thresholdFactor_*v_->getHltThreshold())
1020  v_->getOffEtaVsOffPhiL1OffUMHisto()->Fill(recoEta,recoPhi);
1021 
1022  }
1023 
1024  // make maps of matched objects
1025  float dR = reco::deltaR(recoEta,recoPhi,l1FV.eta(),l1FV.phi());
1026  if ( dR < DRRange_)
1027  {
1028 
1029  L1OffDRMatchMap.insert(std::pair<float,int>(dR,j));
1030 
1031  }
1032 
1033  }
1034 
1035  j++;
1036 
1037  }
1038 
1039  }
1040  else if (offCollMu_.isValid()) {
1041 
1042  int j=0;
1043  typedef typename reco::MuonCollection::const_iterator const_iterator;
1044  for( const_iterator iter = offCollMu_->begin(), iend = offCollMu_->end(); iter != iend; ++iter )
1045  {
1046 
1047  // get Eta, Phi of the MuonDetectorTrack,
1048  // looking at the detector most inner Position
1049  // This should be close to what L1 sees
1050  float recoEta = iter->outerTrack()->innerPosition().eta();
1051  float recoPhi = iter->outerTrack()->innerPosition().phi();
1052  float recoPt = iter->pt();
1053 
1054  if (fabs(recoEta) <= EtaMax_ && recoPt >= EtMin_ )
1055  {
1056 
1057  // fill UM histos (no matching required)
1058  if(NL1 == 1) {
1059 
1060  NL1OffUM++;
1061  v_->getOffEtL1OffUMHisto()->Fill(recoPt);
1062 
1063  if(recoPt >= thresholdFactor_*v_->getHltThreshold())
1064  v_->getOffEtaVsOffPhiL1OffUMHisto()->Fill(recoEta,recoPhi);
1065 
1066  }
1067 
1068  // make maps of matched objects
1069  float dR = reco::deltaR(recoEta,recoPhi,l1FV.eta(),l1FV.phi());
1070  if ( dR < DRRange_)
1071  {
1072 
1073  L1OffDRMatchMap.insert(std::pair<float,int>(dR,j));
1074 
1075  }
1076 
1077  }
1078 
1079  j++;
1080 
1081  }
1082 
1083  }
1084  else if (offCollEle_.isValid()) {
1085 
1086  int j=0;
1087  typedef typename reco::GsfElectronCollection::const_iterator const_iterator;
1088  for( const_iterator iter = offCollEle_->begin(), iend = offCollEle_->end(); iter != iend; ++iter )
1089  {
1090 
1091  if (fabs(iter->eta()) <= EtaMax_ && iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()) >= EtMin_ )
1092  {
1093 
1094  // fill UM histos (no matching required)
1095  if(NL1 == 1) {
1096 
1097  NL1OffUM++;
1098  v_->getOffEtL1OffUMHisto()->Fill(iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()));
1099 
1100  if(iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()) >= thresholdFactor_*v_->getHltThreshold())
1101  v_->getOffEtaVsOffPhiL1OffUMHisto()->Fill(iter->eta(),iter->phi());
1102 
1103  }
1104 
1105  // make maps of matched objects
1106  float dR = reco::deltaR(iter->eta(),iter->phi(),l1FV.eta(),l1FV.phi());
1107  if ( dR < DRRange_)
1108  {
1109 
1110  L1OffDRMatchMap.insert(std::pair<float,int>(dR,j));
1111 
1112  }
1113 
1114  }
1115 
1116  j++;
1117 
1118  }
1119 
1120  }
1121  else if (offColl_.isValid()) {
1122 
1123  int j=0;
1124  typedef typename T::const_iterator const_iterator;
1125  for( const_iterator iter = offColl_->begin(), iend = offColl_->end(); iter != iend; ++iter )
1126  {
1127 
1128  if (fabs(iter->eta()) <= EtaMax_ && iter->pt() >= EtMin_ )
1129  {
1130 
1131  // fill UM histos (no matching required)
1132  if(NL1 == 1) {
1133 
1134  NL1OffUM++;
1135  v_->getOffEtL1OffUMHisto()->Fill(iter->pt());
1136 
1137  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
1138  v_->getOffEtaVsOffPhiL1OffUMHisto()->Fill(iter->eta(),iter->phi());
1139 
1140  }
1141 
1142  // make maps of matched objects
1143  float dR = reco::deltaR(iter->eta(),iter->phi(),l1FV.eta(),l1FV.phi());
1144  if ( dR < DRRange_)
1145  {
1146 
1147  L1OffDRMatchMap.insert(std::pair<float,int>(dR,j));
1148 
1149  }
1150 
1151  }
1152 
1153  j++;
1154 
1155  }
1156 
1157  }
1158  if(! L1OffDRMatchMap.empty()) L1OffDRMatchSet.insert(L1OffDRMatchMap);
1159 
1160 }
1161 
1162 
1163 template <class T>
1164 void objMonData<T>::monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOffline* fv)
1165 {
1166 
1167  if(! isTriggerType(v_->getObjectType()) ) return;
1168 
1169  // Get keys of objects passed by the last filter
1170  const trigger::Keys & k = fv->fTriggerObj->filterKeys(hltIndex);
1171 
1172  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
1173 
1174  unsigned int NOn=0;
1175 
1176  // Loop over HLT objects
1177  for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
1178 
1179  trigger::TriggerObject onlineFV = toc[*ki];
1180 
1181  NOn++;
1182 
1183  v_->getOnEtOnHisto()->Fill(onlineFV.pt());
1184  v_->getOnOneOverEtOnHisto()->Fill(1./onlineFV.pt());
1185  v_->getOnEtaVsOnPhiOnHisto()->Fill(onlineFV.eta(), onlineFV.phi());
1186 
1187  matchOnlineL1(onlineFV,l1Index, fv, NOn);
1188  matchOnlineOffline(onlineFV,fv, NOn);
1189 
1190  } // end loop over HLT objects
1191 
1192  if(NOn>0) v_->getNOnHisto()->Fill(NOn);
1193 
1194 }
1195 
1196 template <class T>
1197 void objMonData<T>::matchOnlineL1(const trigger::TriggerObject& onlineFV, const int& l1Index, FourVectorHLTOffline* fv, const int& NOn)
1198 {
1199 
1200  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
1201 
1202  unsigned int NOnL1UM=0;
1203 
1204  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
1205  const trigger::Vids & idtype = fv->fTriggerObj->filterIds(l1Index);
1206  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
1207 
1208  fimmap OnL1DRMatchMap;
1209  int j=0;
1210  trigger::Vids::const_iterator idtypeiter = idtype.begin();
1211  for (trigger::Keys::const_iterator l1ki = l1k.begin(); l1ki !=l1k.end(); ++l1ki )
1212  {
1213 
1214  if(isL1TriggerType(*idtypeiter))
1215  {
1216 
1217  trigger::TriggerObject l1FV = toc[*l1ki];
1218 
1219  // fill UM histos (no matching required)
1220  if(NOn == 1) {
1221 
1222  NOnL1UM++;
1223  v_->getL1EtL1OnUMHisto()->Fill(l1FV.pt());
1224  v_->getL1EtaVsL1PhiL1OnUMHisto()->Fill(l1FV.eta(),l1FV.phi());
1225 
1226  }
1227 
1228 
1229  float dR = reco::deltaR(l1FV.eta(),l1FV.phi(),onlineFV.eta(),onlineFV.phi());
1230 
1231  if ( dR < DRRange_)
1232  {
1233 
1234  OnL1DRMatchMap.insert(std::pair<float,int>(dR,j));
1235 
1236  }
1237 
1238  } // end if isL1TriggerType
1239 
1240  ++idtypeiter;
1241  j++;
1242 
1243  } // end for
1244 
1245  if(! OnL1DRMatchMap.empty()) OnL1DRMatchSet.insert(OnL1DRMatchMap);
1246 
1247 }
1248 
1249 
1250 template <class T>
1252 {
1253 
1254  unsigned int NOnOffUM=0;
1255 
1256  fimmap OnOffDRMatchMap;
1257 
1258  if (offCollB_.isValid()) {
1259 
1260  int j=0;
1261  typedef typename reco::JetTagCollection::const_iterator const_iterator;
1262  for( const_iterator iter = offCollB_->begin(), iend = offCollB_->end(); iter != iend; ++iter )
1263  {
1264 
1265  float recoEta = (*iter).first->eta();
1266  float recoPhi = (*iter).first->phi();
1267  float recoPt = (*iter).first->pt();
1268 
1269  if (fabs(recoEta) <= EtaMax_ && recoPt >= EtMin_ )
1270  {
1271 
1272  // fill UM histos (no matching required)
1273  if(NOn == 1) {
1274 
1275  NOnOffUM++;
1276  v_->getOffEtOnOffUMHisto()->Fill(recoPt);
1277 
1278  if(recoPt >= thresholdFactor_*v_->getHltThreshold())
1279  v_->getOffEtaVsOffPhiOnOffUMHisto()->Fill(recoEta,recoPhi);
1280 
1281  }
1282 
1283  // make maps of matched objects
1284  float dR = reco::deltaR(recoEta,recoPhi,onlineFV.eta(),onlineFV.phi());
1285  if ( dR < DRRange_)
1286  {
1287 
1288  OnOffDRMatchMap.insert(std::pair<float,int>(dR,j));
1289 
1290  }
1291 
1292  }
1293 
1294  j++;
1295 
1296  }
1297 
1298  }
1299  else if (offCollMu_.isValid() && fL2MuFlag) {
1300 
1301  int j=0;
1302  typedef typename reco::MuonCollection::const_iterator const_iterator;
1303  for( const_iterator iter = offCollMu_->begin(), iend = offCollMu_->end(); iter != iend; ++iter )
1304  {
1305 
1306  // get Eta, Phi of the MuonDetectorTrack,
1307  // looking at the detector most inner Position
1308  // This should be close to what L1 sees
1309  float recoEta = iter->outerTrack()->innerPosition().eta();
1310  float recoPhi = iter->outerTrack()->innerPosition().phi();
1311  float recoPt = iter->pt();
1312 
1313  if (fabs(recoEta) <= EtaMax_ && recoPt >= EtMin_ )
1314  {
1315  // fill UM histos (no matching required)
1316  if(NOn == 1) {
1317 
1318  NOnOffUM++;
1319  v_->getOffEtOnOffUMHisto()->Fill(iter->pt());
1320 
1321  if(recoPt >= thresholdFactor_*v_->getHltThreshold())
1322  v_->getOffEtaVsOffPhiOnOffUMHisto()->Fill(iter->eta(),iter->phi());
1323 
1324  }
1325 
1326  // make maps of matched objects
1327  float dR = reco::deltaR(recoEta,recoPhi,onlineFV.eta(),onlineFV.phi());
1328  if ( dR < DRRange_)
1329  {
1330 
1331  OnOffDRMatchMap.insert(std::pair<float,int>(dR,j));
1332 
1333  }
1334 
1335  }
1336 
1337  j++;
1338 
1339 
1340  }
1341 
1342  }
1343  else if (offCollEle_.isValid()) {
1344 
1345  int j=0;
1346 
1347  typedef typename reco::GsfElectronCollection::const_iterator const_iterator;
1348  for( const_iterator iter = offCollEle_->begin(), iend = offCollEle_->end(); iter != iend; ++iter )
1349  {
1350 
1351  if (fabs(iter->eta()) <= EtaMax_ && iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()) >= EtMin_ )
1352  {
1353 
1354  // fill UM histos (no matching required)
1355  if(NOn == 1) {
1356 
1357  NOnOffUM++;
1358  v_->getOffEtOnOffUMHisto()->Fill(iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()));
1359 
1360  if(iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()) >= thresholdFactor_*v_->getHltThreshold())
1361  v_->getOffEtaVsOffPhiOnOffUMHisto()->Fill(iter->eta(),iter->phi());
1362 
1363  }
1364 
1365  // make maps of matched objects
1366  float dR = reco::deltaR(iter->eta(),iter->phi(),onlineFV.eta(),onlineFV.phi());
1367  if ( dR < DRRange_)
1368  {
1369 
1370  OnOffDRMatchMap.insert(std::pair<float,int>(dR,j));
1371 
1372  }
1373 
1374  }
1375 
1376  j++;
1377 
1378 
1379  }
1380 
1381  }
1382  else if (offColl_.isValid()) {
1383 
1384  int j=0;
1385 
1386  typedef typename T::const_iterator const_iterator;
1387  for( const_iterator iter = offColl_->begin(), iend = offColl_->end(); iter != iend; ++iter )
1388  {
1389 
1390  if (fabs(iter->eta()) <= EtaMax_ && iter->pt() >= EtMin_ )
1391  {
1392 
1393  // fill UM histos (no matching required)
1394  if(NOn == 1) {
1395 
1396  NOnOffUM++;
1397  v_->getOffEtOnOffUMHisto()->Fill(iter->pt());
1398 
1399  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
1400  v_->getOffEtaVsOffPhiOnOffUMHisto()->Fill(iter->eta(),iter->phi());
1401 
1402  }
1403 
1404  // make maps of matched objects
1405  float dR = reco::deltaR(iter->eta(),iter->phi(),onlineFV.eta(),onlineFV.phi());
1406  if ( dR < DRRange_)
1407  {
1408 
1409  OnOffDRMatchMap.insert(std::pair<float,int>(dR,j));
1410 
1411  }
1412 
1413  }
1414 
1415  j++;
1416 
1417 
1418  }
1419 
1420  }
1421 
1422  if(! OnOffDRMatchMap.empty()) OnOffDRMatchSet.insert(OnOffDRMatchMap);
1423 
1424 }
1425 
1426 template <class T>
1428 {
1429 
1430  float NL1Off=0;
1431 
1432  if(L1OffDRMatchSet.size() > 1) {
1433 
1434  LogDebug("FourVectorHLTOffline") << " Cleaning L1Off mmset" << std::endl;
1435  fv->cleanDRMatchSet(L1OffDRMatchSet);
1436 
1437  }
1438  // clean the set L1-Off
1439  // now fill histos
1440  for ( mmset::iterator setIter = L1OffDRMatchSet.begin( ); setIter != L1OffDRMatchSet.end( ); setIter++ )
1441  {
1442 
1443  fimmap tempMap = *setIter;
1444 
1445  fimmap::iterator it = tempMap.begin();
1446  int i = (*it).second ;
1447  float dR = (*it).first;
1448  v_->getOffDRL1OffHisto()->Fill(dR);
1449 
1450  if (dR > L1DRMatch_) continue;
1451  if( offCollB_.isValid()) {
1452 
1453  typedef typename reco::JetTagCollection::const_iterator const_iterator;
1454  const_iterator iter = offCollB_->begin();
1455  for (int count = 0; count < i; count++) iter++;
1456 
1457 
1458  NL1Off++;
1459  v_->getOffEtL1OffHisto()->Fill((*iter).first->pt());
1460  if((*iter).first->pt() >= thresholdFactor_*v_->getHltThreshold())
1461  v_->getOffEtaVsOffPhiL1OffHisto()->Fill((*iter).first->eta(),(*iter).first->phi());
1462 
1463 
1464  }
1465  else if( offCollMu_.isValid()) {
1466 
1467  typedef typename reco::MuonCollection::const_iterator const_iterator;
1468  const_iterator iter = offCollMu_->begin();
1469  for (int count = 0; count < i; count++) iter++;
1470 
1471 
1472  NL1Off++;
1473  v_->getOffEtL1OffHisto()->Fill(iter->pt());
1474  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
1475  v_->getOffEtaVsOffPhiL1OffHisto()->Fill(iter->outerTrack()->innerPosition().eta(),iter->outerTrack()->innerPosition().phi());
1476 
1477  }
1478  else if( offCollEle_.isValid()) {
1479 
1480  typedef typename reco::GsfElectronCollection::const_iterator const_iterator;
1481  const_iterator iter = offCollEle_->begin();
1482  for (int count = 0; count < i; count++) iter++;
1483 
1484 
1485  NL1Off++;
1486  v_->getOffEtL1OffHisto()->Fill(iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()));
1487  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
1488  v_->getOffEtaVsOffPhiL1OffHisto()->Fill(iter->eta(),iter->phi());
1489 
1490  }
1491  else if( offColl_.isValid()) {
1492 
1493  typedef typename T::const_iterator const_iterator;
1494  const_iterator iter = offColl_->begin();
1495  for (int count = 0; count < i; count++) iter++;
1496 
1497 
1498  NL1Off++;
1499  v_->getOffEtL1OffHisto()->Fill(iter->pt());
1500  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
1501  v_->getOffEtaVsOffPhiL1OffHisto()->Fill(iter->eta(),iter->phi());
1502 
1503  }
1504 
1505  }
1506 
1507  if(NL1Off > 0) v_->getNL1OffHisto()->Fill(NL1Off);
1508 
1509 }
1510 
1511 
1512 template <class T>
1514 {
1515 
1516  unsigned int NOnOff=0;
1517 
1518  // clean the set L1-Off
1519  if(OnOffDRMatchSet.size() > 1){
1520 
1521  LogDebug("FourVectorHLTOffline") << " Cleaning OnOff mmset" << std::endl;
1522  fv->cleanDRMatchSet(OnOffDRMatchSet);
1523 
1524  }
1525  // now fill histos
1526  for ( mmset::iterator setIter = OnOffDRMatchSet.begin( ); setIter != OnOffDRMatchSet.end( ); setIter++ )
1527  {
1528 
1529 
1530  fimmap tempMap = *setIter;
1531 
1532  fimmap::iterator it = tempMap.begin();
1533  int i = (*it).second ;
1534  float dR = (*it).first;
1535  v_->getOffDROnOffHisto()->Fill(dR);
1536 
1537 
1538  if (dR > DRMatch_) continue;
1539 
1540  if( offCollB_.isValid()) {
1541 
1542 
1543  typedef typename reco::JetTagCollection::const_iterator const_iterator;
1544  const_iterator iter = offCollB_->begin();
1545  for (int count = 0; count < i; count++) iter++;
1546 
1547 
1548  NOnOff++;
1549  v_->getOffEtOnOffHisto()->Fill((*iter).first->pt());
1550  if((*iter).first->pt() >= thresholdFactor_*v_->getHltThreshold())
1551  v_->getOffEtaVsOffPhiOnOffHisto()->Fill((*iter).first->eta(),(*iter).first->phi());
1552 
1553  }
1554  else if( offCollMu_.isValid() && fL2MuFlag) {
1555 
1556  typedef typename reco::MuonCollection::const_iterator const_iterator;
1557  const_iterator iter = offCollMu_->begin();
1558  for (int count = 0; count < i; count++) iter++;
1559 
1560 
1561  NOnOff++;
1562  v_->getOffEtOnOffHisto()->Fill(iter->pt());
1563  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
1564  v_->getOffEtaVsOffPhiOnOffHisto()->Fill(iter->outerTrack()->innerPosition().eta(),iter->outerTrack()->innerPosition().phi());
1565 
1566  }
1567  else if( offCollEle_.isValid()) {
1568 
1569  typedef typename reco::GsfElectronCollection::const_iterator const_iterator;
1570  const_iterator iter = offCollEle_->begin();
1571  for (int count = 0; count < i; count++) iter++;
1572 
1573  NOnOff++;
1574  v_->getOffEtOnOffHisto()->Fill(iter->superCluster()->energy()*sin(iter->superCluster()->position().Theta()));
1575  if(iter->superCluster()->energy()*fabs(sin(iter->superCluster()->position().Theta())) >= thresholdFactor_*v_->getHltThreshold())
1576  v_->getOffEtaVsOffPhiOnOffHisto()->Fill(iter->eta(),iter->phi());
1577 
1578  }
1579  else if( offColl_.isValid()) {
1580 
1581  typedef typename T::const_iterator const_iterator;
1582  const_iterator iter = offColl_->begin();
1583  for (int count = 0; count < i; count++) iter++;
1584 
1585  NOnOff++;
1586  v_->getOffEtOnOffHisto()->Fill(iter->pt());
1587  if(iter->pt() >= thresholdFactor_*v_->getHltThreshold())
1588  v_->getOffEtaVsOffPhiOnOffHisto()->Fill(iter->eta(),iter->phi());
1589 
1590  }
1591 
1592  }
1593 
1594  v_->getNOnOffHisto()->Fill(NOnOff);
1595 
1596 }
1597 
1598 
1599 template <class T>
1601 {
1602 
1603  const trigger::TriggerObjectCollection & toc(fv->fTriggerObj->getObjects());
1604  const trigger::Keys & l1k = fv->fTriggerObj->filterKeys(l1Index);
1605 
1606  unsigned int NOnL1=0;
1607 
1608  // clean the set On-L1
1609  if(OnL1DRMatchSet.size() > 1) {
1610 
1611  LogDebug("FourVectorHLTOffline") << " Cleaning L1On mmset" << std::endl;
1612  fv->cleanDRMatchSet(OnL1DRMatchSet);
1613 
1614  }
1615  // now fill histos
1616  for ( mmset::iterator setIter = OnL1DRMatchSet.begin( ); setIter != OnL1DRMatchSet.end( ); setIter++ )
1617  {
1618 
1619  fimmap tempMap = *setIter;
1620 
1621  fimmap::iterator it = tempMap.begin();
1622  int i = (*it).second ;
1623  float dR = (*it).first;
1624  v_->getL1DROnL1Histo()->Fill(dR);
1625 
1626  if (dR > L1DRMatch_) continue;
1627 
1628  trigger::Keys::const_iterator l1ki = l1k.begin();
1629  for (int count = 0; count < i; count++) l1ki++;
1630 
1631  NOnL1++;
1632  v_->getL1EtL1OnHisto()->Fill(toc[*l1ki].pt());
1633  v_->getL1EtaVsL1PhiL1OnHisto()->Fill(toc[*l1ki].eta(),toc[*l1ki].phi());
1634 
1635  }
1636 
1637  v_->getNL1OnHisto()->Fill(NOnL1);
1638 
1639 }
1640 
1641 template <class T>
1643 {
1644 
1645  if(! isTriggerType(v_->getObjectType()) ) return;
1646  fillOnOffMatch(fv);
1647 
1648  if ( l1Index >= fv->fTriggerObj->sizeFilters() ) return;
1649  fillOnL1Match(l1Index, fv);
1650 
1651 }
1652 
1653 template <class T>
1655 {
1656 
1657  fillL1OffMatch(fv);
1658 
1659 }
1660 
1661 template <class T>
1663 {
1664 
1665  L1OffDRMatchSet.clear();
1666  L1MCDRMatchSet.clear();
1667  OnOffDRMatchSet.clear();
1668  OnMCDRMatchSet.clear();
1669  OnL1DRMatchSet.clear();
1670  OffMCDRMatchSet.clear();
1671 
1672 }
1673 
1674 
1675 
1676 #endif
#define LogDebug(id)
MonitorElement * getL1EtaVsL1PhiL1OnUMHisto()
void setupHltMatrix(const std::string &label, std::vector< std::string > &paths)
reco::helper::JetIDHelper * jetID
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
edm::Handle< T > offColl_
bool hasL1Passed(const std::string &pathname, const edm::TriggerNames &triggerNames)
virtual void fillL1Match(FourVectorHLTOffline *fv)=0
long int flag
Definition: mlp_lapack.h:47
void selectPhotons(const edm::Handle< reco::PhotonCollection > &phoHandle)
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
virtual ~BaseMonitor()
void countHLTPathHitsEndLumiBlock(const int &lumi)
virtual void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline *fv)=0
void countHLTGroupBXHitsEndLumiBlock(const int &lumi)
edm::Handle< reco::GsfElectronCollection > fSelElectronsHandle
edm::Handle< reco::CaloMETCollection > fSelMetHandle
FourVectorHLTOffline::PathInfoCollection::iterator v_
const std::string & label
Definition: MVAComputer.cc:186
virtual void fillOnlineMatch(const int l1Index, FourVectorHLTOnline *fv)=0
transient_vector_type::const_iterator const_iterator
std::vector< std::vector< uint > > triggerFilterIndices_
bool isL1TriggerType(int t)
MonitorElement * getL1EtaVsL1PhiL1OnHisto()
reco::CaloMETCollection * fSelectedMet
PathInfoCollection hltPaths_
MonitorElement * getOffEtaVsOffPhiL1OffUMHisto()
bool isTriggerType(int t)
float phi() const
Definition: TriggerObject.h:60
reco::PFTauCollection * fSelectedTaus
std::vector< PathInfo >::iterator find(std::string pathName)
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
std::string pathsSummaryFilterEfficiencyFolder_
void setRecoMu(edm::Handle< reco::MuonCollection > offCollMu)
tuple lumi
Definition: fjr2json.py:41
std::string pathsSummaryHLTPathsPerLSFolder_
int getTriggerTypeParsePathName(const std::string &pathname)
void fillHltMatrix(const edm::TriggerNames &triggerNames)
std::vector< std::pair< std::string, std::vector< int > > > fPathBxTempCountPair
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< std::string > specialPaths_
void matchOnlineL1(const trigger::TriggerObject &onlineFV, const int &l1Index, FourVectorHLTOnline *fv, const int &NOn)
FourVectorHLTOffline(const edm::ParameterSet &)
std::vector< int > l1triggerType_
void cleanDRMatchSet(mmset &tempSet)
Clean DR Match Set.
std::multimap< float, int > fimmap
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)
std::vector< int > triggerType_
edm::Handle< reco::MuonCollection > fSelMuonsHandle
edm::Handle< reco::GsfElectronCollection > offCollEle_
float eta() const
Definition: TriggerObject.h:59
edm::Handle< reco::BeamSpot > fBeamSpotHandle
bool operator!=(const std::string &v)
virtual void monitorOffline(void)=0
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
edm::Handle< reco::PFTauCollection > fSelTausHandle
void fillOnlineMatch(const int l1Index, FourVectorHLTOnline *fv)
edm::Handle< reco::JetTagCollection > offCollB_
virtual void matchOnlineOffline(const trigger::TriggerObject &onlineFV, FourVectorHLTOffline *fv, const int &NOn)=0
const std::string & getPath(void) const
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
T eta() const
const edm::InputTag getTag(void) const
std::vector< TPRegexp > filters
Definition: eve_filter.cc:25
edm::InputTag triggerSummaryLabel_
void countHLTGroupL1HitsEndLumiBlock(const int &lumi)
void setRecoB(edm::Handle< reco::JetTagCollection > offCollB)
virtual bool isTriggerType(int t)=0
PathInfoCollection hltPathsDiagonal_
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
void setPath(FourVectorHLTOffline::PathInfoCollection::iterator v)
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
std::set< fimmap, std::less< fimmap > > mmset
edm::Handle< reco::PhotonCollection > fSelPhotonsHandle
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
reco::GsfElectronCollection * fSelectedElectrons
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
const std::string * pathName() const
Definition: HLTadd.h:31
const int getL1ModuleIndex(void) const
MonitorElement * getOffEtaVsOffPhiOffHisto()
FourVectorHLTOnline::PathInfoCollection::iterator v_
void matchOnlineOffline(const trigger::TriggerObject &onlineFV, FourVectorHLTOffline *fv, const int &NOn)
const std::string getL1ConditionModuleName(const std::string &pathname)
int iEvent
Definition: GenABIO.cc:243
void pushTriggerType(int trigType)
void monitorOnline(const int hltIndex, const int l1Index, FourVectorHLTOnline *fv)
edm::Handle< edm::TriggerResults > fTriggerResults
void selectJets(const edm::Event &iEvent, const edm::Handle< reco::CaloJetCollection > &jetHandle)
std::vector< MonitorElement * > v_ME_Total_BX
void matchL1Offline(const trigger::TriggerObject &l1FV, FourVectorHLTOffline *fv, const int &NL1, unsigned int &NL1OffUM)
std::string pathsSummaryHLTPathsPerBXFolder_
virtual void matchL1Offline(const trigger::TriggerObject &l1FV, FourVectorHLTOffline *fv, const int &NL1, unsigned int &NL1OffUM)=0
std::vector< std::pair< std::string, float > > fPathTempCountPair
int j
Definition: DBlmapReader.cc:9
const std::string & getProcess(void) const
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
HLTConfigProvider hltConfig_
virtual void matchOnlineL1(const trigger::TriggerObject &onlineFV, const int &l1Index, FourVectorHLTOnline *fv, const int &NOn)=0
void setLabel(std::string labelName)
#define end
Definition: vmac.h:38
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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)
reco::PhotonCollection * fSelectedPhotons
std::vector< MonitorElement * > v_ME_Total_BX_Norm
void fillL1OffMatch(FourVectorHLTOffline *fv)
void selectTaus(const edm::Event &iEvent)
std::vector< std::pair< std::string, unsigned int > > filtersAndIndices
bool operator==(const std::string &v)
const int getObjectType(void) const
bool isVBTFMuon(const reco::Muon &muon)
MonitorElement * ME_HLT_BX
void selectElectrons(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::Handle< reco::GsfElectronCollection > &eleHandle)
int k[5][pyjets_maxn]
reco::MuonCollection * fSelectedMuons
edm::InputTag triggerResultsLabel_
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 setLimits(float etaMax, float etMin, float drMatch, float l1drMatch, float dRRange, float thresholdFactor)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
MonitorElement * ME_HLT_CUSTOM_BX
std::vector< std::vector< std::string > > triggerFilters_
void fillOnOffMatch(FourVectorHLTOffline *fv)
std::vector< size_type > Keys
MonitorElement * getOffEtaVsOffPhiOnOffUMHisto()
edm::Handle< reco::CaloJetCollection > fSelJetsHandle
const std::string getLabel(void) const
void setL1TriggerType(std::vector< int > trigType)
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
std::vector< std::pair< std::string, float > > fGroupTempCountPair
std::vector< std::pair< std::string, std::vector< std::string > > > fGroupNamePathsPair
void setRecoEle(edm::Handle< reco::GsfElectronCollection > offCollEle)
void fillL1Match(FourVectorHLTOffline *fv)
void setL2MuFlag(bool flag)
virtual void setPath(FourVectorHLTOnline::PathInfoCollection::iterator v)=0
double ptmin
Definition: HydjetWrapper.h:86
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
std::string pathsSummaryHLTCorrelationsFolder_
std::string pathsSummaryFilterCountsFolder_
const std::string & getl1Path(void) const
std::string pathsIndividualHLTPathsPerLSFolder_
#define begin
Definition: vmac.h:31
MonitorElement * getOffEtaVsOffPhiOnOffHisto()
void selectMet(const edm::Handle< reco::CaloMETCollection > &metHandle)
MonitorElement * getOffEtaVsOffPhiL1OffHisto()
MonitorElement * ME_HLTAll_LS
std::vector< std::string > fGroupName
void fillOnL1Match(const int l1Index, FourVectorHLTOnline *fv)
void countHLTGroupHitsEndLumiBlock(const int &lumi)
virtual void monitorL1(const int l1Index, FourVectorHLTOnline *fv)=0
std::vector< std::pair< std::string, float > > fGroupL1TempCountPair
reco::CaloJetCollection * fSelectedJets
void pushL1TriggerType(int trigType)
PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, int l1ModuleIndex, std::string filterName, std::string processName, size_t type, float ptmin, float ptmax, float hltThreshold, float l1Threshold)
int getHltThresholdFromName(const std::string &pathname)
edm::Handle< trigger::TriggerEvent > fTriggerObj
void setReco(edm::Handle< T > offColl)
MonitorElement * scalersSelect
void setTriggerType(std::vector< int > trigType)
std::vector< MonitorElement * > v_ME_HLTAll_LS
void setFilterHistos(MonitorElement *const filters)
mathSSE::Vec4< T > v
std::vector< int > Vids
Definition: Run.h:31
edm::Handle< reco::MuonCollection > offCollMu_
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
void selectMuons(const edm::Handle< reco::MuonCollection > &muonHandle)
bool hasHLTPassed(const std::string &pathname, const edm::TriggerNames &triggerNames)
const std::string & getDenomPath(void) const
Definition: DDAxes.h:10
void setBJetsFlag(bool flag)