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 // Base Class Headers
20 #include "HepMC/GenParticle.h"
21 #include "TDirectory.h"
22 #include <vector>
23 
24 #include <boost/ptr_container/ptr_vector.hpp>
25 #include <boost/scoped_ptr.hpp>
26 
27 class EmDQMReco;
28 
29 template <class T>
31 public:
34 
36  const edm::Event &iEvent,
37  unsigned int n,
38  std::vector<reco::Particle> &sortedReco,
39  bool plotReco,
40  bool plotMonpath);
41  std::vector<edm::EDGetTokenT<edm::AssociationMap<edm::OneToValue<T, float>>>> isoNameTokens_;
42 
43 private:
45 };
46 
47 class EmDQMReco : public DQMEDAnalyzer {
48  //----------------------------------------
49 
54  public:
64  DQMStore::IBooker &iBooker,
65  const std::string &histogramNameTemplate,
66  const std::string &histogramTitleTemplate);
67 
68  void fill(const math::XYZTLorentzVector &momentum);
69 
70  private:
73 
78  };
79  //----------------------------------------
80 
81 public:
83  friend class HistoFillerReco<reco::RecoEcalCandidateCollection>;
84  friend class HistoFillerReco<l1extra::L1EmParticleCollection>;
85 
87  explicit EmDQMReco(const edm::ParameterSet &pset);
88 
90  ~EmDQMReco() override;
91 
92  // Operations
93  void analyze(const edm::Event &event, const edm::EventSetup &) override;
94  void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override;
95  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
96 
97 private:
98  // Input from cfg file
99 
101  std::vector<edm::InputTag> theHLTCollectionLabels;
102 
103  unsigned int numOfHLTCollectionLabels; // Will be size of above vector
104 
106  std::vector<std::string> theHLTCollectionHumanNames; // Human-readable names for the collections
107  // edm::InputTag theL1Seed;
108  std::vector<int> theHLTOutputTypes;
109  std::vector<bool> plotiso;
110  std::vector<std::vector<edm::InputTag>> isoNames; // there has to be a better solution
111  std::vector<std::pair<double, double>> plotBounds;
112  std::string theHltName;
113  HLTConfigProvider hltConfig_;
114  bool isHltConfigInitialized_;
115 
117  // Read from configuration file //
119  // parameters for generator study
120  unsigned int reqNum;
122  double recoEtaAcc;
123  double recoEtAcc;
124  // plotting paramters
125  double plotEtaMax;
126  double plotPtMin;
127  double plotPtMax;
128  double plotPhiMax;
129 
131  unsigned int plotBins;
132 
133  // preselction cuts
134  // edm::InputTag recocutCollection_;
135  unsigned int recocut_;
136 
139  std::string triggerNameRecoMonPath;
140 
144  std::string processNameRecoMonPath;
145 
149  edm::EDGetTokenT<reco::GsfElectronCollection> recoElectronsInput;
150  edm::EDGetTokenT<std::vector<reco::SuperCluster>> recoObjectsEBT;
151  edm::EDGetTokenT<std::vector<reco::SuperCluster>> recoObjectsEET;
152  edm::EDGetTokenT<edm::TriggerResults> hltResultsT;
153  edm::EDGetTokenT<trigger::TriggerEventWithRefs> triggerObjT;
155  // Create Histograms //
157 
160  // std::vector<MonitorElement*> etahist;
161  // std::vector<MonitorElement*> ethist;
162  // std::vector<MonitorElement*> phiHist;
163 
164  boost::ptr_vector<FourVectorMonitorElements> standardHist;
165 
166  // std::vector<MonitorElement*> etahistmatchreco;
167  // std::vector<MonitorElement*> ethistmatchreco;
168  // std::vector<MonitorElement*> phiHistMatchReco;
169  boost::ptr_vector<FourVectorMonitorElements> histMatchReco;
170 
171  // std::vector<MonitorElement*> etahistmatchrecomonpath;
172  // std::vector<MonitorElement*> ethistmatchrecomonpath;
173  // std::vector<MonitorElement*> phiHistMatchRecoMonPath;
174  boost::ptr_vector<FourVectorMonitorElements> histMatchRecoMonPath;
175 
176  // std::vector<MonitorElement*> histEtOfHltObjMatchToReco;
177  // std::vector<MonitorElement*> histEtaOfHltObjMatchToReco;
178  // std::vector<MonitorElement*> histPhiOfHltObjMatchToReco;
179  boost::ptr_vector<FourVectorMonitorElements> histHltObjMatchToReco;
180 
185  std::vector<MonitorElement *> etahistiso;
186  std::vector<MonitorElement *> ethistiso;
187  std::vector<MonitorElement *> phiHistIso;
188 
189  std::vector<MonitorElement *> etahistisomatchreco;
190  std::vector<MonitorElement *> ethistisomatchreco;
191  std::vector<MonitorElement *> phiHistIsoMatchReco;
192 
193  std::vector<MonitorElement *> histEtIsoOfHltObjMatchToReco;
194  std::vector<MonitorElement *> histEtaIsoOfHltObjMatchToReco;
195  std::vector<MonitorElement *> histPhiIsoOfHltObjMatchToReco;
200  MonitorElement *totalreco;
201  MonitorElement *totalmatchreco;
202 
205  // MonitorElement* etreco;
206  // MonitorElement* etareco;
207  // MonitorElement* phiReco;
208  boost::scoped_ptr<FourVectorMonitorElements> histReco;
209 
210  // MonitorElement* etrecomonpath;
211  // MonitorElement* etarecomonpath;
212  // MonitorElement* phiRecoMonPath;
213  boost::scoped_ptr<FourVectorMonitorElements> histRecoMonpath;
214 
215  // MonitorElement* etahistmonpath;
216  // MonitorElement* ethistmonpath;
217  // MonitorElement* phiHistMonPath;
218  boost::scoped_ptr<FourVectorMonitorElements> histMonpath;
221  int eventnum;
222  // int prescale;
223 
224  // interface to DQM framework
225  std::string dirname_;
226 
227  HistoFillerReco<reco::ElectronCollection> *histoFillerEle;
228  HistoFillerReco<reco::RecoEcalCandidateCollection> *histoFillerClu;
229  HistoFillerReco<l1extra::L1EmParticleCollection> *histoFillerL1NonIso;
230  HistoFillerReco<reco::RecoEcalCandidateCollection> *histoFillerPho;
231  HistoFillerReco<l1extra::L1EmParticleCollection> *histoFillerL1Iso;
232 
233  // template <class T> void
234  // fillHistos(edm::Handle<trigger::TriggerEventWithRefs>&,const edm::Event&
235  // ,unsigned int, std::vector<reco::Particle>&, bool, bool);
236  GreaterByPt<reco::Particle> pTComparator_;
237  GreaterByPt<reco::GsfElectron> pTRecoComparator_;
238 
239  //----------------------------------------
240 };
241 #endif
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:41
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:224
EmDQMReco * dqm
Definition: EmDQMReco.h:44
MonitorElement * etaMonitorElement
Definition: EmDQMReco.h:76
HistoFillerReco(EmDQMReco *d)
Definition: EmDQMReco.h:32
std::vector< Electron > ElectronCollection
collectin of Electron objects
Definition: ElectronFwd.h:9
d
Definition: ztail.py:151
MonitorElement * phiMonitorElement
Definition: EmDQMReco.h:77
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
fixed size matrix