CMS 3D CMS Logo

EwkTauDQM.h
Go to the documentation of this file.
1 #ifndef DQM_Physics_EwkTauDQM_h
2 #define DQM_Physics_EwkTauDQM_h
3 
20 
21 #include <string>
22 #include <Math/VectorUtil.h>
23 
26 
27 class EwkTauDQM : public DQMEDAnalyzer {
28  public:
30  ~EwkTauDQM();
31 
33  edm::EventSetup const&) override;
34  void analyze(const edm::Event&, const edm::EventSetup&) override;
35  void endRun(const edm::Run&, const edm::EventSetup&) override;
36 
37  private:
40 
43 };
44 
45 //-------------------------------------------------------------------------------
46 // code specific to Z --> e + tau-jet channel
47 //-------------------------------------------------------------------------------
48 
65 
67 
68 #include <string>
69 
71  public:
73 
75  void fillHistograms(const edm::Event&, const edm::EventSetup&);
76  void finalizeHistograms();
77 
78  private:
79  //--- labels of electron, tau-jet and MEt collections being used
80  // in event selection and when filling histograms
88 
95 
96  //--- event selection criteria
97  typedef std::vector<std::string> vstring;
98  vstring hltPaths_;
99 
105 
107  double tauJetPtCut_;
108 
109  double visMassCut_;
110 
111  //--- name of DQM directory in which histograms for Z --> electron + tau-jet
112  // channel get stored
114 
115  //--- histograms
116  // MonitorElement* hNumIdElectrons_;
122  // MonitorElement* hElectronHcalIsoPt_;
123 
126  // MonitorElement* hTauJetPhi_;
127  // MonitorElement* hTauLeadTrackPt_;
128  // MonitorElement* hTauTrackIsoPt_;
129  // MonitorElement* hTauEcalIsoPt_;
130  // MonitorElement* hTauDiscrAgainstElectrons_;
131  // MonitorElement* hTauDiscrAgainstMuons_;
132  // MonitorElement* hTauJetCharge_;
133  // MonitorElement* hTauJetNumSignalTracks_;
134  // MonitorElement* hTauJetNumIsoTracks_;
135 
137  // MonitorElement* hMtElecCaloMEt_;
139  // MonitorElement* hPzetaCaloMEt_;
140  // MonitorElement* hPzetaPFMEt_;
143 
144  // MonitorElement* hVertexChi2_;
146  // MonitorElement* hVertexD0_;
147 
149  // MonitorElement* hCaloMEtPhi_;
150 
152  // MonitorElement* hPFMEtPhi_;
153 
155  enum {
156  kPassedPreselection = 1,
157  kPassedTrigger = 2,
158  kPassedElectronId = 3,
159  kPassedElectronTrackIso = 4,
160  kPassedElectronEcalIso = 5,
161  kPassedTauLeadTrack = 6,
162  kPassedTauLeadTrackPt = 7,
163  kPassedTauDiscrAgainstElectrons = 8,
164  kPassedTauDiscrAgainstMuons = 9,
165  kPassedTauTrackIso = 10,
166  kPassedTauEcalIso = 11
167  };
168 
169  //--- counters for filter-statistics output
172 
174 
176 
191 };
192 
193 //-------------------------------------------------------------------------------
194 // code specific to Z --> mu + tau-jet channel
195 //-------------------------------------------------------------------------------
196 
213 
215 
216 #include <string>
217 
219  public:
221 
223  void fillHistograms(const edm::Event&, const edm::EventSetup&);
224  void finalizeHistograms();
225 
226  private:
227  //--- labels of muon, tau-jet and MEt collections being used
228  // in event selection and when filling histograms
236 
242 
243  //--- event selection criteria
244  typedef std::vector<std::string> vstring;
245  vstring hltPaths_;
246 
247  double muonEtaCut_;
248  double muonPtCut_;
253 
255  double tauJetPtCut_;
256 
257  double visMassCut_;
258  double deltaRCut_;
259 
260  //--- name of DQM directory in which histograms for Z --> muon + tau-jet
261  // channel get stored
263 
264  //--- histograms
265  // MonitorElement* hNumGlobalMuons_;
272 
283 
287  // MonitorElement* hMtMuCaloMEt_;
289  // MonitorElement* hPzetaCmaxNumWarnings_aloMEt_;
290  // MonitorElement* hPzetaPFMEt_;
292  // MonitorElement* hMuTauCharge_;
293 
294  // MonitorElement* hVertexChi2_;
296  // MonitorElement* hVertexD0_;
297 
299  // MonitorElement* hCaloMEtPhi_;
300 
302  // MonitorElement* hPFMEtPhi_;
303 
305  enum {
306  kPassedPreselection = 1,
307  kPassedTrigger = 2,
308  kPassedMuonId = 3,
309  kPassedTauLeadTrack = 4,
310  kPassedTauLeadTrackPt = 5,
311  kPassedTauDiscrAgainstMuons = 6,
312  kPassedDeltaR = 7,
313  kPassedMuonTrackIso = 8,
314  kPassedMuonEcalIso = 9,
315  kPassedTauTrackIso = 10,
316  kPassedTauEcalIso = 11
317  };
318 
319  //--- counters for filter-statistics output
322 
324 
326 
340 };
341 
342 //-------------------------------------------------------------------------------
343 // common auxiliary functions used by different channels
344 //-------------------------------------------------------------------------------
345 
366 
367 #include <string>
368 
370 
371 template <typename T>
372 void readEventData(const edm::Event& evt, const edm::InputTag& src,
373  edm::Handle<T>& handle, long& numWarnings,
374  int maxNumWarnings, bool& error, const char* errorMessage) {
375  if (!evt.getByLabel(src, handle)) {
376  if (numWarnings < maxNumWarnings || maxNumWarnings == -1)
377  edm::LogWarning("readEventData") << errorMessage << " !!";
378  ++numWarnings;
379  error = true;
380  }
381 }
382 
383 int getIsoMode(const std::string&, int&);
384 
385 double calcDeltaPhi(double, double);
386 double calcMt(double, double, double, double);
388  const reco::Candidate::LorentzVector&, double, double);
389 
392 
394  double, double);
395 const reco::Muon* getTheMuon(const reco::MuonCollection&, double, double);
396 const reco::PFTau* getTheTauJet(const reco::PFTauCollection&, double, double,
397  int&);
398 
399 double getVertexD0(const reco::Vertex&, const reco::BeamSpot&);
400 
401 #endif
MonitorElement * hCutFlowSummary_
Definition: EwkTauDQM.h:304
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:240
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:186
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:231
double muonCombIsoCut_
Definition: EwkTauDQM.h:251
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:151
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:237
MonitorElement * hTauJetPhi_
Definition: EwkTauDQM.h:275
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:235
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:83
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
bool passesElectronPreId(const reco::GsfElectron &)
Definition: EwkTauDQM.cc:1074
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:90
MonitorElement * hElecTauAcoplanarity_
Definition: EwkTauDQM.h:141
edm::InputTag electronSource_
Definition: EwkTauDQM.h:84
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:239
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:337
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:136
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: EwkTauDQM.cc:64
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:89
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:336
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:335
MonitorElement * hMuonPhi_
Definition: EwkTauDQM.h:268
std::vector< std::string > vstring
Definition: EwkTauDQM.h:244
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:121
MonitorElement * hTauEcalIsoPt_
Definition: EwkTauDQM.h:278
std::string dqmDirectory_
Definition: EwkTauDQM.h:38
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:183
double electronEcalIsoCut_
Definition: EwkTauDQM.h:103
unsigned numEventsSelected_
Definition: EwkTauDQM.h:171
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:301
unsigned numEventsSelected_
Definition: EwkTauDQM.h:321
std::string dqmDirectory_
Definition: EwkTauDQM.h:262
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:238
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EwkTauDQM.cc:57
MonitorElement * hCutFlowSummary_
Definition: EwkTauDQM.h:154
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:184
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:86
double electronTrackIsoCut_
Definition: EwkTauDQM.h:102
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:94
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:145
MonitorElement * hTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:279
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
MonitorElement * hMuonEcalIsoPt_
Definition: EwkTauDQM.h:270
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:185
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:142
double muonTrackIsoCut_
Definition: EwkTauDQM.h:249
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:230
MonitorElement * hElectronTrackIsoPt_
Definition: EwkTauDQM.h:120
MonitorElement * hTauJetNumSignalTracks_
Definition: EwkTauDQM.h:281
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:233
MonitorElement * hMuonEta_
Definition: EwkTauDQM.h:267
const reco::GsfElectron * getTheElectron(const reco::GsfElectronCollection &, double, double)
Definition: EwkTauDQM.cc:1104
double calcPzeta(const reco::Candidate::LorentzVector &, const reco::Candidate::LorentzVector &, double, double)
Definition: EwkTauDQM.cc:1048
int getIsoMode(const std::string &, int &)
Definition: EwkTauDQM.cc:1013
MonitorElement * hVisMassFinal_
Definition: EwkTauDQM.h:286
MonitorElement * hTauLeadTrackPt_
Definition: EwkTauDQM.h:276
EwkElecTauHistManager * elecTauHistManager_
Definition: EwkTauDQM.h:41
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:118
double calcMt(double, double, double, double)
Definition: EwkTauDQM.cc:1038
int maxNumWarnings_
Definition: EwkTauDQM.h:39
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:234
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:327
std::string dqmDirectory_
Definition: EwkTauDQM.h:113
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:188
MonitorElement * hMtMuPFMEt_
Definition: EwkTauDQM.h:288
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:148
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:273
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:92
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:295
MonitorElement * hTauJetCharge_
Definition: EwkTauDQM.h:280
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:124
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:416
MonitorElement * hTauTrackIsoPt_
Definition: EwkTauDQM.h:277
MonitorElement * hElectronPhi_
Definition: EwkTauDQM.h:119
const reco::PFTau * getTheTauJet(const reco::PFTauCollection &, double, double, int &)
Definition: EwkTauDQM.cc:1135
edm::InputTag tauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:93
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:298
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:333
MonitorElement * hMuonPt_
Definition: EwkTauDQM.h:266
bool passesElectronId(const reco::GsfElectron &)
Definition: EwkTauDQM.cc:1086
~EwkTauDQM()
Definition: EwkTauDQM.cc:52
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:91
double calcDeltaPhi(double, double)
Definition: EwkTauDQM.cc:1028
MonitorElement * hMuTauDeltaR_
Definition: EwkTauDQM.h:285
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:177
double getVertexD0(const reco::Vertex &, const reco::BeamSpot &)
Definition: EwkTauDQM.cc:1156
edm::InputTag muonSource_
Definition: EwkTauDQM.h:232
MonitorElement * hMuTauAcoplanarity_
Definition: EwkTauDQM.h:291
MonitorElement * hTauJetNumIsoTracks_
Definition: EwkTauDQM.h:282
MonitorElement * hMuonCombIsoPt_
Definition: EwkTauDQM.h:271
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:82
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:87
EwkMuTauHistManager * muTauHistManager_
Definition: EwkTauDQM.h:42
const reco::Muon * getTheMuon(const reco::MuonCollection &, double, double)
Definition: EwkTauDQM.cc:1121
std::vector< std::string > vstring
Definition: EwkTauDQM.h:97
void readEventData(const edm::Event &evt, const edm::InputTag &src, edm::Handle< T > &handle, long &numWarnings, int maxNumWarnings, bool &error, const char *errorMessage)
Definition: EwkTauDQM.h:372
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:274
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:85
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:81
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:320
void endRun(const edm::Run &, const edm::EventSetup &) override
Definition: EwkTauDQM.cc:69
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:229
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:125
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:241
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:284
MonitorElement * hMuonTrackIsoPt_
Definition: EwkTauDQM.h:269
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:170
long numWarningsTauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:187
EwkTauDQM(const edm::ParameterSet &)
Definition: EwkTauDQM.cc:22
MonitorElement * hElectronPt_
Definition: EwkTauDQM.h:117
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:138
Definition: Run.h:42
double muonEcalIsoCut_
Definition: EwkTauDQM.h:250
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:334