CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetMETHLTOfflineSource.h
Go to the documentation of this file.
1 /*
2  New version of HLT Offline DQM code for JetMET
3  responsible: Sunil Bansal, Shabnam jabeen
4 
5 */
6 
7 
8 #ifndef JetMETHLTOfflineSource_H
9 #define JetMETHLTOfflineSource_H
10 
11 // system include files
12 #include <memory>
13 #include <unistd.h>
14 
15 
16 // user include files
19 
22 
30 
39 
40 #include <iostream>
41 #include <fstream>
42 #include <vector>
43 
44 class PtSorter {
45  public:
46  template <class T> bool operator() ( const T& a, const T& b ) {
47  return ( a.pt() > b.pt() );
48  }
49  };
50 
52  public:
55 
56 
57  private:
58  virtual void beginJob() ;
59  virtual void analyze(const edm::Event&, const edm::EventSetup&);
60  virtual void endJob() ;
61 
62  // BeginRun
63  void beginRun(const edm::Run& run, const edm::EventSetup& c);
64 
65  void histobooking( const edm::EventSetup& c);
66 
67  // EndRun
68  void endRun(const edm::Run& run, const edm::EventSetup& c);
69 
70 
71  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
72  const edm::EventSetup& c) ;
73 
75  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
76  const edm::EventSetup& c);
77 
78  virtual bool isBarrel(double eta);
79  virtual bool isEndCap(double eta);
80  virtual bool isForward(double eta);
81  virtual bool validPathHLT(std::string path);
82  virtual bool isHLTPathAccepted(std::string pathName);
83  virtual bool isTriggerObjectFound(std::string objectName);
84  virtual double TriggerPosition(std::string trigName);
85  virtual void fillMEforMonTriggerSummary();
86  virtual void fillMEforMonAllTrigger(const edm::Event & iEvent);
87  virtual void fillMEforMonAllTriggerwrtMuonTrigger(const edm::Event & iEvent);
88 
89  virtual void fillMEforEffAllTrigger(const edm::Event & iEvent);
90  virtual void fillMEforEffWrtMuTrigger(const edm::Event & iEvent);
91  virtual void fillMEforEffWrtMBTrigger(const edm::Event & iEvent);
92  virtual void fillMEforTriggerNTfired();
93  // ----------member data ---------------------------
94  int nev_;
96 
98 
99 
100  std::vector<std::string> MuonTrigPaths_;
101  std::vector<std::string> MBTrigPaths_;
102  std::vector<int> prescUsed_;
103 
104 
105  std::string dirname_;
106  std::string processname_;
107  // JetID helper
109 
110  bool verbose_;
111  bool plotAll_;
113  bool plotEff_ ;
114  bool isSetup_;
115  bool nameForEff_;
116 
117  double _fEMF;
118  double _feta;
119  double _fHPD;
120  double _n90Hits;
127  std::vector<std::string> custompathname;
128  std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
129 
133  edm::TriggerNames triggerNames_; // TriggerNames class
135  // data across paths
137  // helper class to store the data path
138 
139  class PathInfo {
141  pathIndex_(-1), prescaleUsed_(-1),denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), DenomfilterName_("unset"), processName_("unset"), objectType_(-1), triggerType_("unset")
142  {};
143  public:
144  void setHistos(
145  MonitorElement* const N,
146  MonitorElement* const Pt,
147  MonitorElement* const PtBarrel,
148  MonitorElement* const PtEndcap,
149  MonitorElement* const PtForward,
150  MonitorElement* const Eta,
151  MonitorElement* const Phi,
152  MonitorElement* const EtaPhi,
153  MonitorElement* const N_L1,
154  MonitorElement* const Pt_L1,
155  MonitorElement* const PtBarrel_L1,
156  MonitorElement* const PtEndcap_L1,
157  MonitorElement* const PtForward_L1,
158  MonitorElement* const Eta_L1,
159  MonitorElement* const Phi_L1,
160  MonitorElement* const EtaPhi_L1,
161  MonitorElement* const N_HLT,
162  MonitorElement* const Pt_HLT,
163  MonitorElement* const PtBarrel_HLT,
164  MonitorElement* const PtEndcap_HLT,
165  MonitorElement* const PtForward_HLT,
166  MonitorElement* const Eta_HLT,
167  MonitorElement* const Phi_HLT,
168  MonitorElement* const EtaPhi_HLT,
169 
170  MonitorElement* const PtResolution_L1HLT,
171  MonitorElement* const EtaResolution_L1HLT,
172  MonitorElement* const PhiResolution_L1HLT,
173  MonitorElement* const PtResolution_HLTRecObj,
174  MonitorElement* const EtaResolution_HLTRecObj,
175  MonitorElement* const PhiResolution_HLTRecObj,
176 
177  MonitorElement* const PtCorrelation_L1HLT,
178  MonitorElement* const EtaCorrelation_L1HLT,
179  MonitorElement* const PhiCorrelation_L1HLT,
180  MonitorElement* const PtCorrelation_HLTRecObj,
181  MonitorElement* const EtaCorrelation_HLTRecObj,
182  MonitorElement* const PhiCorrelation_HLTRecObj,
183 
184  MonitorElement* const JetAveragePt,
185  MonitorElement* const JetAverageEta,
186  MonitorElement* const JetPhiDifference,
187  MonitorElement* const HLTAveragePt,
188  MonitorElement* const HLTAverageEta,
189  MonitorElement* const HLTPhiDifference,
190  MonitorElement* const L1AveragePt,
191  MonitorElement* const L1AverageEta,
192  MonitorElement* const L1PhiDifference
193  )
194 
195  {
196  N_ =N;
197  Pt_ =Pt;
198  PtBarrel_ =PtBarrel;
199  PtEndcap_ =PtEndcap;
200  PtForward_ =PtForward;
201  Eta_ =Eta;
202  Phi_ =Phi;
203  EtaPhi_ =EtaPhi;
204  N_L1_ =N_L1;
205  Pt_L1_ =Pt_L1;
206  PtBarrel_L1_ =PtBarrel_L1;
207  PtEndcap_L1_ =PtEndcap_L1;
208  PtForward_L1_ =PtForward_L1;
209  Eta_L1_ =Eta_L1;
210  Phi_L1_ =Phi_L1;
211  EtaPhi_L1_ =EtaPhi_L1 ;
212  N_HLT_ =N_HLT;
213  Pt_HLT_ =Pt_HLT;
214  PtBarrel_HLT_ =PtBarrel_HLT;
215  PtEndcap_HLT_ =PtEndcap_HLT;
216  PtForward_HLT_ =PtForward_HLT;
217  Eta_HLT_ =Eta_HLT;
218  Phi_HLT_ =Phi_HLT;
219  EtaPhi_HLT_ =EtaPhi_HLT ;
220 
221  PtResolution_L1HLT_ =PtResolution_L1HLT;
222  EtaResolution_L1HLT_ =EtaResolution_L1HLT;
223  PhiResolution_L1HLT_ =PhiResolution_L1HLT;
224  PtResolution_HLTRecObj_ =PtResolution_HLTRecObj;
225  EtaResolution_HLTRecObj_=EtaResolution_HLTRecObj;
226  PhiResolution_HLTRecObj_=PhiResolution_HLTRecObj;
227 
228  PtCorrelation_L1HLT_ =PtCorrelation_L1HLT;
229  EtaCorrelation_L1HLT_ =EtaCorrelation_L1HLT;
230  PhiCorrelation_L1HLT_ =PhiCorrelation_L1HLT;
231  PtCorrelation_HLTRecObj_ =PtCorrelation_HLTRecObj;
232  EtaCorrelation_HLTRecObj_=EtaCorrelation_HLTRecObj;
233  PhiCorrelation_HLTRecObj_=PhiCorrelation_HLTRecObj;
234 
235  JetAveragePt_ = JetAveragePt;
236  JetAverageEta_ = JetAverageEta;
237  JetPhiDifference_ = JetPhiDifference;
238  HLTAveragePt_ = HLTAveragePt;
239  HLTAverageEta_ = HLTAverageEta;
240  HLTPhiDifference_ = HLTPhiDifference;
241  L1AveragePt_ = L1AveragePt;
242  L1AverageEta_ = L1AverageEta;
243  L1PhiDifference_ = L1PhiDifference;
244 
245 
246  };
248  MonitorElement* const TriggerSummary,
249  MonitorElement* const JetSize,
250  MonitorElement* const JetPt,
251  MonitorElement* const EtavsPt,
252  MonitorElement* const PhivsPt,
253  MonitorElement* const Pt12,
254  MonitorElement* const Eta12,
255  MonitorElement* const Phi12,
256  MonitorElement* const Pt3,
257  MonitorElement* const Pt12Pt3,
258  MonitorElement* const Pt12Phi12
259 
260  )
261  {
262  TriggerSummary_ = TriggerSummary;
263  JetSize_ = JetSize;
264  JetPt_ = JetPt;
265  EtavsPt_ = EtavsPt;
266  PhivsPt_ = PhivsPt;
267  Pt12_ = Pt12;
268  Eta12_ = Eta12;
269  Phi12_ = Phi12;
270  Pt3_ = Pt3;
271  Pt12Pt3_ = Pt12Pt3;
272  Pt12Phi12_ = Pt12Phi12;
273 
274  };
276  MonitorElement* const NumeratorPt,
277  MonitorElement* const NumeratorPtBarrel,
278  MonitorElement* const NumeratorPtEndcap,
279  MonitorElement* const NumeratorPtForward,
280  MonitorElement* const NumeratorEta,
281  MonitorElement* const NumeratorPhi,
282  MonitorElement* const NumeratorEtaPhi,
283  MonitorElement* const DenominatorPt,
284  MonitorElement* const DenominatorPtBarrel,
285  MonitorElement* const DenominatorPtEndcap,
286  MonitorElement* const DenominatorPtForward,
287  MonitorElement* const DenominatorEta,
288  MonitorElement* const DenominatorPhi,
289  MonitorElement* const DenominatorEtaPhi
290 
291 )
292 {
293  NumeratorPt_ =NumeratorPt;
294  NumeratorPtBarrel_ =NumeratorPtBarrel;
295  NumeratorPtEndcap_ =NumeratorPtEndcap;
296  NumeratorPtForward_ =NumeratorPtForward;
297  NumeratorEta_ =NumeratorEta;
298  NumeratorPhi_ =NumeratorPhi;
299  NumeratorEtaPhi_ =NumeratorEtaPhi;
300  DenominatorPt_ =DenominatorPt;
301  DenominatorPtBarrel_ =DenominatorPtBarrel;
302  DenominatorPtEndcap_ =DenominatorPtEndcap;
303  DenominatorPtForward_ =DenominatorPtForward;
304  DenominatorEta_ =DenominatorEta;
305  DenominatorPhi_ =DenominatorPhi;
306  DenominatorEtaPhi_ =DenominatorEtaPhi;
307 
308 
309  };
310  ~PathInfo() {};
311  PathInfo(int prescaleUsed, std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string DenomfilterName, std::string processName, size_t type, std::string triggerType):
312  prescaleUsed_(prescaleUsed),denomPathName_(denomPathName), pathName_(pathName), l1pathName_(l1pathName), filterName_(filterName), DenomfilterName_(DenomfilterName), processName_(processName), objectType_(type), triggerType_(triggerType){};
313 
322 
331 
340 
347 
354 
364 
379 
391 
392  const std::string getLabel(void ) const {
393  return filterName_;
394  }
395  const std::string getDenomLabel(void ) const {
396  return DenomfilterName_;
397  }
398 
399  void setLabel(std::string labelName){
400  filterName_ = labelName;
401  return;
402  }
403  void setDenomLabel(std::string labelName){
404  DenomfilterName_ = labelName;
405  return;
406  }
407  const std::string getPath(void ) const {
408  return pathName_;
409  }
410  const std::string getl1Path(void ) const {
411  return l1pathName_;
412  }
413  const std::string getDenomPath(void ) const {
414  return denomPathName_;
415  }
416  const int getprescaleUsed(void) const {
417  return prescaleUsed_;
418  }
419  const std::string getProcess(void ) const {
420  return processName_;
421  }
422  const int getObjectType(void ) const {
423  return objectType_;
424  }
425  const std::string getTriggerType(void ) const {
426  return triggerType_;
427  }
428 
429 
430  const edm::InputTag getTag(void) const{
432  return tagName;
433  }
434  const edm::InputTag getDenomTag(void) const{
436  return tagName;
437  }
438  bool operator==(const std::string v)
439  {
440  return v==pathName_;
441  }
442  private:
445  std::string denomPathName_;
446  std::string pathName_;
447  std::string l1pathName_;
448  std::string filterName_;
449  std::string DenomfilterName_;
450  std::string processName_;
452  std::string triggerType_;
453 
478 
491 
501 
516 
528  };
529 
530  // simple collection
531  class PathInfoCollection: public std::vector<PathInfo> {
532  public:
533  PathInfoCollection(): std::vector<PathInfo>()
534  {};
535  std::vector<PathInfo>::iterator find(std::string pathName) {
536  return std::find(begin(), end(), pathName);
537  }
538  };
545 
549 
553 
554 
555 
556 
557 };
558 #endif
559 
PathInfoCollection hltPathsAllWrtMu_
type
Definition: HCALResponse.h:22
const std::string getProcess(void) const
bool operator()(const T &a, const T &b)
Definition: QcdUeDQM.h:40
const std::string getPath(void) const
void setDenomLabel(std::string labelName)
virtual bool isEndCap(double eta)
PathInfo(int prescaleUsed, std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string DenomfilterName, std::string processName, size_t type, std::string triggerType)
const std::string getLabel(void) const
JetMETHLTOfflineSource(const edm::ParameterSet &)
MonitorElement * getMEhisto_PhiResolution_HLTRecObj()
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
std::vector< std::string > custompathname
virtual double TriggerPosition(std::string trigName)
edm::Handle< edm::TriggerResults > triggerResults_
PathInfoCollection hltPathsAllTriggerSummary_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual bool validPathHLT(std::string path)
T eta() const
void setHistos(MonitorElement *const N, MonitorElement *const Pt, MonitorElement *const PtBarrel, MonitorElement *const PtEndcap, MonitorElement *const PtForward, MonitorElement *const Eta, MonitorElement *const Phi, MonitorElement *const EtaPhi, MonitorElement *const N_L1, MonitorElement *const Pt_L1, MonitorElement *const PtBarrel_L1, MonitorElement *const PtEndcap_L1, MonitorElement *const PtForward_L1, MonitorElement *const Eta_L1, MonitorElement *const Phi_L1, MonitorElement *const EtaPhi_L1, MonitorElement *const N_HLT, MonitorElement *const Pt_HLT, MonitorElement *const PtBarrel_HLT, MonitorElement *const PtEndcap_HLT, MonitorElement *const PtForward_HLT, MonitorElement *const Eta_HLT, MonitorElement *const Phi_HLT, MonitorElement *const EtaPhi_HLT, MonitorElement *const PtResolution_L1HLT, MonitorElement *const EtaResolution_L1HLT, MonitorElement *const PhiResolution_L1HLT, MonitorElement *const PtResolution_HLTRecObj, MonitorElement *const EtaResolution_HLTRecObj, MonitorElement *const PhiResolution_HLTRecObj, MonitorElement *const PtCorrelation_L1HLT, MonitorElement *const EtaCorrelation_L1HLT, MonitorElement *const PhiCorrelation_L1HLT, MonitorElement *const PtCorrelation_HLTRecObj, MonitorElement *const EtaCorrelation_HLTRecObj, MonitorElement *const PhiCorrelation_HLTRecObj, MonitorElement *const JetAveragePt, MonitorElement *const JetAverageEta, MonitorElement *const JetPhiDifference, MonitorElement *const HLTAveragePt, MonitorElement *const HLTAverageEta, MonitorElement *const HLTPhiDifference, MonitorElement *const L1AveragePt, MonitorElement *const L1AverageEta, MonitorElement *const L1PhiDifference)
virtual void fillMEforMonAllTrigger(const edm::Event &iEvent)
int path() const
Definition: HLTadd.h:3
const std::string getl1Path(void) const
const std::string * pathName() const
Definition: HLTadd.h:31
virtual bool isBarrel(double eta)
virtual void fillMEforMonTriggerSummary()
int iEvent
Definition: GenABIO.cc:243
const std::string getDenomPath(void) const
const edm::InputTag getTag(void) const
const std::string getTriggerType(void) const
std::vector< std::string > MBTrigPaths_
std::vector< PathInfo >::iterator find(std::string pathName)
virtual bool isTriggerObjectFound(std::string objectName)
virtual bool isForward(double eta)
virtual void fillMEforEffAllTrigger(const edm::Event &iEvent)
MonitorElement * correlation_AllWrtMu
MonitorElement * getMEhisto_EtaCorrelation_HLTRecObj()
PathInfoCollection hltPathsEffWrtMB_
#define end
Definition: vmac.h:38
reco::CaloJetCollection calojet
std::vector< std::string > MuonTrigPaths_
virtual void fillMEforEffWrtMBTrigger(const edm::Event &iEvent)
virtual void fillMEforEffWrtMuTrigger(const edm::Event &iEvent)
virtual bool isHLTPathAccepted(std::string pathName)
edm::Handle< reco::CaloJetCollection > calojetColl_
MonitorElement * getMEhisto_PtCorrelation_HLTRecObj()
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
MonitorElement * getMEhisto_PtResolution_HLTRecObj()
MonitorElement * getMEhisto_DenominatorPtForward()
void setLabel(std::string labelName)
void setEffHistos(MonitorElement *const NumeratorPt, MonitorElement *const NumeratorPtBarrel, MonitorElement *const NumeratorPtEndcap, MonitorElement *const NumeratorPtForward, MonitorElement *const NumeratorEta, MonitorElement *const NumeratorPhi, MonitorElement *const NumeratorEtaPhi, MonitorElement *const DenominatorPt, MonitorElement *const DenominatorPtBarrel, MonitorElement *const DenominatorPtEndcap, MonitorElement *const DenominatorPtForward, MonitorElement *const DenominatorEta, MonitorElement *const DenominatorPhi, MonitorElement *const DenominatorEtaPhi)
PathInfoCollection hltPathsAll_
MonitorElement * getMEhisto_EtaCorrelation_L1HLT()
double b
Definition: hdecay.h:120
edm::Handle< trigger::TriggerEvent > triggerObj_
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
MonitorElement * correlation_AllWrtMB
const edm::InputTag getDenomTag(void) const
PathInfoCollection hltPathsEffWrtMu_
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
void setDgnsHistos(MonitorElement *const TriggerSummary, MonitorElement *const JetSize, MonitorElement *const JetPt, MonitorElement *const EtavsPt, MonitorElement *const PhivsPt, MonitorElement *const Pt12, MonitorElement *const Eta12, MonitorElement *const Phi12, MonitorElement *const Pt3, MonitorElement *const Pt12Pt3, MonitorElement *const Pt12Phi12)
const std::string getDenomLabel(void) const
void beginRun(const edm::Run &run, const edm::EventSetup &c)
bool operator==(const std::string v)
#define begin
Definition: vmac.h:31
double a
Definition: hdecay.h:121
edm::Handle< reco::CaloMETCollection > calometColl_
void histobooking(const edm::EventSetup &c)
virtual void fillMEforMonAllTriggerwrtMuonTrigger(const edm::Event &iEvent)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * getMEhisto_PhiCorrelation_L1HLT()
MonitorElement * getMEhisto_EtaResolution_HLTRecObj()
reco::helper::JetIDHelper * jetID
mathSSE::Vec4< T > v
MonitorElement * getMEhisto_PhiCorrelation_HLTRecObj()
Definition: Run.h:31
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
PathInfoCollection hltPathsEff_