CMS 3D CMS Logo

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&) override;
95  void beginJob();
96  void endJob();
97  void dqmBeginRun( const edm::Run&, const edm::EventSetup& ) override;
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;
115  std::string theHltName;
116  HLTConfigProvider hltConfig_;
117  bool isHltConfigInitialized_;
118 
120  // Read from configuration file //
122  // parameters for generator study
123  unsigned int reqNum;
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 
142  std::string triggerNameRecoMonPath;
143 
147  std::string processNameRecoMonPath;
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;
204  MonitorElement* totalreco;
205  MonitorElement* totalmatchreco;
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
229  std::string dirname_;
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
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
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
void bookHistograms(fwlite::EventContainer &eventCont)
void beginJob()
Definition: Breakpoints.cc:15
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:230
EmDQMReco * dqm
Definition: EmDQMReco.h:41
MonitorElement * etaMonitorElement
Definition: EmDQMReco.h:74
HistoFillerReco(EmDQMReco *d)
Definition: EmDQMReco.h:34
std::vector< Electron > ElectronCollection
collectin of Electron objects
Definition: ElectronFwd.h:9
MonitorElement * phiMonitorElement
Definition: EmDQMReco.h:75
std::vector< edm::EDGetTokenT< edm::AssociationMap< edm::OneToValue< T, float > > > > isoNameTokens_
Definition: EmDQMReco.h:38
fixed size matrix