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