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 
74 // tracker hit associator
76 
77 // ecal / hcal
84 
86 
87 //L1 trigger Menus etc
93 
101 
107 
108 // root objects
109 #include "TROOT.h"
110 #include "TSystem.h"
111 #include "TFile.h"
112 #include "TH1F.h"
113 #include "TH2F.h"
114 #include "TProfile.h"
115 #include "TDirectory.h"
116 #include "TTree.h"
117 
119 
120 public:
121  explicit IsolatedTracksNxN(const edm::ParameterSet&);
123 
124 private:
125  //void beginJob(const edm::EventSetup&) ;
126  void beginJob() ;
127  void analyze(const edm::Event&, const edm::EventSetup&);
128  void endJob() ;
129 
130  void printTrack(const reco::Track* pTrack);
131 
132  void BookHistograms();
133 
134  double DeltaPhi(double v1, double v2);
135  double DeltaR(double eta1, double phi1, double eta2, double phi2);
136 
137 
138  void clearTreeVectors();
139 
140 private:
141 
143 
145  static const size_t nL1BitsMax=128;
146 
147  // map of trig bit, algo name and num events passed
148  std::map< std::pair<unsigned int,std::string>, int> l1AlgoMap;
149  std::vector<unsigned int> m_triggerMaskAlgoTrig;
150 
156 
158 
162 
166 
169 
173 
181 
185 
187 
188  double genPartPBins[16], genPartEtaBins[4];
189 
190  static const size_t NPBins = 15;
191  static const size_t NEtaBins = 3;
192 
197 
200 
201  TH1F *h_nTracks;
202 
205 
208 
211 
212 
213 
214  TTree* tree;
215 
217 
219  std::vector<std::string> *t_L1AlgoNames;
220  std::vector<int> *t_L1PreScale;
221  int t_L1Decision[128];
222 
223  std::vector<double> *t_PVx, *t_PVy, *t_PVz, *t_PVTracksSumPt;
226  std::vector<int> *t_PVNTracksHP, *t_PVNTracksHPWt;
227 
228  std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
229  std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
230  std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
231  std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
232  std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
234  std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
235 
236  std::vector<double> *t_jetPt, *t_jetEta, *t_jetPhi;
237  std::vector<double> *t_nTrksJetCalo, *t_nTrksJetVtx;
238 
240  std::vector<double> *t_trackPtAll;
242 
243  std::vector<double> *t_trackP, *t_trackPt, *t_trackEta, *t_trackPhi;
245  std::vector<double> *t_trackDxy, *t_trackDxyBS, *t_trackDz, *t_trackDzBS;
246  std::vector<double> *t_trackDxyPV, *t_trackDzPV;
247  std::vector<double> *t_trackChiSq;
248  std::vector<int> *t_trackPVIdx;
249 
250  std::vector<int> *t_NLayersCrossed, *t_trackNOuterHits;
251  std::vector<int> *t_trackHitsTOB, *t_trackHitsTEC;
256  std::vector<double> *t_trackOutPosOutHitDr, *t_trackL;
257 
258  std::vector<double> *t_maxNearP31x31;
259  std::vector<double> *t_maxNearP21x21;
260 
261  std::vector<int> *t_ecalSpike11x11;
262  std::vector<double> *t_e7x7, *t_e9x9, *t_e11x11, *t_e15x15;
268 
269  std::vector<double> *t_esimPdgId, *t_simTrackP;
270 
271  std::vector<double> *t_trkEcalEne;
272 
273  std::vector<double> *t_esim7x7, *t_esim9x9, *t_esim11x11, *t_esim15x15;
279 
281  std::vector<double> *t_h3x3, *t_h5x5, *t_h7x7;
282  std::vector<double> *t_h3x3Sig, *t_h5x5Sig, *t_h7x7Sig;
283  std::vector<int> *t_infoHcal;
284 
285  std::vector<double> *t_trkHcalEne;
286  std::vector<double> *t_hsim3x3, *t_hsim5x5, *t_hsim7x7;
288  std::vector<double> *t_hsim3x3Rest, *t_hsim5x5Rest, *t_hsim7x7Rest;
292 
294  int nbad;
295 };
296 
297 #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
TrackerHitAssociator::Config trackerHitAssociatorConfig_
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