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 // $Id: L1TauAnalyzer.h,v 1.4 2010/01/12 06:38:12 hegner Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 #include <vector>
24 #include <string>
25 #include <iostream>
26 #include <iomanip>
27 
28 // user include files
34 
37 
39 #include <Math/GenVector/VectorUtil.h>
40 #include "TLorentzVector.h"
41 
42 #include "FWCore/ServiceRegistry/interface/Service.h" // Framework services
43 #include "CommonTools/UtilAlgos/interface/TFileService.h" // Framework service for histograms
44 
45 #include "TH1.h"
46 
47 // L1 Trigger data formats
64 
65 //
66 // class decleration
67 //
68 
70  public:
71  explicit L1TauAnalyzer(const edm::ParameterSet&);
73 
74 
75  private:
76  virtual void beginJob() ;
77  virtual void analyze(const edm::Event&, const edm::EventSetup&);
78  virtual void endJob() ;
79 
80 
81  void getGenObjects(const edm::Event&, const edm::EventSetup&);
82  void getPFTauObjects(const edm::Event&, const edm::EventSetup&);
83  void getL1extraObjects(const edm::Event&, const edm::EventSetup&);
84 
85  void fillL1Histograms();
86  void fillGenHistograms();
87  void fillPFTauHistograms();
88 
89  void evalL1Decisions(const edm::Event& iEvent);
90  void evalL1extraDecisions();
91 
92  void calcL1MCTauMatching();
93  void calcL1MCPFTauMatching();
94 
95  void convertToIntegratedEff(TH1*,double);
96  void printTrigReport();
97 
98  // ----------member data ---------------------------
99 
103 
111 
114 
117 
118  // PDG id for
120 
121  // Cuts
125 
127  double _PFTauMinEt;
129 
130  // Thresholds of L1 menu
133  std::vector<double> _SingleTauMETThresholds;
134  std::vector<double> _MuTauThresholds;
135  std::vector<double> _IsoEgTauThresholds;
136 
137  // L1 menu names
138  std::string _L1SingleTauName;
139  std::string _L1DoubleTauName;
140  std::string _L1TauMETName;
141  std::string _L1MuonTauName;
142  std::string _L1IsoEgTauName;
143 
144  // Gen Objects
145  std::vector<TLorentzVector> _GenTauMuons;
146  std::vector<TLorentzVector> _GenTauElecs;
147  std::vector<TLorentzVector> _GenTauHads;
148 
149  // Tagged PFTau Objects
150  std::vector<TLorentzVector> _PFTaus;
151 
152  // L1extra Objects
153  std::vector<TLorentzVector> _L1Taus;
154  std::vector<TLorentzVector> _L1CenJets;
155  std::vector<TLorentzVector> _L1ForJets;
156  std::vector<TLorentzVector> _L1NonIsoEgammas;
157  std::vector<TLorentzVector> _L1IsoEgammas;
158  std::vector<TLorentzVector> _L1METs;
159  std::vector<TLorentzVector> _L1Muons;
160  std::vector<int> _L1MuQuals;
161 
162 
163  // histograms
164  TH1* h_L1TauEt;
167 
171 
175 
176  //
180 
181  //
182  TH1* h_PFTauEt;
185 
186  // L1 response
190 
191  // MC matching efficiencies
195  // Numerators
199  // Denominators
203 
204  // MCPF matching efficiencies
208  // Numerators
212  // Denominators
216 
218 
219 
220  // Event based efficiencies as a function of thresholds
227 
228 // Counters for event based efficiencies
229  int _nEvents; // all events processed
230 
235 
240 
245 
249 
253 
257 
261 
265 
266  // from GT bit info
272 
273 };
274 
275 //
276 // constants, enums and typedefs
277 //
278 
279 //
280 // static data member definitions
281 //
282 
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
int _nEventsL1IsoEgTauPassedMCMatched
double _SingleTauThreshold
TH1 * h_L1SingleTauEffEt
std::vector< double > _MuTauThresholds
TH1 * h_L1MCPFMatchedTauEt
int _nEventsL1GTDoubleTauPassed
std::vector< TLorentzVector > _GenTauElecs
edm::InputTag _L1extraIsoEgammaSource
void calcL1MCPFTauMatching()
TH1 * h_L1DoubleTauEffMCMatchEt
TH1 * h_MCPFTauHadEt
edm::InputTag _PFTauSource
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< TLorentzVector > _L1ForJets
void getL1extraObjects(const edm::Event &, const edm::EventSetup &)
edm::InputTag _PFTauDiscriminatorSource
TH1 * h_PFMCTauDeltaR
std::string _L1SingleTauName
TH1 * h_L1MCPFMatchedTauPhi
edm::InputTag _GenParticleSource
int _nEventsL1SingleTauPassedPFMCMatched
std::vector< TLorentzVector > _GenTauMuons
int _nEventsPFMatchGenTauHad
int _nfidEventsGenTauHad
edm::InputTag _L1extraCenJetSource
std::vector< TLorentzVector > _PFTaus
TH1 * h_L1MCPFMatchedTauEta
edm::InputTag _L1extraTauJetSource
int _nEventsGenTauMuonTauHad
TH1 * h_L1MCMatchedTauPhi
int _nEventsL1SingleTauPassed
double _PFTauMinEt
TH1 * h_MCPFTauHadPhi
edm::InputTag _L1GtReadoutRecord
std::vector< TLorentzVector > _L1IsoEgammas
int _nEventsL1GTSingleTauPassed
std::vector< TLorentzVector > _GenTauHads
int iEvent
Definition: GenABIO.cc:243
std::vector< TLorentzVector > _L1CenJets
int _nEventsL1GTSingleTauMETPassed
TH1 * h_L1DoubleTauEffEt
void fillL1Histograms()
edm::InputTag _L1extraMuonSource
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
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
std::string _L1TauMETName
int _nEventsL1SingleTauMETPassedMCMatched
int _nEventsL1DoubleTauPassedPFMCMatched
std::string _L1MuonTauName
std::string _L1IsoEgTauName
edm::InputTag _L1extraForJetSource
int _nEventsL1MuonTauPassedMCMatched
void printTrigReport()
int _nfidEventsGenTauMuonTauHad
double _MCTauHadMinEt
edm::InputTag _L1extraNonIsoEgammaSource
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()
edm::InputTag _L1extraMETSource
void evalL1extraDecisions()
edm::InputTag _L1GtObjectMap
TH1 * h_L1SingleTauEffMCMatchEt
TH1 * h_EffMCPFTauEta
int _nEventsL1GTMuonTauPassed