CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTJetMETDQMSource.h
Go to the documentation of this file.
1  #ifndef HLTJetMETDQMSource_H
2 #define HLTJetMETDQMSource_H
3 // -*- C++ -*-
4 //
5 // Package: HLTJetMETDQMSource
6 // Class: HLTJetMETDQMSource
7 // Code for HLT JetMET DQ monitoring. Based on FourVectorOnline code.
8 
9 
10 
11 
12 
13 // system include files
14 #include <memory>
15 #include <unistd.h>
16 
17 
18 // user include files
21 
27 
33 
34 #include <iostream>
35 #include <fstream>
36 #include <vector>
37 
39  public:
40  explicit HLTJetMETDQMSource(const edm::ParameterSet&);
42 
43 
44  private:
45  virtual void beginJob() ;
46  virtual void analyze(const edm::Event&, const edm::EventSetup&);
47  virtual void endJob() ;
48 
49  // BeginRun
50  void beginRun(const edm::Run& run, const edm::EventSetup& c);
51 
52  void histobooking( const edm::EventSetup& c);
53 
54  // EndRun
55  void endRun(const edm::Run& run, const edm::EventSetup& c);
56 
57 
58  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
59  const edm::EventSetup& c) ;
60 
62  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
63  const edm::EventSetup& c);
64 
65 
66  // ----------member data ---------------------------
67  int nev_;
69 
71 
72  bool plotAll_;
73  bool plotEff_;
74  bool plotwrtMu_;
75  bool resetMe_;
77  int nhltcfg;
79  unsigned int nBins_;
80  double ptMin_ ;
81  double ptMax_ ;
82 
83 
84  double muonEtaMax_;
85  double muonEtMin_;
86  double muonDRMatch_;
87 
88  double jetEtaMax_;
89  double jetEtMin_;
90  double jetDRMatch_;
91 
92  double metMin_;
93  double htMin_;
94  double sumEtMin_;
95 
96  std::string custompathnamemu_;
97  std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
98  std::vector<int> prescUsed_;
99 
100 
101  std::string dirname_;
102  std::string processname_;
103  bool verbose_;
106 
110  // data across paths
112  // helper class to store the data path
113 
114  class PathInfo {
116  pathIndex_(-1), prescaleUsed_(-1),denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), DenomfilterName_("unset"), processName_("unset"), objectType_(-1)
117  {};
118  public:
119  void setHistos(
120  MonitorElement* const N,
121  MonitorElement* const Et,
122  MonitorElement* const EtaPhi,
123  MonitorElement* const Eta,
124  MonitorElement* const Phi,
125  MonitorElement* const NL1,
126  MonitorElement* const l1Et,
127  MonitorElement* const l1EtaPhi,
128  MonitorElement* const l1Eta,
129  MonitorElement* const l1Phi)
130 
131  {
132  N_ = N;
133  Et_ = Et;
134  EtaPhi_ = EtaPhi;
135  Eta_ = Eta;
136  Phi_ = Phi;
137  NL1_ = NL1;
138  l1Et_ = l1Et;
139  l1EtaPhi_ = l1EtaPhi;
140  l1Eta_ = l1Eta;
141  l1Phi_ = l1Phi;
142 
143  }
145  MonitorElement* const NEff,
146  MonitorElement* const EtEff,
147  MonitorElement* const EtaEff,
148  MonitorElement* const PhiEff,
149  MonitorElement* const NNum,
150  MonitorElement* const EtNum,
151  MonitorElement* const EtaNum,
152  MonitorElement* const PhiNum,
153  MonitorElement* const NDenom,
154  MonitorElement* const EtDenom,
155  MonitorElement* const EtaDenom,
156  MonitorElement* const PhiDenom)
157 
158  {
159  NEff_ = NEff;
160  EtEff_ = EtEff;
161  EtaEff_ = EtaEff;
162  PhiEff_ = PhiEff;
163  NNum_ = NNum;
164  EtNum_ = EtNum;
165  EtaNum_ = EtaNum;
166  PhiNum_ = PhiNum;
167  NDenom_ = NDenom;
168  EtDenom_ = EtDenom;
169  EtaDenom_ = EtaDenom;
170  PhiDenom_ = PhiDenom;
171  }
173  MonitorElement* const NwrtMu,
174  MonitorElement* const EtwrtMu,
175  MonitorElement* const EtaPhiwrtMu,
176  MonitorElement* const PhiwrtMu)
177 
178 
179  {
180  NwrtMu_ = NwrtMu;
181  EtwrtMu_ = EtwrtMu;
182  EtaPhiwrtMu_ = EtaPhiwrtMu;
183  PhiwrtMu_ = PhiwrtMu;
184  }
186  return N_;
187  }
189  return Et_;
190  }
192  return EtaPhi_;
193  }
195  return Eta_;
196  }
198  return Phi_;
199  }
201  return NL1_;
202  }
204  return l1Et_;
205  }
207  return l1Eta_;
208  }
210  return l1EtaPhi_;
211  }
213  return l1Phi_;
214  }
216  return NwrtMu_;
217  }
219  return EtwrtMu_;
220  }
222  return EtaPhiwrtMu_;
223  }
225  return PhiwrtMu_;
226  }
228  return NEff_;
229  }
231  return EtEff_;
232  }
234  return EtaEff_;
235  }
237  return PhiEff_;
238  }
240  return NNum_;
241  }
243  return EtNum_;
244  }
246  return EtaNum_;
247  }
249  return PhiNum_;
250  }
252  return NDenom_;
253  }
255  return EtDenom_;
256  }
258  return EtaDenom_;
259  }
261  return PhiDenom_;
262  }
263  const std::string getLabel(void ) const {
264  return filterName_;
265  }
266  const std::string getDenomLabel(void ) const {
267  return DenomfilterName_;
268  }
269 
270  void setLabel(std::string labelName){
271  filterName_ = labelName;
272  return;
273  }
274  void setDenomLabel(std::string labelName){
275  DenomfilterName_ = labelName;
276  return;
277  }
278  const std::string getPath(void ) const {
279  return pathName_;
280  }
281  const std::string getl1Path(void ) const {
282  return l1pathName_;
283  }
284  const std::string getDenomPath(void ) const {
285  return denomPathName_;
286  }
287  const int getprescaleUsed(void) const {
288  return prescaleUsed_;
289  }
290  const std::string getProcess(void ) const {
291  return processName_;
292  }
293  const int getObjectType(void ) const {
294  return objectType_;
295  }
296 
297  const edm::InputTag getTag(void) const{
299  return tagName;
300  }
301  const edm::InputTag getDenomTag(void) const{
303  return tagName;
304  }
305  ~PathInfo() {};
306  PathInfo(int prescaleUsed, std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string DenomfilterName, std::string processName, size_t type, float ptmin,
307  float ptmax):
308  prescaleUsed_(prescaleUsed),denomPathName_(denomPathName), pathName_(pathName), l1pathName_(l1pathName), filterName_(filterName), DenomfilterName_(DenomfilterName), processName_(processName), objectType_(type),
309  N_(0), Et_(0), EtaPhi_(0),Eta_(0),
310  NL1_(0), l1Et_(0), l1EtaPhi_(0),l1Eta_(0),l1Phi_(0),
311  NwrtMu_(0), EtwrtMu_(0), EtaPhiwrtMu_(0),PhiwrtMu_(0),
312  NEff_(0), EtEff_(0), EtaEff_(0),PhiEff_(0),
313  NNum_(0), EtNum_(0), EtaNum_(0),PhiNum_(0),
314  NDenom_(0), EtDenom_(0), EtaDenom_(0),PhiDenom_(0),
315  ptmin_(ptmin), ptmax_(ptmax)
316  {
317  };
318  PathInfo(int prescaleUsed, std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string DenomfilterName, std::string processName, size_t type,
319  MonitorElement *N,
320  MonitorElement *Et,
321  MonitorElement *EtaPhi,
324  MonitorElement *NL1,
325  MonitorElement *l1Et,
326  MonitorElement *l1EtaPhi,
327  MonitorElement *l1Eta,
328  MonitorElement *l1Phi,
329  MonitorElement *NwrtMu,
330  MonitorElement *EtwrtMu,
331  MonitorElement *EtaPhiwrtMu,
332  MonitorElement *PhiwrtMu,
333  MonitorElement *NEff,
334  MonitorElement *EtEff,
335  MonitorElement *EtaEff,
336  MonitorElement *PhiEff,
337  MonitorElement *NNum,
338  MonitorElement *EtNum,
339  MonitorElement *EtaNum,
340  MonitorElement *PhiNum,
341  MonitorElement *NDenom,
342  MonitorElement *EtDenom,
343  MonitorElement *EtaDenom,
344  MonitorElement *PhiDenom,
345  float ptmin, float ptmax
346  ):
347  prescaleUsed_(prescaleUsed), denomPathName_(denomPathName), pathName_(pathName), l1pathName_(l1pathName), filterName_(filterName), DenomfilterName_(DenomfilterName), processName_(processName), objectType_(type),
348  N_(N), Et_(Et), EtaPhi_(EtaPhi),Eta_(Eta), Phi_(Phi),
349  NL1_(NL1), l1Et_(l1Et), l1EtaPhi_(l1EtaPhi),l1Eta_(l1Eta),l1Phi_(l1Phi),
350  NwrtMu_(NwrtMu), EtwrtMu_(EtwrtMu), EtaPhiwrtMu_(EtaPhiwrtMu),PhiwrtMu_(PhiwrtMu),
351  NEff_(NEff), EtEff_(EtEff), EtaEff_(EtaEff), PhiEff_(PhiEff),
352  NNum_(NNum), EtNum_(EtNum), EtaNum_(EtaNum), PhiNum_(PhiNum),
353  NDenom_(NDenom), EtDenom_(EtDenom), EtaDenom_(EtaDenom),PhiDenom_(PhiDenom),
354  ptmin_(ptmin), ptmax_(ptmax)
355  {};
356  bool operator==(const std::string v)
357  {
358  return v==filterName_;
359  }
360  private:
363  std::string denomPathName_;
364  std::string pathName_;
365  std::string l1pathName_;
366  std::string filterName_;
367  std::string DenomfilterName_;
368  std::string processName_;
370 
371  // we don't own this data
378 
379  float ptmin_, ptmax_;
380 
381  const int index() {
382  return pathIndex_;
383  }
384  const int type() {
385  return objectType_;
386  }
387  public:
388  float getPtMin() const { return ptmin_; }
389  float getPtMax() const { return ptmax_; }
390  };
391 
392  // simple collection - just
393  class PathInfoCollection: public std::vector<PathInfo> {
394  public:
395  PathInfoCollection(): std::vector<PathInfo>()
396  {};
397  std::vector<PathInfo>::iterator find(std::string pathName) {
398  return std::find(begin(), end(), pathName);
399  }
400  };
410 
411 
412 };
413 #endif
type
Definition: HCALResponse.h:22
void setHistos(MonitorElement *const N, MonitorElement *const Et, MonitorElement *const EtaPhi, MonitorElement *const Eta, MonitorElement *const Phi, MonitorElement *const NL1, MonitorElement *const l1Et, MonitorElement *const l1EtaPhi, MonitorElement *const l1Eta, MonitorElement *const l1Phi)
MonitorElement * rate_All
MonitorElement * getPhiDenomHisto()
edm::InputTag triggerSummaryLabel_
edm::InputTag triggerResultsLabel_
const int getObjectType(void) const
const std::string getDenomPath(void) const
void setHistoswrtMu(MonitorElement *const NwrtMu, MonitorElement *const EtwrtMu, MonitorElement *const EtaPhiwrtMu, MonitorElement *const PhiwrtMu)
PathInfoCollection hltPathsAll_
const std::string getLabel(void) const
PathInfo(int prescaleUsed, std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string DenomfilterName, std::string processName, size_t type, MonitorElement *N, MonitorElement *Et, MonitorElement *EtaPhi, MonitorElement *Eta, MonitorElement *Phi, MonitorElement *NL1, MonitorElement *l1Et, MonitorElement *l1EtaPhi, MonitorElement *l1Eta, MonitorElement *l1Phi, MonitorElement *NwrtMu, MonitorElement *EtwrtMu, MonitorElement *EtaPhiwrtMu, MonitorElement *PhiwrtMu, MonitorElement *NEff, MonitorElement *EtEff, MonitorElement *EtaEff, MonitorElement *PhiEff, MonitorElement *NNum, MonitorElement *EtNum, MonitorElement *EtaNum, MonitorElement *PhiNum, MonitorElement *NDenom, MonitorElement *EtDenom, MonitorElement *EtaDenom, MonitorElement *PhiDenom, float ptmin, float ptmax)
bool operator==(const std::string v)
const std::string getl1Path(void) const
const std::string getProcess(void) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const std::string * pathName() const
Definition: HLTadd.h:31
void beginRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * getEtDenomHisto()
const std::string getDenomLabel(void) const
MonitorElement * getEtwrtMuHisto()
void histobooking(const edm::EventSetup &c)
HLTConfigProvider hltConfig_
PathInfo(int prescaleUsed, std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string DenomfilterName, std::string processName, size_t type, float ptmin, float ptmax)
MonitorElement * rate_Denom
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
#define end
Definition: vmac.h:38
MonitorElement * total_
const std::string getPath(void) const
HLTJetMETDQMSource(const edm::ParameterSet &)
PathInfoCollection hltPathswrtMu_
MonitorElement * getPhiwrtMuHisto()
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
std::string custompathnamemu_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< int > prescUsed_
void setHistosEff(MonitorElement *const NEff, MonitorElement *const EtEff, MonitorElement *const EtaEff, MonitorElement *const PhiEff, MonitorElement *const NNum, MonitorElement *const EtNum, MonitorElement *const EtaNum, MonitorElement *const PhiNum, MonitorElement *const NDenom, MonitorElement *const EtDenom, MonitorElement *const EtaDenom, MonitorElement *const PhiDenom)
void setDenomLabel(std::string labelName)
const edm::InputTag getDenomTag(void) const
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
MonitorElement * rate_Eff
MonitorElement * rate_Num
MonitorElement * scalersSelect
double ptmin
Definition: HydjetWrapper.h:86
MonitorElement * getEtaDenomHisto()
#define begin
Definition: vmac.h:31
const edm::InputTag getTag(void) const
PathInfoCollection hltPathsEff_
MonitorElement * rate_All_L1
std::vector< PathInfo >::iterator find(std::string pathName)
MonitorElement * rate_wrtMu
MonitorElement * getEtaPhiwrtMuHisto()
const int getprescaleUsed(void) const
mathSSE::Vec4< T > v
MonitorElement * getL1EtaPhiHisto()
Definition: Run.h:31
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
void setLabel(std::string labelName)