CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IsolatedTracksNxN.h
Go to the documentation of this file.
1 #ifndef CalibrationIsolatedParticlesIsolatedTracksNxN_h
2 #define CalibrationIsolatedParticlesIsolatedTracksNxN_h
3 
4 // system include files
5 #include <memory>
6 #include <cmath>
7 #include <string>
8 #include <map>
9 #include <vector>
10 
11 // user include files
12 #include <Math/GenVector/VectorUtil.h>
13 
20 
22 
23 // TFile Service
26 
31 
32 // muons and tracks
36 // Vertices
40 // Calorimeters
47 
48 //L1 objects
55 
56 // Jets in the event
60 
61 // SimHit
63 //simtrack
68 
69 // track associator
73 // ecal / hcal
80 
82 
83 //L1 trigger Menus etc
89 
97 
103 
104 // root objects
105 #include "TROOT.h"
106 #include "TSystem.h"
107 #include "TFile.h"
108 #include "TH1F.h"
109 #include "TH2F.h"
110 #include "TProfile.h"
111 #include "TDirectory.h"
112 #include "TTree.h"
113 
115 
116 public:
117  explicit IsolatedTracksNxN(const edm::ParameterSet&);
119 
120 private:
121  //void beginJob(const edm::EventSetup&) ;
122  void beginJob() ;
123  void analyze(const edm::Event&, const edm::EventSetup&);
124  void endJob() ;
125 
126  void printTrack(const reco::Track* pTrack);
127 
128  void BookHistograms();
129 
130  double DeltaPhi(double v1, double v2);
131  double DeltaR(double eta1, double phi1, double eta2, double phi2);
132 
133 
134  void clearTreeVectors();
135 
136 private:
137 
139 
141  static const size_t nL1BitsMax=128;
142 
143  // map of trig bit, algo name and num events passed
144  std::map< std::pair<unsigned int,std::string>, int> l1AlgoMap;
145  std::vector<unsigned int> m_triggerMaskAlgoTrig;
146 
152 
156 
160 
163 
167 
175 
179 
181 
182  double genPartPBins[16], genPartEtaBins[4];
183 
184  static const size_t NPBins = 15;
185  static const size_t NEtaBins = 3;
186 
191 
194 
195  TH1F *h_nTracks;
196 
199 
202 
205 
206 
207 
208  TTree* tree;
209 
211 
213  std::vector<std::string> *t_L1AlgoNames;
214  std::vector<int> *t_L1PreScale;
215  int t_L1Decision[128];
216 
217  std::vector<double> *t_PVx, *t_PVy, *t_PVz, *t_PVTracksSumPt;
220  std::vector<int> *t_PVNTracksHP, *t_PVNTracksHPWt;
221 
222  std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
223  std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
224  std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
225  std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
226  std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
228  std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
229 
230  std::vector<double> *t_jetPt, *t_jetEta, *t_jetPhi;
231  std::vector<double> *t_nTrksJetCalo, *t_nTrksJetVtx;
232 
234  std::vector<double> *t_trackPtAll;
236 
237  std::vector<double> *t_trackP, *t_trackPt, *t_trackEta, *t_trackPhi;
239  std::vector<double> *t_trackDxy, *t_trackDxyBS, *t_trackDz, *t_trackDzBS;
240  std::vector<double> *t_trackDxyPV, *t_trackDzPV;
241  std::vector<double> *t_trackChiSq;
242  std::vector<int> *t_trackPVIdx;
243 
244  std::vector<int> *t_NLayersCrossed, *t_trackNOuterHits;
245  std::vector<int> *t_trackHitsTOB, *t_trackHitsTEC;
250  std::vector<double> *t_trackOutPosOutHitDr, *t_trackL;
251 
252  std::vector<double> *t_maxNearP31x31;
253  std::vector<double> *t_maxNearP21x21;
254 
255  std::vector<int> *t_ecalSpike11x11;
256  std::vector<double> *t_e7x7, *t_e9x9, *t_e11x11, *t_e15x15;
262 
263  std::vector<double> *t_esimPdgId, *t_simTrackP;
264 
265  std::vector<double> *t_trkEcalEne;
266 
267  std::vector<double> *t_esim7x7, *t_esim9x9, *t_esim11x11, *t_esim15x15;
273 
275  std::vector<double> *t_h3x3, *t_h5x5, *t_h7x7;
276  std::vector<double> *t_h3x3Sig, *t_h5x5Sig, *t_h7x7Sig;
277  std::vector<int> *t_infoHcal;
278 
279  std::vector<double> *t_trkHcalEne;
280  std::vector<double> *t_hsim3x3, *t_hsim5x5, *t_hsim7x7;
282  std::vector<double> *t_hsim3x3Rest, *t_hsim5x5Rest, *t_hsim7x7Rest;
286 
288  int nbad;
289 };
290 
291 #endif
std::vector< double > * t_hsim7x7CharHad
double DeltaPhi(double v1, double v2)
std::vector< double > * t_hsim3x3Matched
std::vector< double > * t_esim7x7CharHad
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extCenJet_
std::vector< double > * t_e15x15
std::vector< double > * t_nTrksJetCalo
std::vector< double > * t_maxNearHcalP7x7
std::vector< double > * t_trackPt
std::vector< double > * t_trackPAll
std::vector< double > * t_e7x7
std::vector< double > * t_trackHcalPhi
std::vector< double > * t_trackDxyPVAll
std::vector< int > * t_trackHitOutMeasTEC
std::vector< double > * t_trackPdgIdAll
std::vector< double > * t_trackOutPosOutHitDr
std::vector< double > * t_maxNearHcalP5x5
std::vector< double > * t_L1NonIsoEMPt
std::vector< int > * t_trackHitOutMeasTIB
std::vector< double > * t_esim7x7
std::vector< int > * t_trackHitInMissTOB
std::vector< double > * t_trackDz
std::vector< double > * t_trackEcalEta
std::vector< double > * t_trackEtaAll
std::vector< double > * t_esim11x11Matched
std::vector< double > * t_L1IsoEMEta
std::vector< double > * t_PVTracksSumPt
std::vector< double > * t_e9x9_10Sig
TH1F * h_maxNearP25x25[NPBins][NEtaBins]
std::vector< double > * t_hsim3x3CharHad
std::vector< int > * t_PVndof
std::vector< double > * t_hsim7x7Rest
std::vector< double > * t_L1TauJetPhi
std::vector< double > * t_PVTracksSumPtWt
std::vector< int > * t_infoHcal
std::vector< double > * t_e11x11_15Sig
static const size_t NEtaBins
std::vector< double > * t_L1TauJetPt
std::vector< int > * t_PVNTracksWt
std::vector< double > * t_trackEcalPhi
std::vector< double > * t_esim11x11NeutHad
std::vector< double > * t_L1TauJetEta
std::vector< double > * t_e15x15_15Sig
std::vector< double > * t_L1MuonEta
std::vector< double > * t_L1MuonPt
std::vector< double > * t_h3x3
std::vector< double > * t_L1MuonPhi
std::vector< double > * t_trackDxyAll
std::vector< double > * t_maxNearHcalP3x3
IsolatedTracksNxN(const edm::ParameterSet &)
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
std::vector< double > * t_hsim3x3Photon
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
std::vector< double > * t_PVTracksSumPtHP
std::vector< double > * t_esim11x11Rest
std::vector< int > * t_trackNOuterHits
std::vector< double > * t_h7x7Sig
std::vector< double > * t_e15x15_30Sig
std::vector< double > * t_trackPhiAll
std::vector< double > * t_e7x7_25Sig
std::vector< double > * t_trkHcalEne
std::vector< double > * t_e7x7_20Sig
std::vector< double > * t_e11x11_10Sig
std::vector< double > * t_trackPtAll
std::vector< double > * t_h3x3Sig
edm::Service< TFileService > fs
std::vector< double > * t_esimPdgId
std::vector< double > * t_e11x11_20Sig
std::vector< double > * t_jetEta
std::map< std::pair< unsigned int, std::string >, int > l1AlgoMap
std::vector< double > * t_maxNearP31x31
std::vector< int > * t_trackHitInMissTEC
std::vector< double > * t_trackEta
std::vector< double > * t_esim9x9Photon
std::vector< int > * t_trackHitInMeasTID
std::vector< double > * t_hsim5x5Rest
std::vector< double > * t_e11x11
std::vector< double > * t_esim15x15
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
std::vector< double > * t_L1CenJetPt
std::vector< double > * t_trackChiSqAll
std::vector< double > * t_e15x15_25Sig
std::vector< int > * t_trackHitOutMissTIB
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
std::vector< double > * t_esim15x15Rest
std::vector< double > * t_esim11x11
std::vector< double > * t_hsim7x7
std::vector< int > * t_PVNTracksHPWt
std::vector< int > * t_trackHitOutMissTID
std::vector< int > * t_trackHitOutMissTOBTEC
std::vector< int > * t_trackHitsTEC
std::vector< double > * t_e9x9_30Sig
const MagneticField * bField
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
std::vector< double > * t_L1CenJetPhi
std::vector< double > * t_L1FwdJetEta
std::vector< double > * t_h7x7
std::vector< int > * t_ecalSpike11x11
std::vector< double > * t_esim15x15NeutHad
std::vector< double > * t_e9x9_20Sig
std::vector< int > * t_trackHitOutMeasTOB
std::vector< int > * t_trackHitInMeasTIB
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
std::vector< double > * t_trackDzPV
std::vector< int > * t_PVNTracksHP
std::vector< double > * t_L1FwdJetPhi
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extFwdJet_
edm::EDGetTokenT< l1extra::L1EmParticleCollection > tok_L1extIsoEm_
std::vector< double > * t_nTrksJetVtx
std::vector< double > * t_esim7x7NeutHad
std::vector< double > * t_hsim3x3NeutHad
std::vector< double > * t_L1NonIsoEMPhi
std::vector< double > * t_trackDzBS
void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< int > * t_trackHitOutMissTOB
std::vector< double > * t_L1CenJetEta
std::vector< double > * t_trackDzPVAll
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > tok_L1extMu_
std::vector< double > * t_esim7x7Matched
std::vector< double > * t_esim9x9
std::vector< double > * t_hsim5x5
std::vector< double > * t_h5x5
std::vector< double > * t_trackDxyPV
std::vector< double > * t_hsim5x5NeutHad
std::vector< double > * t_trackChiSq
std::vector< double > * t_hsim5x5Photon
std::vector< double > * t_PVy
std::vector< unsigned int > m_triggerMaskAlgoTrig
std::vector< int > * t_L1PreScale
std::vector< double > * t_hsim3x3Rest
std::vector< int > * t_PVisValid
std::vector< double > * t_esim9x9Rest
std::vector< double > * t_L1METPhi
std::vector< int > * t_trackHitInMissTIB
std::vector< double > * t_e9x9_15Sig
std::vector< double > * t_e7x7_15Sig
std::vector< double > * t_trackPhi
std::vector< double > * t_e7x7_10Sig
std::vector< double > * t_trkEcalEne
edm::EDGetTokenT< l1extra::L1EmParticleCollection > tok_L1extNoIsoEm_
std::vector< double > * t_trackDzAll
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
TH1F * h_maxNearP31x31[NPBins][NEtaBins]
std::vector< double > * t_esim11x11CharHad
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
TH1F * h_maxNearP15x15[NPBins][NEtaBins]
std::vector< double > * t_e9x9_25Sig
std::vector< double > * t_esim7x7Photon
std::vector< double > * t_esim9x9NeutHad
std::vector< double > * t_L1FwdJetPt
std::vector< double > * t_simTrackP
std::vector< double > * t_hsim7x7Matched
std::vector< int > * t_trackPVIdx
static const size_t nL1BitsMax
std::vector< int > * t_trackHitsTOB
std::vector< double > * t_esim9x9Matched
std::vector< double > * t_hsim7x7NeutHad
std::vector< double > * t_L1IsoEMPhi
std::vector< int > * t_PVNTracks
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< double > * t_maxNearP21x21
std::vector< double > * t_L1NonIsoEMEta
std::vector< double > * t_PVz
void printTrack(const reco::Track *pTrack)
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_PVTracksSumPtHPWt
std::vector< double > * t_trackDxy
std::vector< std::string > * t_L1AlgoNames
std::vector< double > * t_hsim5x5CharHad
std::vector< double > * t_e15x15_10Sig
TH1F * h_maxNearP21x21[NPBins][NEtaBins]
std::vector< double > * t_jetPhi
std::vector< double > * t_trackL
std::vector< double > * t_esim7x7Rest
std::vector< double > * t_trackDxyBS
std::vector< double > * t_trackHcalEta
std::vector< double > * t_L1METPt
std::vector< int > * t_NLayersCrossed
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
double DeltaR(double eta1, double phi1, double eta2, double phi2)
std::vector< int > * t_trackHitInMeasTOB
std::vector< double > * t_PVx
std::vector< int > * t_trackHitInMeasTEC
std::vector< double > * t_esim15x15Photon
std::vector< double > * t_e9x9
std::vector< double > * t_hsim5x5Matched
std::vector< double > * t_esim15x15Matched
std::vector< int > * t_trackHitOutMeasTID
std::vector< double > * t_L1METEta
std::vector< double > * t_e7x7_30Sig
std::vector< int > * t_trackHitOutMissTEC
std::vector< double > * t_e11x11_25Sig
std::vector< double > * t_hsim3x3
std::vector< double > * t_trackP
static const size_t NPBins
std::vector< double > * t_hsim7x7Photon
std::vector< double > * t_jetPt
std::vector< double > * t_L1IsoEMPt
std::vector< double > * t_esim11x11Photon
std::vector< double > * t_h5x5Sig
std::vector< int > * t_trackHitInMissTID
std::vector< double > * t_e11x11_30Sig
std::vector< int > * t_trackHitInMissTIBTID
std::vector< double > * t_esim9x9CharHad
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extTauJet_
std::vector< double > * t_esim15x15CharHad