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 
28 class EmDQMReco;
29 
30 template <class T>
32  public:
35 
36  void fillHistos(edm::Handle<trigger::TriggerEventWithRefs>& triggerObj,const edm::Event& iEvent ,unsigned int n, std::vector<reco::Particle>& sortedReco, bool plotReco, bool plotMonpath);
37  std::vector<edm::EDGetTokenT<edm::AssociationMap<edm::OneToValue< T , float>>>> isoNameTokens_;
38 
39  private:
41 };
42 
43 class EmDQMReco : public DQMEDAnalyzer{
44 
45  //----------------------------------------
46 
51  {
52 
53  public:
61  DQMStore::IBooker &iBooker,
62  const std::string &histogramNameTemplate,
63  const std::string &histogramTitleTemplate);
64 
65  void fill(const math::XYZTLorentzVector &momentum);
66 
67  private:
70 
75 
76  };
77  //----------------------------------------
78 
79 public:
80 
82  friend class HistoFillerReco<reco::RecoEcalCandidateCollection>;
83  friend class HistoFillerReco<l1extra::L1EmParticleCollection>;
84 
86  explicit EmDQMReco(const edm::ParameterSet& pset);
87 
89  ~EmDQMReco();
90 
91  // Operations
92 
93  void analyze(const edm::Event & event, const edm::EventSetup&);
94  void beginJob();
95  void endJob();
96  void dqmBeginRun( const edm::Run&, const edm::EventSetup& );
97  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
98 
99 private:
100  // Input from cfg file
101 
103  std::vector<edm::InputTag> theHLTCollectionLabels;
104 
105  unsigned int numOfHLTCollectionLabels; // Will be size of above vector
106 
108  std::vector<std::string> theHLTCollectionHumanNames; // Human-readable names for the collections
109  //edm::InputTag theL1Seed;
110  std::vector<int> theHLTOutputTypes;
111  std::vector<bool> plotiso;
112  std::vector<std::vector<edm::InputTag> > isoNames; // there has to be a better solution
113  std::vector<std::pair<double,double> > plotBounds;
117 
119  // Read from configuration file //
121  // parameters for generator study
122  unsigned int reqNum;
123  int pdgGen;
124  double recoEtaAcc;
125  double recoEtAcc;
126  // plotting paramters
127  double plotEtaMax;
128  double plotPtMin ;
129  double plotPtMax ;
130  double plotPhiMax;
131 
133  unsigned int plotBins ;
134 
135  // preselction cuts
136  //edm::InputTag recocutCollection_;
137  unsigned int recocut_;
138 
142 
147 
151  edm::EDGetTokenT<reco::GsfElectronCollection> recoElectronsInput;
152  edm::EDGetTokenT<std::vector<reco::SuperCluster>> recoObjectsEBT;
153  edm::EDGetTokenT<std::vector<reco::SuperCluster>> recoObjectsEET;
154  edm::EDGetTokenT<edm::TriggerResults> hltResultsT;
155  edm::EDGetTokenT<trigger::TriggerEventWithRefs> triggerObjT;
157  // Create Histograms //
159 
162 // std::vector<MonitorElement*> etahist;
163 // std::vector<MonitorElement*> ethist;
164 // std::vector<MonitorElement*> phiHist;
165 
166  boost::ptr_vector<FourVectorMonitorElements> standardHist;
167 
168 // std::vector<MonitorElement*> etahistmatchreco;
169 // std::vector<MonitorElement*> ethistmatchreco;
170 // std::vector<MonitorElement*> phiHistMatchReco;
171  boost::ptr_vector<FourVectorMonitorElements> histMatchReco;
172 
173 // std::vector<MonitorElement*> etahistmatchrecomonpath;
174 // std::vector<MonitorElement*> ethistmatchrecomonpath;
175 // std::vector<MonitorElement*> phiHistMatchRecoMonPath;
176  boost::ptr_vector<FourVectorMonitorElements> histMatchRecoMonPath;
177 
178 
179 // std::vector<MonitorElement*> histEtOfHltObjMatchToReco;
180 // std::vector<MonitorElement*> histEtaOfHltObjMatchToReco;
181 // std::vector<MonitorElement*> histPhiOfHltObjMatchToReco;
182  boost::ptr_vector<FourVectorMonitorElements> histHltObjMatchToReco;
183 
188  std::vector<MonitorElement*> etahistiso;
189  std::vector<MonitorElement*> ethistiso;
190  std::vector<MonitorElement*> phiHistIso;
191 
192  std::vector<MonitorElement*> etahistisomatchreco;
193  std::vector<MonitorElement*> ethistisomatchreco;
194  std::vector<MonitorElement*> phiHistIsoMatchReco;
195 
196  std::vector<MonitorElement*> histEtIsoOfHltObjMatchToReco;
197  std::vector<MonitorElement*> histEtaIsoOfHltObjMatchToReco;
198  std::vector<MonitorElement*> histPhiIsoOfHltObjMatchToReco;
205 
208 // MonitorElement* etreco;
209 // MonitorElement* etareco;
210 // MonitorElement* phiReco;
211  boost::scoped_ptr<FourVectorMonitorElements> histReco;
212 
213  // MonitorElement* etrecomonpath;
214  // MonitorElement* etarecomonpath;
215  // MonitorElement* phiRecoMonPath;
216  boost::scoped_ptr<FourVectorMonitorElements> histRecoMonpath;
217 
218  // MonitorElement* etahistmonpath;
219  // MonitorElement* ethistmonpath;
220  // MonitorElement* phiHistMonPath;
221  boost::scoped_ptr<FourVectorMonitorElements> histMonpath;
224  int eventnum;
225  // int prescale;
226 
227  // interface to DQM framework
229 
230  HistoFillerReco<reco::ElectronCollection>* histoFillerEle;
231  HistoFillerReco<reco::RecoEcalCandidateCollection>* histoFillerClu;
232  HistoFillerReco<l1extra::L1EmParticleCollection>* histoFillerL1NonIso;
233  HistoFillerReco<reco::RecoEcalCandidateCollection>* histoFillerPho;
234  HistoFillerReco<l1extra::L1EmParticleCollection>* histoFillerL1Iso;
235 
236  //template <class T> void fillHistos(edm::Handle<trigger::TriggerEventWithRefs>&,const edm::Event& ,unsigned int, std::vector<reco::Particle>&, bool, bool);
237  GreaterByPt<reco::Particle> pTComparator_;
238  GreaterByPt<reco::GsfElectron> pTRecoComparator_;
239 
240 
241  //----------------------------------------
242 };
243 #endif
int pdgGen
Definition: EmDQMReco.h:123
void fill(const math::XYZTLorentzVector &momentum)
Definition: EmDQMReco.cc:90
boost::ptr_vector< FourVectorMonitorElements > standardHist
Definition: EmDQMReco.h:166
std::vector< std::vector< edm::InputTag > > isoNames
Definition: EmDQMReco.h:112
void analyze(const edm::Event &event, const edm::EventSetup &)
Definition: EmDQMReco.cc:513
HistoFillerReco< reco::RecoEcalCandidateCollection > * histoFillerPho
Definition: EmDQMReco.h:233
std::string theHltName
Definition: EmDQMReco.h:114
HistoFillerReco< reco::ElectronCollection > * histoFillerEle
Definition: EmDQMReco.h:230
std::string dirname_
Definition: EmDQMReco.h:228
boost::ptr_vector< FourVectorMonitorElements > histMatchReco
Definition: EmDQMReco.h:171
int eventnum
Definition: EmDQMReco.h:224
void endJob()
Definition: EmDQMReco.cc:895
std::vector< MonitorElement * > histEtIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:196
std::vector< int > theHLTOutputTypes
Definition: EmDQMReco.h:110
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:153
std::vector< MonitorElement * > phiHistIso
Definition: EmDQMReco.h:190
unsigned int plotBins
Definition: EmDQMReco.h:133
std::vector< MonitorElement * > histEtaIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:197
double recoEtaAcc
Definition: EmDQMReco.h:124
bool isHltConfigInitialized_
Definition: EmDQMReco.h:116
HLTConfigProvider hltConfig_
Definition: EmDQMReco.h:115
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:176
double recoEtAcc
Definition: EmDQMReco.h:125
GreaterByPt< reco::Particle > pTComparator_
Definition: EmDQMReco.h:237
int iEvent
Definition: GenABIO.cc:230
std::vector< std::string > theHLTCollectionHumanNames
Definition: EmDQMReco.h:108
unsigned int numOfHLTCollectionLabels
Definition: EmDQMReco.h:105
HistoFillerReco< l1extra::L1EmParticleCollection > * histoFillerL1Iso
Definition: EmDQMReco.h:234
MonitorElement * totalreco
Definition: EmDQMReco.h:203
EmDQMReco * dqm
Definition: EmDQMReco.h:40
MonitorElement * etaMonitorElement
Definition: EmDQMReco.h:73
edm::EDGetTokenT< std::vector< reco::SuperCluster > > recoObjectsEBT
Definition: EmDQMReco.h:152
HistoFillerReco(EmDQMReco *d)
Definition: EmDQMReco.h:33
MonitorElement * totalmatchreco
Definition: EmDQMReco.h:204
unsigned int recocut_
Definition: EmDQMReco.h:137
std::vector< MonitorElement * > ethistisomatchreco
Definition: EmDQMReco.h:193
std::vector< Electron > ElectronCollection
collectin of Electron objects
Definition: ElectronFwd.h:9
std::string triggerNameRecoMonPath
Definition: EmDQMReco.h:141
std::vector< bool > plotiso
Definition: EmDQMReco.h:111
edm::EDGetTokenT< reco::GsfElectronCollection > recoElectronsInput
Definition: EmDQMReco.h:151
bool useHumanReadableHistTitles
Definition: EmDQMReco.h:107
double plotPhiMax
Definition: EmDQMReco.h:130
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerObjT
Definition: EmDQMReco.h:155
HistoFillerReco< l1extra::L1EmParticleCollection > * histoFillerL1NonIso
Definition: EmDQMReco.h:232
MonitorElement * phiMonitorElement
Definition: EmDQMReco.h:74
unsigned int reqNum
Definition: EmDQMReco.h:122
boost::scoped_ptr< FourVectorMonitorElements > histRecoMonpath
Definition: EmDQMReco.h:216
std::vector< MonitorElement * > etahistiso
Definition: EmDQMReco.h:188
boost::scoped_ptr< FourVectorMonitorElements > histMonpath
Definition: EmDQMReco.h:221
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
Definition: EmDQMReco.cc:203
std::vector< MonitorElement * > etahistisomatchreco
Definition: EmDQMReco.h:192
std::vector< std::pair< double, double > > plotBounds
Definition: EmDQMReco.h:113
std::vector< edm::EDGetTokenT< edm::AssociationMap< edm::OneToValue< T, float > > > > isoNameTokens_
Definition: EmDQMReco.h:37
std::vector< edm::InputTag > theHLTCollectionLabels
Definition: EmDQMReco.h:103
GreaterByPt< reco::GsfElectron > pTRecoComparator_
Definition: EmDQMReco.h:238
edm::EDGetTokenT< edm::TriggerResults > hltResultsT
Definition: EmDQMReco.h:154
double plotPtMin
Definition: EmDQMReco.h:128
double plotPtMax
Definition: EmDQMReco.h:129
boost::ptr_vector< FourVectorMonitorElements > histHltObjMatchToReco
Definition: EmDQMReco.h:182
double plotEtaMax
Definition: EmDQMReco.h:127
std::vector< MonitorElement * > ethistiso
Definition: EmDQMReco.h:189
std::string processNameRecoMonPath
Definition: EmDQMReco.h:146
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EmDQMReco.cc:214
boost::scoped_ptr< FourVectorMonitorElements > histReco
Definition: EmDQMReco.h:211
std::vector< MonitorElement * > phiHistIsoMatchReco
Definition: EmDQMReco.h:194
void beginJob()
std::vector< MonitorElement * > histPhiIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:198
HistoFillerReco< reco::RecoEcalCandidateCollection > * histoFillerClu
Definition: EmDQMReco.h:231