CMS 3D CMS Logo

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