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() 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 
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 fillHistos(edm::Handle<trigger::TriggerEventWithRefs>&,const edm::Event& ,unsigned int, std::vector<reco::Particle>&, bool, bool);
235  GreaterByPt<reco::Particle> pTComparator_;
236  GreaterByPt<reco::GsfElectron> pTRecoComparator_;
237 
238 
239  //----------------------------------------
240 };
241 #endif
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
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
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
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
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