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 
97  std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
98  std::vector<int> prescUsed_;
99 
100 
103  bool verbose_;
106 
110  // data across paths
112 
113  //define Tokens(-s)
118  // helper class to store the data path
119 
120  class PathInfo {
122  pathIndex_(-1), prescaleUsed_(-1),denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), DenomfilterName_("unset"), processName_("unset"), objectType_(-1)
123  {};
124  public:
125  void setHistos(
126  MonitorElement* const N,
127  MonitorElement* const Et,
128  MonitorElement* const EtaPhi,
129  MonitorElement* const Eta,
130  MonitorElement* const Phi,
131  MonitorElement* const NL1,
132  MonitorElement* const l1Et,
133  MonitorElement* const l1EtaPhi,
134  MonitorElement* const l1Eta,
135  MonitorElement* const l1Phi)
136 
137  {
138  N_ = N;
139  Et_ = Et;
140  EtaPhi_ = EtaPhi;
141  Eta_ = Eta;
142  Phi_ = Phi;
143  NL1_ = NL1;
144  l1Et_ = l1Et;
145  l1EtaPhi_ = l1EtaPhi;
146  l1Eta_ = l1Eta;
147  l1Phi_ = l1Phi;
148 
149  }
151  MonitorElement* const NEff,
152  MonitorElement* const EtEff,
153  MonitorElement* const EtaEff,
154  MonitorElement* const PhiEff,
155  MonitorElement* const NNum,
156  MonitorElement* const EtNum,
157  MonitorElement* const EtaNum,
158  MonitorElement* const PhiNum,
159  MonitorElement* const NDenom,
160  MonitorElement* const EtDenom,
161  MonitorElement* const EtaDenom,
162  MonitorElement* const PhiDenom)
163 
164  {
165  NEff_ = NEff;
166  EtEff_ = EtEff;
167  EtaEff_ = EtaEff;
168  PhiEff_ = PhiEff;
169  NNum_ = NNum;
170  EtNum_ = EtNum;
171  EtaNum_ = EtaNum;
172  PhiNum_ = PhiNum;
173  NDenom_ = NDenom;
174  EtDenom_ = EtDenom;
175  EtaDenom_ = EtaDenom;
176  PhiDenom_ = PhiDenom;
177  }
179  MonitorElement* const NwrtMu,
180  MonitorElement* const EtwrtMu,
181  MonitorElement* const EtaPhiwrtMu,
182  MonitorElement* const PhiwrtMu)
183 
184 
185  {
186  NwrtMu_ = NwrtMu;
187  EtwrtMu_ = EtwrtMu;
188  EtaPhiwrtMu_ = EtaPhiwrtMu;
189  PhiwrtMu_ = PhiwrtMu;
190  }
192  return N_;
193  }
195  return Et_;
196  }
198  return EtaPhi_;
199  }
201  return Eta_;
202  }
204  return Phi_;
205  }
207  return NL1_;
208  }
210  return l1Et_;
211  }
213  return l1Eta_;
214  }
216  return l1EtaPhi_;
217  }
219  return l1Phi_;
220  }
222  return NwrtMu_;
223  }
225  return EtwrtMu_;
226  }
228  return EtaPhiwrtMu_;
229  }
231  return PhiwrtMu_;
232  }
234  return NEff_;
235  }
237  return EtEff_;
238  }
240  return EtaEff_;
241  }
243  return PhiEff_;
244  }
246  return NNum_;
247  }
249  return EtNum_;
250  }
252  return EtaNum_;
253  }
255  return PhiNum_;
256  }
258  return NDenom_;
259  }
261  return EtDenom_;
262  }
264  return EtaDenom_;
265  }
267  return PhiDenom_;
268  }
269  const std::string getLabel(void ) const {
270  return filterName_;
271  }
272  const std::string getDenomLabel(void ) const {
273  return DenomfilterName_;
274  }
275 
276  void setLabel(std::string labelName){
277  filterName_ = labelName;
278  return;
279  }
280  void setDenomLabel(std::string labelName){
281  DenomfilterName_ = labelName;
282  return;
283  }
284  const std::string getPath(void ) const {
285  return pathName_;
286  }
287  const std::string getl1Path(void ) const {
288  return l1pathName_;
289  }
290  const std::string getDenomPath(void ) const {
291  return denomPathName_;
292  }
293  const int getprescaleUsed(void) const {
294  return prescaleUsed_;
295  }
296  const std::string getProcess(void ) const {
297  return processName_;
298  }
299  const int getObjectType(void ) const {
300  return objectType_;
301  }
302 
303  const edm::InputTag getTag(void) const{
305  return tagName;
306  }
307  const edm::InputTag getDenomTag(void) const{
309  return tagName;
310  }
311  ~PathInfo() {};
312  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,
313  float ptmax):
314  prescaleUsed_(prescaleUsed),denomPathName_(denomPathName), pathName_(pathName), l1pathName_(l1pathName), filterName_(filterName), DenomfilterName_(DenomfilterName), processName_(processName), objectType_(type),
315  N_(0), Et_(0), EtaPhi_(0),Eta_(0),
316  NL1_(0), l1Et_(0), l1EtaPhi_(0),l1Eta_(0),l1Phi_(0),
317  NwrtMu_(0), EtwrtMu_(0), EtaPhiwrtMu_(0),PhiwrtMu_(0),
318  NEff_(0), EtEff_(0), EtaEff_(0),PhiEff_(0),
319  NNum_(0), EtNum_(0), EtaNum_(0),PhiNum_(0),
320  NDenom_(0), EtDenom_(0), EtaDenom_(0),PhiDenom_(0),
321  ptmin_(ptmin), ptmax_(ptmax)
322  {
323  };
324  PathInfo(int prescaleUsed, std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string DenomfilterName, std::string processName, size_t type,
325  MonitorElement *N,
326  MonitorElement *Et,
327  MonitorElement *EtaPhi,
330  MonitorElement *NL1,
331  MonitorElement *l1Et,
332  MonitorElement *l1EtaPhi,
333  MonitorElement *l1Eta,
334  MonitorElement *l1Phi,
335  MonitorElement *NwrtMu,
336  MonitorElement *EtwrtMu,
337  MonitorElement *EtaPhiwrtMu,
338  MonitorElement *PhiwrtMu,
339  MonitorElement *NEff,
340  MonitorElement *EtEff,
341  MonitorElement *EtaEff,
342  MonitorElement *PhiEff,
343  MonitorElement *NNum,
344  MonitorElement *EtNum,
345  MonitorElement *EtaNum,
346  MonitorElement *PhiNum,
347  MonitorElement *NDenom,
348  MonitorElement *EtDenom,
349  MonitorElement *EtaDenom,
350  MonitorElement *PhiDenom,
351  float ptmin, float ptmax
352  ):
353  prescaleUsed_(prescaleUsed), denomPathName_(denomPathName), pathName_(pathName), l1pathName_(l1pathName), filterName_(filterName), DenomfilterName_(DenomfilterName), processName_(processName), objectType_(type),
354  N_(N), Et_(Et), EtaPhi_(EtaPhi),Eta_(Eta), Phi_(Phi),
355  NL1_(NL1), l1Et_(l1Et), l1EtaPhi_(l1EtaPhi),l1Eta_(l1Eta),l1Phi_(l1Phi),
356  NwrtMu_(NwrtMu), EtwrtMu_(EtwrtMu), EtaPhiwrtMu_(EtaPhiwrtMu),PhiwrtMu_(PhiwrtMu),
357  NEff_(NEff), EtEff_(EtEff), EtaEff_(EtaEff), PhiEff_(PhiEff),
358  NNum_(NNum), EtNum_(EtNum), EtaNum_(EtaNum), PhiNum_(PhiNum),
359  NDenom_(NDenom), EtDenom_(EtDenom), EtaDenom_(EtaDenom),PhiDenom_(PhiDenom),
360  ptmin_(ptmin), ptmax_(ptmax)
361  {};
362  bool operator==(const std::string v)
363  {
364  return v==filterName_;
365  }
366  private:
376 
377  // we don't own this data
384 
385  float ptmin_, ptmax_;
386 
387  const int index() {
388  return pathIndex_;
389  }
390  const int type() {
391  return objectType_;
392  }
393  public:
394  float getPtMin() const { return ptmin_; }
395  float getPtMax() const { return ptmax_; }
396  };
397 
398  // simple collection - just
399  class PathInfoCollection: public std::vector<PathInfo> {
400  public:
401  PathInfoCollection(): std::vector<PathInfo>()
402  {};
403  std::vector<PathInfo>::iterator find(std::string pathName) {
404  return std::find(begin(), end(), pathName);
405  }
406  };
416 
417 
418 };
419 #endif
type
Definition: HCALResponse.h:21
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken_
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::EDGetTokenT< edm::TriggerResults > triggerResultsTokenFU_
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
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
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:37
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_
#define N
Definition: blowfish.cc:9
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
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryTokenFU_
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
MonitorElement * rate_Eff
MonitorElement * rate_Num
MonitorElement * scalersSelect
double ptmin
Definition: HydjetWrapper.h:85
MonitorElement * getEtaDenomHisto()
#define begin
Definition: vmac.h:30
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
MonitorElement * getL1EtaPhiHisto()
Definition: Run.h:41
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
void setLabel(std::string labelName)