CMS 3D CMS Logo

FourVectorHLT.h
Go to the documentation of this file.
1 #ifndef FOURVECTORHLT_H
2 #define FOURVECTORHLT_H
3 // -*- C++ -*-
4 //
5 // Package: FourVectorHLT
6 // Class: FourVectorHLT
7 //
16 //
17 // Original Author: Peter Wittich
18 // Created: May 2008
19 //
20 //
21 
22 // system include files
23 #include <memory>
24 #include <unistd.h>
25 
26 // user include files
29 
33 
38 #include <iostream>
39 #include <fstream>
40 #include <vector>
41 
42 //
43 // class decleration
44 //
45 
46 class FourVectorHLT : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
47 public:
50 
51  explicit FourVectorHLT(const edm::ParameterSet&);
52  ~FourVectorHLT() override;
53 
54 private:
55  void beginJob() override;
56  void analyze(const edm::Event&, const edm::EventSetup&) override;
57  void endJob() override;
58 
59  // BeginRun
60  void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
61 
62  // EndRun
63  void endRun(const edm::Run& run, const edm::EventSetup& c) override;
64 
65  // ----------member data ---------------------------
66  int nev_;
68 
69  bool plotAll_;
70 
71  unsigned int nBins_;
72  double ptMin_;
73  double ptMax_;
74 
78 
79  //define Token(-s)
81 
82  // helper class to store the data
83  class PathInfo {
84  PathInfo() : pathIndex_(-1), pathName_("unset"), objectType_(-1){};
85 
86  public:
88  MonitorElement* const eta,
89  MonitorElement* const phi,
90  MonitorElement* const etavsphi) {
91  et_ = et;
92  eta_ = eta;
93  phi_ = phi;
94  etavsphi_ = etavsphi;
95  }
96  MonitorElement* getEtHisto() { return et_; }
100  const std::string getName(void) const { return pathName_; }
102  PathInfo(std::string pathName, size_t type, float ptmin, float ptmax)
103  : pathName_(pathName),
104  objectType_(type),
105  et_(nullptr),
106  eta_(nullptr),
107  phi_(nullptr),
108  etavsphi_(nullptr),
109  ptmin_(ptmin),
110  ptmax_(ptmax){};
112  size_t type,
116  MonitorElement* etavsphi,
117  float ptmin,
118  float ptmax)
119  : pathName_(pathName),
120  objectType_(type),
121  et_(et),
122  eta_(eta),
123  phi_(phi),
124  etavsphi_(etavsphi),
125  ptmin_(ptmin),
126  ptmax_(ptmax){};
127  bool operator==(const std::string v) { return v == pathName_; }
128 
129  private:
133 
134  // we don't own this data
136 
137  float ptmin_, ptmax_;
138 
139  const int index() { return pathIndex_; }
140  const int type() { return objectType_; }
141 
142  public:
143  float getPtMin() const { return ptmin_; }
144  float getPtMax() const { return ptmax_; }
145  };
146 
147  // simple collection - just
148  class PathInfoCollection : public std::vector<PathInfo> {
149  public:
151  std::vector<PathInfo>::iterator find(std::string pathName) { return std::find(begin(), end(), pathName); }
152  };
154 };
155 #endif
bool operator==(const std::string v)
~FourVectorHLT() override
std::string dirname_
Definition: FourVectorHLT.h:75
edm::InputTag triggerResultLabel_
Definition: FourVectorHLT.h:77
MonitorElement * getEtHisto()
Definition: FourVectorHLT.h:96
dqm::legacy::DQMStore DQMStore
Definition: FourVectorHLT.h:49
void endRun(const edm::Run &run, const edm::EventSetup &c) override
EndRun.
MonitorElement * getEtaHisto()
Definition: FourVectorHLT.h:97
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
MonitorElement * getPhiHisto()
Definition: FourVectorHLT.h:98
FourVectorHLT(const edm::ParameterSet &)
void setHistos(MonitorElement *const et, MonitorElement *const eta, MonitorElement *const phi, MonitorElement *const etavsphi)
Definition: FourVectorHLT.h:87
MonitorElement * etavsphi_
dqm::legacy::MonitorElement MonitorElement
Definition: FourVectorHLT.h:48
MonitorElement * et_
PathInfo(std::string pathName, size_t type, float ptmin, float ptmax)
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * phi_
void beginJob() override
MonitorElement * eta_
PathInfoCollection hltPaths_
void endJob() override
double ptmin
Definition: HydjetWrapper.h:86
const std::string getName(void) const
unsigned int nBins_
Definition: FourVectorHLT.h:71
std::vector< PathInfo >::iterator find(std::string pathName)
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken_
Definition: FourVectorHLT.h:80
DQMStore * dbe_
Definition: FourVectorHLT.h:67
MonitorElement * getEtaVsPhiHisto()
Definition: FourVectorHLT.h:99
PathInfo(std::string pathName, size_t type, MonitorElement *et, MonitorElement *eta, MonitorElement *phi, MonitorElement *etavsphi, float ptmin, float ptmax)
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
Definition: Run.h:45
edm::InputTag triggerSummaryLabel_
Definition: FourVectorHLT.h:76