CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EmDQMReco.h
Go to the documentation of this file.
1 #ifndef HLTriggerOffline_Egamma_EmDQMReco_H
2 #define HLTriggerOffline_Egamma_EmDQMReco_H
3 
4 // Base Class Headers
20 #include "HepMC/GenParticle.h"
21 #include "TDirectory.h"
22 
23 #include <memory>
24 #include <vector>
25 
26 class EmDQMReco;
27 
28 template <class T>
30 public:
33 
35  const edm::Event &iEvent,
36  unsigned int n,
37  std::vector<reco::Particle> &sortedReco,
38  bool plotReco,
39  bool plotMonpath);
40  std::vector<edm::EDGetTokenT<edm::AssociationMap<edm::OneToValue<T, float>>>> isoNameTokens_;
41 
42 private:
44 };
45 
46 class EmDQMReco : public DQMEDAnalyzer {
47  //----------------------------------------
48 
53  public:
63  DQMStore::IBooker &iBooker,
64  const std::string &histogramNameTemplate,
65  const std::string &histogramTitleTemplate);
66 
67  void fill(const math::XYZTLorentzVector &momentum);
68 
69  private:
72 
77  };
78  //----------------------------------------
79 
80 public:
82  friend class HistoFillerReco<reco::RecoEcalCandidateCollection>;
83  friend class HistoFillerReco<l1extra::L1EmParticleCollection>;
84 
86  explicit EmDQMReco(const edm::ParameterSet &pset);
87 
89  ~EmDQMReco() override;
90 
91  // Operations
92  void analyze(const edm::Event &event, const edm::EventSetup &) override;
93  void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override;
94  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
95 
96 private:
97  // Input from cfg file
98 
101 
102  unsigned int numOfHLTCollectionLabels; // Will be size of above vector
103 
105  std::vector<std::string> theHLTCollectionHumanNames; // Human-readable names for the collections
106  // edm::InputTag theL1Seed;
109  std::vector<std::vector<edm::InputTag>> isoNames; // there has to be a better solution
110  std::vector<std::pair<double, double>> plotBounds;
114 
116  // Read from configuration file //
118  // parameters for generator study
119  unsigned int reqNum;
120  int pdgGen;
121  double recoEtaAcc;
122  double recoEtAcc;
123  // plotting paramters
124  double plotEtaMax;
125  double plotPtMin;
126  double plotPtMax;
127  double plotPhiMax;
128 
130  unsigned int plotBins;
131 
132  // preselction cuts
133  // edm::InputTag recocutCollection_;
134  unsigned int recocut_;
135 
139 
144 
148  edm::EDGetTokenT<reco::GsfElectronCollection> recoElectronsInput;
149  edm::EDGetTokenT<std::vector<reco::SuperCluster>> recoObjectsEBT;
150  edm::EDGetTokenT<std::vector<reco::SuperCluster>> recoObjectsEET;
151  edm::EDGetTokenT<edm::TriggerResults> hltResultsT;
152  edm::EDGetTokenT<trigger::TriggerEventWithRefs> triggerObjT;
154  // Create Histograms //
156 
159  // std::vector<MonitorElement*> etahist;
160  // std::vector<MonitorElement*> ethist;
161  // std::vector<MonitorElement*> phiHist;
162 
163  std::vector<std::unique_ptr<FourVectorMonitorElements>> standardHist;
164 
165  // std::vector<MonitorElement*> etahistmatchreco;
166  // std::vector<MonitorElement*> ethistmatchreco;
167  // std::vector<MonitorElement*> phiHistMatchReco;
168  std::vector<std::unique_ptr<FourVectorMonitorElements>> histMatchReco;
169 
170  // std::vector<MonitorElement*> etahistmatchrecomonpath;
171  // std::vector<MonitorElement*> ethistmatchrecomonpath;
172  // std::vector<MonitorElement*> phiHistMatchRecoMonPath;
173  std::vector<std::unique_ptr<FourVectorMonitorElements>> histMatchRecoMonPath;
174 
175  // std::vector<MonitorElement*> histEtOfHltObjMatchToReco;
176  // std::vector<MonitorElement*> histEtaOfHltObjMatchToReco;
177  // std::vector<MonitorElement*> histPhiOfHltObjMatchToReco;
178  std::vector<std::unique_ptr<FourVectorMonitorElements>> histHltObjMatchToReco;
179 
184  std::vector<MonitorElement *> etahistiso;
185  std::vector<MonitorElement *> ethistiso;
186  std::vector<MonitorElement *> phiHistIso;
187 
188  std::vector<MonitorElement *> etahistisomatchreco;
189  std::vector<MonitorElement *> ethistisomatchreco;
190  std::vector<MonitorElement *> phiHistIsoMatchReco;
191 
201 
204  // MonitorElement* etreco;
205  // MonitorElement* etareco;
206  // MonitorElement* phiReco;
207  std::unique_ptr<FourVectorMonitorElements> histReco;
208 
209  // MonitorElement* etrecomonpath;
210  // MonitorElement* etarecomonpath;
211  // MonitorElement* phiRecoMonPath;
212  std::unique_ptr<FourVectorMonitorElements> histRecoMonpath;
213 
214  // MonitorElement* etahistmonpath;
215  // MonitorElement* ethistmonpath;
216  // MonitorElement* phiHistMonPath;
217  std::unique_ptr<FourVectorMonitorElements> histMonpath;
220  int eventnum;
221  // int prescale;
222 
223  // interface to DQM framework
225 
226  HistoFillerReco<reco::ElectronCollection> *histoFillerEle;
227  HistoFillerReco<reco::RecoEcalCandidateCollection> *histoFillerClu;
228  HistoFillerReco<l1extra::L1EmParticleCollection> *histoFillerL1NonIso;
229  HistoFillerReco<reco::RecoEcalCandidateCollection> *histoFillerPho;
230  HistoFillerReco<l1extra::L1EmParticleCollection> *histoFillerL1Iso;
231 
232  // template <class T> void
233  // fillHistos(edm::Handle<trigger::TriggerEventWithRefs>&,const edm::Event&
234  // ,unsigned int, std::vector<reco::Particle>&, bool, bool);
235  GreaterByPt<reco::Particle> pTComparator_;
236  GreaterByPt<reco::GsfElectron> pTRecoComparator_;
237 
238  //----------------------------------------
239 };
240 #endif
std::vector< MonitorElement * > histEtIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:192
int pdgGen
Definition: EmDQMReco.h:120
void fill(const math::XYZTLorentzVector &momentum)
Definition: EmDQMReco.cc:78
std::vector< std::unique_ptr< FourVectorMonitorElements > > histMatchReco
Definition: EmDQMReco.h:168
std::vector< std::vector< edm::InputTag > > isoNames
Definition: EmDQMReco.h:109
std::vector< std::unique_ptr< FourVectorMonitorElements > > standardHist
Definition: EmDQMReco.h:163
std::unique_ptr< FourVectorMonitorElements > histReco
Definition: EmDQMReco.h:207
std::vector< MonitorElement * > etahistisomatchreco
Definition: EmDQMReco.h:188
HistoFillerReco< reco::RecoEcalCandidateCollection > * histoFillerPho
Definition: EmDQMReco.h:229
std::string theHltName
Definition: EmDQMReco.h:111
HistoFillerReco< reco::ElectronCollection > * histoFillerEle
Definition: EmDQMReco.h:226
std::string dirname_
Definition: EmDQMReco.h:224
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Definition: EmDQMReco.cc:199
int eventnum
Definition: EmDQMReco.h:220
std::vector< MonitorElement * > etahistiso
Definition: EmDQMReco.h:184
std::vector< int > theHLTOutputTypes
Definition: EmDQMReco.h:107
void fillHistos(edm::Handle< trigger::TriggerEventWithRefs > &triggerObj, const edm::Event &iEvent, unsigned int n, std::vector< reco::Particle > &sortedReco, bool plotReco, bool plotMonpath)
Definition: EmDQMReco.cc:778
std::vector< edm::EDGetTokenT< edm::AssociationMap< edm::OneToValue< T, float > > > > isoNameTokens_
Definition: EmDQMReco.h:40
edm::EDGetTokenT< std::vector< reco::SuperCluster > > recoObjectsEET
Definition: EmDQMReco.h:150
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
unsigned int plotBins
Definition: EmDQMReco.h:130
std::vector< MonitorElement * > phiHistIsoMatchReco
Definition: EmDQMReco.h:190
double recoEtaAcc
Definition: EmDQMReco.h:121
bool isHltConfigInitialized_
Definition: EmDQMReco.h:113
HLTConfigProvider hltConfig_
Definition: EmDQMReco.h:112
FourVectorMonitorElements(EmDQMReco *_parent, DQMStore::IBooker &iBooker, const std::string &histogramNameTemplate, const std::string &histogramTitleTemplate)
Definition: EmDQMReco.cc:48
std::unique_ptr< FourVectorMonitorElements > histRecoMonpath
Definition: EmDQMReco.h:212
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
tuple d
Definition: ztail.py:151
std::vector< std::unique_ptr< FourVectorMonitorElements > > histMatchRecoMonPath
Definition: EmDQMReco.h:173
double recoEtAcc
Definition: EmDQMReco.h:122
std::vector< MonitorElement * > ethistiso
Definition: EmDQMReco.h:185
GreaterByPt< reco::Particle > pTComparator_
Definition: EmDQMReco.h:235
int iEvent
Definition: GenABIO.cc:224
std::vector< std::string > theHLTCollectionHumanNames
Definition: EmDQMReco.h:105
unsigned int numOfHLTCollectionLabels
Definition: EmDQMReco.h:102
HistoFillerReco< l1extra::L1EmParticleCollection > * histoFillerL1Iso
Definition: EmDQMReco.h:230
MonitorElement * totalreco
Definition: EmDQMReco.h:199
std::vector< std::unique_ptr< FourVectorMonitorElements > > histHltObjMatchToReco
Definition: EmDQMReco.h:178
EmDQMReco * dqm
Definition: EmDQMReco.h:43
MonitorElement * etaMonitorElement
Definition: EmDQMReco.h:75
edm::EDGetTokenT< std::vector< reco::SuperCluster > > recoObjectsEBT
Definition: EmDQMReco.h:149
void analyze(const edm::Event &event, const edm::EventSetup &) override
Definition: EmDQMReco.cc:589
HistoFillerReco(EmDQMReco *d)
Definition: EmDQMReco.h:31
MonitorElement * totalmatchreco
Definition: EmDQMReco.h:200
std::vector< MonitorElement * > histPhiIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:194
std::vector< MonitorElement * > phiHistIso
Definition: EmDQMReco.h:186
unsigned int recocut_
Definition: EmDQMReco.h:134
std::vector< Electron > ElectronCollection
collectin of Electron objects
Definition: ElectronFwd.h:9
std::string triggerNameRecoMonPath
Definition: EmDQMReco.h:138
std::vector< bool > plotiso
Definition: EmDQMReco.h:108
edm::EDGetTokenT< reco::GsfElectronCollection > recoElectronsInput
Definition: EmDQMReco.h:148
bool useHumanReadableHistTitles
Definition: EmDQMReco.h:104
double plotPhiMax
Definition: EmDQMReco.h:127
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerObjT
Definition: EmDQMReco.h:152
HistoFillerReco< l1extra::L1EmParticleCollection > * histoFillerL1NonIso
Definition: EmDQMReco.h:228
MonitorElement * phiMonitorElement
Definition: EmDQMReco.h:76
unsigned int reqNum
Definition: EmDQMReco.h:119
std::vector< MonitorElement * > ethistisomatchreco
Definition: EmDQMReco.h:189
std::vector< edm::InputTag > theHLTCollectionLabels
Definition: EmDQMReco.h:100
std::vector< std::pair< double, double > > plotBounds
Definition: EmDQMReco.h:110
GreaterByPt< reco::GsfElectron > pTRecoComparator_
Definition: EmDQMReco.h:236
edm::EDGetTokenT< edm::TriggerResults > hltResultsT
Definition: EmDQMReco.h:151
std::vector< MonitorElement * > histEtaIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:193
double plotPtMin
Definition: EmDQMReco.h:125
double plotPtMax
Definition: EmDQMReco.h:126
double plotEtaMax
Definition: EmDQMReco.h:124
std::string processNameRecoMonPath
Definition: EmDQMReco.h:143
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EmDQMReco.cc:207
std::unique_ptr< FourVectorMonitorElements > histMonpath
Definition: EmDQMReco.h:217
HistoFillerReco< reco::RecoEcalCandidateCollection > * histoFillerClu
Definition: EmDQMReco.h:227