CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TauAnalyzer.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TauAnalyzer
4 // Class: L1TauAnalyzer
5 //
13 //
14 // Original Author: Chi Nhan Nguyen
15 // Created: Fri Feb 22 09:20:55 CST 2008
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 #include <vector>
23 #include <string>
24 #include <iostream>
25 #include <iomanip>
26 
27 // user include files
33 
36 
38 #include <Math/GenVector/VectorUtil.h>
39 #include "TLorentzVector.h"
40 
41 #include "FWCore/ServiceRegistry/interface/Service.h" // Framework services
42 #include "CommonTools/UtilAlgos/interface/TFileService.h" // Framework service for histograms
43 
44 #include "TH1.h"
45 
46 // L1 Trigger data formats
63 
64 //
65 // class decleration
66 //
67 
69  public:
70  explicit L1TauAnalyzer(const edm::ParameterSet&);
72 
73 
74  private:
75  virtual void beginJob() ;
76  virtual void analyze(const edm::Event&, const edm::EventSetup&);
77  virtual void endJob() ;
78 
79 
80  void getGenObjects(const edm::Event&, const edm::EventSetup&);
81  void getPFTauObjects(const edm::Event&, const edm::EventSetup&);
82  void getL1extraObjects(const edm::Event&, const edm::EventSetup&);
83 
84  void fillL1Histograms();
85  void fillGenHistograms();
86  void fillPFTauHistograms();
87 
88  void evalL1Decisions(const edm::Event& iEvent);
89  void evalL1extraDecisions();
90 
91  void calcL1MCTauMatching();
92  void calcL1MCPFTauMatching();
93 
94  void convertToIntegratedEff(TH1*,double);
95  void printTrigReport();
96 
97  // ----------member data ---------------------------
98 
102 
110 
113 
116 
117  // PDG id for
119 
120  // Cuts
124 
126  double _PFTauMinEt;
128 
129  // Thresholds of L1 menu
132  std::vector<double> _SingleTauMETThresholds;
133  std::vector<double> _MuTauThresholds;
134  std::vector<double> _IsoEgTauThresholds;
135 
136  // L1 menu names
142 
143  // Gen Objects
144  std::vector<TLorentzVector> _GenTauMuons;
145  std::vector<TLorentzVector> _GenTauElecs;
146  std::vector<TLorentzVector> _GenTauHads;
147 
148  // Tagged PFTau Objects
149  std::vector<TLorentzVector> _PFTaus;
150 
151  // L1extra Objects
152  std::vector<TLorentzVector> _L1Taus;
153  std::vector<TLorentzVector> _L1CenJets;
154  std::vector<TLorentzVector> _L1ForJets;
155  std::vector<TLorentzVector> _L1NonIsoEgammas;
156  std::vector<TLorentzVector> _L1IsoEgammas;
157  std::vector<TLorentzVector> _L1METs;
158  std::vector<TLorentzVector> _L1Muons;
159  std::vector<int> _L1MuQuals;
160 
161 
162  // histograms
163  TH1* h_L1TauEt;
166 
170 
174 
175  //
179 
180  //
181  TH1* h_PFTauEt;
184 
185  // L1 response
189 
190  // MC matching efficiencies
194  // Numerators
198  // Denominators
202 
203  // MCPF matching efficiencies
207  // Numerators
211  // Denominators
215 
217 
218 
219  // Event based efficiencies as a function of thresholds
226 
227 // Counters for event based efficiencies
228  int _nEvents; // all events processed
229 
234 
239 
244 
248 
252 
256 
260 
264 
265  // from GT bit info
271 
272 };
273 
274 //
275 // constants, enums and typedefs
276 //
277 
278 //
279 // static data member definitions
280 //
281 
double _PFMCTauMinDeltaR
TH1 * h_MCPFTauHadEta
TH1 * h_L1MCMatchedTauEta
TH1 * h_L1DoubleTauEffPFMCMatchEt
void evalL1Decisions(const edm::Event &iEvent)
int _nfidEventsDoubleGenTauHads
int _nEventsL1GTIsoEgTauPassed
double _L1MCTauMinDeltaR
TH1 * h_EffMCPFTauEt
int _nEventsPFMatchGenTauElecTauHad
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1extraNonIsoEgammaSource
int _nEventsL1IsoEgTauPassedMCMatched
double _SingleTauThreshold
TH1 * h_L1SingleTauEffEt
std::vector< double > _MuTauThresholds
TH1 * h_L1MCPFMatchedTauEt
int _nEventsL1GTDoubleTauPassed
std::vector< TLorentzVector > _GenTauElecs
void calcL1MCPFTauMatching()
TH1 * h_L1DoubleTauEffMCMatchEt
TH1 * h_MCPFTauHadEt
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< TLorentzVector > _L1ForJets
void getL1extraObjects(const edm::Event &, const edm::EventSetup &)
TH1 * h_PFMCTauDeltaR
std::string _L1SingleTauName
TH1 * h_L1MCPFMatchedTauPhi
int _nEventsL1SingleTauPassedPFMCMatched
std::vector< TLorentzVector > _GenTauMuons
int _nEventsPFMatchGenTauHad
edm::EDGetTokenT< reco::PFTauCollection > _PFTauSource
Definition: L1TauAnalyzer.h:99
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1extraCenJetSource
int _nfidEventsGenTauHad
std::vector< TLorentzVector > _PFTaus
TH1 * h_L1MCPFMatchedTauEta
int _nEventsGenTauMuonTauHad
TH1 * h_L1MCMatchedTauPhi
int _nEventsL1SingleTauPassed
double _PFTauMinEt
TH1 * h_MCPFTauHadPhi
std::vector< TLorentzVector > _L1IsoEgammas
int _nEventsL1GTSingleTauPassed
std::vector< TLorentzVector > _GenTauHads
int iEvent
Definition: GenABIO.cc:230
std::vector< TLorentzVector > _L1CenJets
edm::EDGetTokenT< l1extra::L1EmParticleCollection > _L1extraIsoEgammaSource
int _nEventsL1GTSingleTauMETPassed
TH1 * h_L1DoubleTauEffEt
void fillL1Histograms()
TH1 * h_L1minusMCoverMCTauEt
void convertToIntegratedEff(TH1 *, double)
std::vector< int > _L1MuQuals
int _nEventsL1IsoEgTauPassedPFMCMatched
void fillPFTauHistograms()
double _MCTauHadMaxAbsEta
int _nEventsL1SingleTauMETPassedPFMCMatched
std::vector< TLorentzVector > _L1METs
int _nEventsL1IsoEgTauPassed
int _nEventsGenTauElecTauHad
TH1 * h_L1MCMatchedTauEt
TH1 * h_L1SingleTauEffPFMCMatchEt
virtual void endJob()
double _PFTauMaxAbsEta
int _nfidEventsGenTauElecTauHad
std::vector< TLorentzVector > _L1Muons
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > _L1GtReadoutRecord
int _nEventsL1DoubleTauPassedMCMatched
int _nEventsL1DoubleTauPassed
TH1 * h_L1minusMCTauEt
TH1 * h_EffMCPFTauPhi
virtual void beginJob()
int _nEventsL1MuonTauPassedPFMCMatched
void getPFTauObjects(const edm::Event &, const edm::EventSetup &)
std::vector< double > _IsoEgTauThresholds
int _nEventsL1SingleTauMETPassed
TH1 * h_L1MCTauDeltaR
void getGenObjects(const edm::Event &, const edm::EventSetup &)
std::vector< TLorentzVector > _L1NonIsoEgammas
int _nEventsPFMatchGenTauMuonTauHad
std::vector< TLorentzVector > _L1Taus
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1extraForJetSource
std::string _L1TauMETName
int _nEventsL1SingleTauMETPassedMCMatched
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > _L1GtObjectMap
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > _L1extraMuonSource
int _nEventsL1DoubleTauPassedPFMCMatched
std::string _L1MuonTauName
std::string _L1IsoEgTauName
int _nEventsL1MuonTauPassedMCMatched
void printTrigReport()
edm::EDGetTokenT< l1extra::L1JetParticleCollection > _L1extraTauJetSource
edm::EDGetTokenT< edm::HepMCProduct > _GenParticleSource
int _nfidEventsGenTauMuonTauHad
double _MCTauHadMinEt
void fillGenHistograms()
int _nEventsDoubleGenTauHads
TH1 * h_GenTauHadEta
double _DoubleTauThreshold
int _nEventsL1MuonTauPassed
TH1 * h_GenTauHadPhi
L1TauAnalyzer(const edm::ParameterSet &)
int _nEventsPFMatchDoubleGenTauHads
int _nEventsL1SingleTauPassedMCMatched
std::string _L1DoubleTauName
std::vector< double > _SingleTauMETThresholds
void calcL1MCTauMatching()
void evalL1extraDecisions()
TH1 * h_L1SingleTauEffMCMatchEt
TH1 * h_EffMCPFTauEta
int _nEventsL1GTMuonTauPassed
edm::EDGetTokenT< reco::PFTauDiscriminatorByIsolation > _PFTauDiscriminatorSource
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > _L1extraMETSource