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;
146  unsigned int m_numberDaqPartitions;
149  std::vector<unsigned int> m_triggerMaskAlgoTrig;
150 
158  edm::InputTag L1GTReadoutRcdSource_, L1GTObjectMapRcdSource_; // there is no associated data access
161 
165 
169 
172 
176 
184 
188 
190 
191  double genPartPBins[16], genPartEtaBins[4];
192 
193  static const size_t NPBins = 15;
194  static const size_t NEtaBins = 3;
195 
200 
203 
204  TH1F *h_nTracks;
205 
208 
211 
214 
215 
216 
217  TTree* tree;
218 
220 
222  std::vector<std::string> *t_L1AlgoNames;
223  std::vector<int> *t_L1PreScale;
224  int t_L1Decision[128];
225 
226  std::vector<double> *t_PVx, *t_PVy, *t_PVz, *t_PVTracksSumPt;
229  std::vector<int> *t_PVNTracksHP, *t_PVNTracksHPWt;
230 
231  std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
232  std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
233  std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
234  std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
235  std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
237  std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
238 
239  std::vector<double> *t_jetPt, *t_jetEta, *t_jetPhi;
240  std::vector<double> *t_nTrksJetCalo, *t_nTrksJetVtx;
241 
243  std::vector<double> *t_trackPtAll;
245 
246  std::vector<double> *t_trackP, *t_trackPt, *t_trackEta, *t_trackPhi;
248  std::vector<double> *t_trackDxy, *t_trackDxyBS, *t_trackDz, *t_trackDzBS;
249  std::vector<double> *t_trackDxyPV, *t_trackDzPV;
250  std::vector<double> *t_trackChiSq;
251  std::vector<int> *t_trackPVIdx;
252 
253  std::vector<int> *t_NLayersCrossed, *t_trackNOuterHits;
254  std::vector<int> *t_trackHitsTOB, *t_trackHitsTEC;
259  std::vector<double> *t_trackOutPosOutHitDr, *t_trackL;
260 
261  std::vector<double> *t_maxNearP31x31;
262  std::vector<double> *t_maxNearP25x25;
263  std::vector<double> *t_maxNearP21x21;
264  std::vector<double> *t_maxNearP15x15;
265 
266  std::vector<int> *t_ecalSpike11x11;
267  std::vector<double> *t_e7x7, *t_e9x9, *t_e11x11, *t_e15x15;
273 
274  std::vector<double> *t_esimPdgId, *t_simTrackP;
275 
276  std::vector<double> *t_trkEcalEne;
277 
278  std::vector<double> *t_esim7x7, *t_esim9x9, *t_esim11x11, *t_esim15x15;
284 
286  std::vector<double> *t_h3x3, *t_h5x5, *t_h7x7;
287  std::vector<double> *t_h3x3Sig, *t_h5x5Sig, *t_h7x7Sig;
288  std::vector<int> *t_infoHcal;
289 
290  std::vector<double> *t_trkHcalEne;
291  std::vector<double> *t_hsim3x3, *t_hsim5x5, *t_hsim7x7;
293  std::vector<double> *t_hsim3x3Rest, *t_hsim5x5Rest, *t_hsim7x7Rest;
297 
299  int nbad;
300 };
301 
302 #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
edm::InputTag JetExtender_
edm::InputTag L1extraCenJetSource_
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
edm::InputTag L1extraIsoEmSource_
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
edm::InputTag L1GTReadoutRcdSource_
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
edm::InputTag L1extraFwdJetSource_
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
edm::InputTag L1extraTauJetSource_
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
edm::InputTag HBHERecHitSource_
std::vector< int > * t_trackHitsTEC
std::vector< double > * t_e9x9_30Sig
const MagneticField * bField
std::vector< double > * t_maxNearP25x25
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
unsigned int m_numberDaqPartitions
number of DAQ partitions
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_maxNearP15x15
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
edm::InputTag L1extraNonIsoEmSource_
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
edm::InputTag L1extraMuonSource_
std::vector< int > * t_NLayersCrossed
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
double DeltaR(double eta1, double phi1, double eta2, double phi2)
edm::InputTag JetSrc_
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks &amp; veto masks
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
edm::InputTag L1GTObjectMapRcdSource_
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