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() override;
31 
32  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
33  void analyze(const edm::Event&, const edm::EventSetup&) override;
34  void dqmEndRun(const edm::Run&, const edm::EventSetup&) override;
35 
36 private:
39 
42 };
43 
44 //-------------------------------------------------------------------------------
45 // code specific to Z --> e + tau-jet channel
46 //-------------------------------------------------------------------------------
47 
64 
65 #include <string>
66 
68 public:
71 
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_;
117  MonitorElement* hElectronPt_;
118  MonitorElement* hElectronEta_;
119  MonitorElement* hElectronPhi_;
120  MonitorElement* hElectronTrackIsoPt_;
121  MonitorElement* hElectronEcalIsoPt_;
122  // MonitorElement* hElectronHcalIsoPt_;
123 
124  MonitorElement* hTauJetPt_;
125  MonitorElement* hTauJetEta_;
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 
136  MonitorElement* hVisMass_;
137  // MonitorElement* hMtElecCaloMEt_;
138  MonitorElement* hMtElecPFMEt_;
139  // MonitorElement* hPzetaCaloMEt_;
140  // MonitorElement* hPzetaPFMEt_;
141  MonitorElement* hElecTauAcoplanarity_;
142  MonitorElement* hElecTauCharge_;
143 
144  // MonitorElement* hVertexChi2_;
145  MonitorElement* hVertexZ_;
146  // MonitorElement* hVertexD0_;
147 
148  MonitorElement* hCaloMEtPt_;
149  // MonitorElement* hCaloMEtPhi_;
150 
151  MonitorElement* hPFMEtPt_;
152  // MonitorElement* hPFMEtPhi_;
153 
154  MonitorElement* hCutFlowSummary_;
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 
214 #include <string>
215 
217 public:
220 
222 
224  void fillHistograms(const edm::Event&, const edm::EventSetup&);
225  void finalizeHistograms();
226 
227 private:
228  //--- labels of muon, tau-jet and MEt collections being used
229  // in event selection and when filling histograms
237 
243 
244  //--- event selection criteria
245  typedef std::vector<std::string> vstring;
246  vstring hltPaths_;
247 
248  double muonEtaCut_;
249  double muonPtCut_;
254 
256  double tauJetPtCut_;
257 
258  double visMassCut_;
259  double deltaRCut_;
260 
261  //--- name of DQM directory in which histograms for Z --> muon + tau-jet
262  // channel get stored
264 
265  //--- histograms
266  // MonitorElement* hNumGlobalMuons_;
267  MonitorElement* hMuonPt_;
268  MonitorElement* hMuonEta_;
269  MonitorElement* hMuonPhi_;
270  MonitorElement* hMuonTrackIsoPt_;
271  MonitorElement* hMuonEcalIsoPt_;
272  MonitorElement* hMuonCombIsoPt_;
273 
274  MonitorElement* hTauJetPt_;
275  MonitorElement* hTauJetEta_;
276  MonitorElement* hTauJetPhi_;
277  MonitorElement* hTauLeadTrackPt_;
278  MonitorElement* hTauTrackIsoPt_;
279  MonitorElement* hTauEcalIsoPt_;
280  MonitorElement* hTauDiscrAgainstMuons_;
281  MonitorElement* hTauJetCharge_;
282  MonitorElement* hTauJetNumSignalTracks_;
283  MonitorElement* hTauJetNumIsoTracks_;
284 
285  MonitorElement* hVisMass_;
286  MonitorElement* hMuTauDeltaR_;
287  MonitorElement* hVisMassFinal_;
288  // MonitorElement* hMtMuCaloMEt_;
289  MonitorElement* hMtMuPFMEt_;
290  // MonitorElement* hPzetaCmaxNumWarnings_aloMEt_;
291  // MonitorElement* hPzetaPFMEt_;
292  MonitorElement* hMuTauAcoplanarity_;
293  // MonitorElement* hMuTauCharge_;
294 
295  // MonitorElement* hVertexChi2_;
296  MonitorElement* hVertexZ_;
297  // MonitorElement* hVertexD0_;
298 
299  MonitorElement* hCaloMEtPt_;
300  // MonitorElement* hCaloMEtPhi_;
301 
302  MonitorElement* hPFMEtPt_;
303  // MonitorElement* hPFMEtPhi_;
304 
305  MonitorElement* hCutFlowSummary_;
306  enum {
307  kPassedPreselection = 1,
308  kPassedTrigger = 2,
309  kPassedMuonId = 3,
310  kPassedTauLeadTrack = 4,
311  kPassedTauLeadTrackPt = 5,
312  kPassedTauDiscrAgainstMuons = 6,
313  kPassedDeltaR = 7,
314  kPassedMuonTrackIso = 8,
315  kPassedMuonEcalIso = 9,
316  kPassedTauTrackIso = 10,
317  kPassedTauEcalIso = 11
318  };
319 
320  //--- counters for filter-statistics output
323 
325 
327 
341 };
342 
343 //-------------------------------------------------------------------------------
344 // common auxiliary functions used by different channels
345 //-------------------------------------------------------------------------------
346 
367 
368 #include <string>
369 
371 
372 template <typename T>
373 void readEventData(const edm::Event& evt,
374  const edm::InputTag& src,
376  long& numWarnings,
377  int maxNumWarnings,
378  bool& error,
379  const char* errorMessage) {
380  if (!evt.getByLabel(src, handle)) {
381  if (numWarnings < maxNumWarnings || maxNumWarnings == -1)
382  edm::LogWarning("readEventData") << errorMessage << " !!";
383  ++numWarnings;
384  error = true;
385  }
386 }
387 
388 int getIsoMode(const std::string&, int&);
389 
390 double calcDeltaPhi(double, double);
391 double calcMt(double, double, double, double);
392 double calcPzeta(const reco::Candidate::LorentzVector&, const reco::Candidate::LorentzVector&, double, double);
393 
396 
397 const reco::GsfElectron* getTheElectron(const reco::GsfElectronCollection&, double, double);
398 const reco::Muon* getTheMuon(const reco::MuonCollection&, double, double);
399 const reco::PFTau* getTheTauJet(const reco::PFTauCollection&, double, double, int&);
400 
401 double getVertexD0(const reco::Vertex&, const reco::BeamSpot&);
402 
403 #endif
MonitorElement * hCutFlowSummary_
Definition: EwkTauDQM.h:305
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:241
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:186
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:232
double muonCombIsoCut_
Definition: EwkTauDQM.h:252
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:151
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:238
MonitorElement * hTauJetPhi_
Definition: EwkTauDQM.h:276
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:236
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:1075
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:240
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:338
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:136
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: EwkTauDQM.cc:50
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:89
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:337
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:336
MonitorElement * hMuonPhi_
Definition: EwkTauDQM.h:269
std::vector< std::string > vstring
Definition: EwkTauDQM.h:245
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:121
MonitorElement * hTauEcalIsoPt_
Definition: EwkTauDQM.h:279
std::string dqmDirectory_
Definition: EwkTauDQM.h:37
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:183
double electronEcalIsoCut_
Definition: EwkTauDQM.h:103
unsigned numEventsSelected_
Definition: EwkTauDQM.h:171
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:302
unsigned numEventsSelected_
Definition: EwkTauDQM.h:322
std::string dqmDirectory_
Definition: EwkTauDQM.h:263
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:239
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EwkTauDQM.cc:45
~EwkTauDQM() override
Definition: EwkTauDQM.cc:40
EwkTauDQM::MonitorElement MonitorElement
Definition: EwkTauDQM.h:70
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:280
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
MonitorElement * hMuonEcalIsoPt_
Definition: EwkTauDQM.h:271
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:185
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:142
double muonTrackIsoCut_
Definition: EwkTauDQM.h:250
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:231
MonitorElement * hElectronTrackIsoPt_
Definition: EwkTauDQM.h:120
MonitorElement * hTauJetNumSignalTracks_
Definition: EwkTauDQM.h:282
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:234
MonitorElement * hMuonEta_
Definition: EwkTauDQM.h:268
const reco::GsfElectron * getTheElectron(const reco::GsfElectronCollection &, double, double)
Definition: EwkTauDQM.cc:1102
double calcPzeta(const reco::Candidate::LorentzVector &, const reco::Candidate::LorentzVector &, double, double)
Definition: EwkTauDQM.cc:1048
void dqmEndRun(const edm::Run &, const edm::EventSetup &) override
Definition: EwkTauDQM.cc:55
int getIsoMode(const std::string &, int &)
Definition: EwkTauDQM.cc:1012
EwkTauDQM::DQMStore DQMStore
Definition: EwkTauDQM.h:218
MonitorElement * hVisMassFinal_
Definition: EwkTauDQM.h:287
MonitorElement * hTauLeadTrackPt_
Definition: EwkTauDQM.h:277
EwkElecTauHistManager * elecTauHistManager_
Definition: EwkTauDQM.h:40
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:118
double calcMt(double, double, double, double)
Definition: EwkTauDQM.cc:1038
int maxNumWarnings_
Definition: EwkTauDQM.h:38
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:235
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:328
std::string dqmDirectory_
Definition: EwkTauDQM.h:113
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:188
MonitorElement * hMtMuPFMEt_
Definition: EwkTauDQM.h:289
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:148
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:274
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:92
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:296
MonitorElement * hTauJetCharge_
Definition: EwkTauDQM.h:281
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:124
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
MonitorElement * hTauTrackIsoPt_
Definition: EwkTauDQM.h:278
MonitorElement * hElectronPhi_
Definition: EwkTauDQM.h:119
const reco::PFTau * getTheTauJet(const reco::PFTauCollection &, double, double, int &)
Definition: EwkTauDQM.cc:1132
edm::InputTag tauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:93
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:299
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:334
MonitorElement * hMuonPt_
Definition: EwkTauDQM.h:267
bool passesElectronId(const reco::GsfElectron &)
Definition: EwkTauDQM.cc:1085
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:91
double calcDeltaPhi(double, double)
Definition: EwkTauDQM.cc:1026
MonitorElement * hMuTauDeltaR_
Definition: EwkTauDQM.h:286
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:177
double getVertexD0(const reco::Vertex &, const reco::BeamSpot &)
Definition: EwkTauDQM.cc:1154
edm::InputTag muonSource_
Definition: EwkTauDQM.h:233
MonitorElement * hMuTauAcoplanarity_
Definition: EwkTauDQM.h:292
MonitorElement * hTauJetNumIsoTracks_
Definition: EwkTauDQM.h:283
MonitorElement * hMuonCombIsoPt_
Definition: EwkTauDQM.h:272
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:41
const reco::Muon * getTheMuon(const reco::MuonCollection &, double, double)
Definition: EwkTauDQM.cc:1119
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:373
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:275
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:85
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:81
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:321
EwkTauDQM::MonitorElement MonitorElement
Definition: EwkTauDQM.h:219
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:230
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:125
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:242
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:285
MonitorElement * hMuonTrackIsoPt_
Definition: EwkTauDQM.h:270
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:170
long numWarningsTauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:187
EwkTauDQM::DQMStore DQMStore
Definition: EwkTauDQM.h:69
EwkTauDQM(const edm::ParameterSet &)
Definition: EwkTauDQM.cc:20
MonitorElement * hElectronPt_
Definition: EwkTauDQM.h:117
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:138
Definition: Run.h:45
double muonEcalIsoCut_
Definition: EwkTauDQM.h:251
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:335