CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IsolatedTracksCone.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 #ifndef CalibrationIsolatedParticlesIsolatedTracksCone_h
4 #define CalibrationIsolatedParticlesIsolatedTracksCone_h
5 
6 // system include files
7 #include <memory>
8 #include <cmath>
9 #include <string>
10 #include <map>
11 #include <vector>
12 
13 // user include files
14 #include <Math/GenVector/VectorUtil.h>
15 
22 
24 
25 //TFile Service
28 
38 // muons and tracks
42 // Vertices
45 //L1 objects
48 // SimHit
50 //simtrack
55 
56 // track associator
60 
61 // ecal / hcal
69 
72 
78 
79 // root objects
80 #include "TROOT.h"
81 #include "TSystem.h"
82 #include "TFile.h"
83 #include "TH1F.h"
84 #include "TH2F.h"
85 #include "TProfile.h"
86 #include "TDirectory.h"
87 #include "TTree.h"
88 
89 #include <cmath>
90 
92 public:
93  explicit IsolatedTracksCone(const edm::ParameterSet&);
95 
96  // static const int NEtaBins = 4;
97  static const int NEtaBins = 4;
98  static const int NPTBins = 21;
99  static const int NPBins = 21;
100 
101  double genPartPBins[22], genPartEtaBins[5];
102 
103 private:
104  virtual void beginJob(const edm::EventSetup&) ;
105  virtual void analyze(const edm::Event&, const edm::EventSetup&);
106  virtual void endJob() ;
107 
108  void printTrack(const reco::Track* pTrack);
109 
110  // void BookHistograms();
111  void BuildTree();
112  void clearTrackVectors();
113 
114  double DeltaPhi(double v1, double v2);
115  double DeltaR(double eta1, double phi1, double eta2, double phi2);
116 
119  bool doMC;
124 
126 
128 
130 
131  // track associator to detector parameters
134 
135  TTree* ntp;
136 
137  TH1F* hRawPt ;
138  TH1F* hRawP ;
139  TH1F* hRawEta;
140  TH1F* hRawPhi;
141 
142  int nRawTRK ;
144  int nFailPt ;
145  int nFailEta ;
146  int nMissEcal ;
147  int nMissHcal ;
148  int nEVT;
150  int nTRK;
151 // double hbScale;
152 // double heScale;
153  double leadL1JetPT;
154  double leadL1JetEta;
155  double leadL1JetPhi;
156 
157  std::vector<std::vector<int> >* t_v_hnNearTRKs ;
158  std::vector<std::vector<int> >* t_v_hnLayers_maxNearP;
159  std::vector<std::vector<int> >* t_v_htrkQual_maxNearP;
160  std::vector<std::vector<double> >* t_v_hmaxNearP_goodTrk;
161  std::vector<std::vector<double> >* t_v_hmaxNearP ;
162 
163  std::vector<std::vector<int> >* t_v_cone_hnNearTRKs ;
164  std::vector<std::vector<int> >* t_v_cone_hnLayers_maxNearP;
165  std::vector<std::vector<int> >* t_v_cone_htrkQual_maxNearP;
166  std::vector<std::vector<double> >* t_v_cone_hmaxNearP_goodTrk;
167  std::vector<std::vector<double> >* t_v_cone_hmaxNearP ;
168 
169  // std::vector<double>* t_hScale ;
170  std::vector<double>* t_trkNOuterHits ;
171  std::vector<double>* t_trkNLayersCrossed;
172  std::vector<double>* t_dtFromLeadJet ;
173  std::vector<double>* t_trkP ;
174  std::vector<double>* t_simP ;
175  std::vector<double>* t_trkPt ;
176  std::vector<double>* t_trkEta ;
177  std::vector<double>* t_trkPhi ;
178  std::vector<double>* t_e3x3 ;
179 
180  std::vector<std::vector<double> > *t_v_eDR;
181  std::vector<std::vector<double> > *t_v_eMipDR;
182 
183  std::vector<double>* t_h3x3 ;
184  std::vector<double>* t_h5x5 ;
185  std::vector<double>* t_hsim3x3 ;
186  std::vector<double>* t_hsim5x5 ;
187 
188  std::vector<double>* t_nRH_h3x3 ;
189  std::vector<double>* t_nRH_h5x5 ;
190  std::vector<double>* t_nRH_h3x3dR ;
191  std::vector<double>* t_nRH_h5x5dR ;
192  std::vector<double>* t_nRH_h7x7dR ;
193  std::vector<double>* t_nRH_h9x9dR ;
194  std::vector<double>* t_nRH_h40cm ;
195 
196  std::vector<double>* t_nRH_hsim3x3dR ;
197  std::vector<double>* t_nRH_hsim5x5dR ;
198  std::vector<double>* t_nRH_hsim7x7dR ;
199  std::vector<double>* t_nRH_hsim9x9dR ;
200  std::vector<double>* t_nRH_hsim40cm ;
201 
202  std::vector<double>* t_hsim3x3Matched ;
203  std::vector<double>* t_hsim5x5Matched ;
204  std::vector<double>* t_hsim3x3Rest ;
205  std::vector<double>* t_hsim5x5Rest ;
206  std::vector<double>* t_hsim3x3Photon ;
207  std::vector<double>* t_hsim5x5Photon ;
208  std::vector<double>* t_hsim3x3NeutHad ;
209  std::vector<double>* t_hsim5x5NeutHad ;
210  std::vector<double>* t_hsim3x3CharHad ;
211  std::vector<double>* t_hsim5x5CharHad ;
212  std::vector<double>* t_hsim3x3PdgMatched;
213  std::vector<double>* t_hsim5x5PdgMatched;
214  std::vector<double>* t_hsim3x3Total ;
215  std::vector<double>* t_hsim5x5Total ;
216 
217  std::vector<int>* t_hsim3x3NMatched ;
218  std::vector<int>* t_hsim3x3NRest ;
219  std::vector<int>* t_hsim3x3NPhoton ;
220  std::vector<int>* t_hsim3x3NNeutHad ;
221  std::vector<int>* t_hsim3x3NCharHad ;
222  std::vector<int>* t_hsim3x3NTotal ;
223 
224  std::vector<int>* t_hsim5x5NMatched ;
225  std::vector<int>* t_hsim5x5NRest ;
226  std::vector<int>* t_hsim5x5NPhoton ;
227  std::vector<int>* t_hsim5x5NNeutHad ;
228  std::vector<int>* t_hsim5x5NCharHad ;
229  std::vector<int>* t_hsim5x5NTotal ;
230 
231  std::vector<double>* t_distFromHotCell_h3x3;
232  std::vector<int>* t_ietaFromHotCell_h3x3;
233  std::vector<int>* t_iphiFromHotCell_h3x3;
234  std::vector<double>* t_distFromHotCell_h5x5;
235  std::vector<int>* t_ietaFromHotCell_h5x5;
236  std::vector<int>* t_iphiFromHotCell_h5x5;
237 
238  std::vector<double>* t_trkHcalEne ;
239  std::vector<double>* t_trkEcalEne ;
240 
241  std::vector<std::vector<double> >* t_v_hsimInfoConeMatched ;
242  std::vector<std::vector<double> >* t_v_hsimInfoConeRest ;
243  std::vector<std::vector<double> >* t_v_hsimInfoConePhoton ;
244  std::vector<std::vector<double> >* t_v_hsimInfoConeNeutHad ;
245  std::vector<std::vector<double> >* t_v_hsimInfoConeCharHad ;
246  std::vector<std::vector<double> >* t_v_hsimInfoConePdgMatched;
247  std::vector<std::vector<double> >* t_v_hsimInfoConeTotal ;
248 
249  std::vector<std::vector<int> >* t_v_hsimInfoConeNMatched ;
250  std::vector<std::vector<int> >* t_v_hsimInfoConeNRest ;
251  std::vector<std::vector<int> >* t_v_hsimInfoConeNPhoton ;
252  std::vector<std::vector<int> >* t_v_hsimInfoConeNNeutHad ;
253  std::vector<std::vector<int> >* t_v_hsimInfoConeNCharHad ;
254  std::vector<std::vector<int> >* t_v_hsimInfoConeNTotal ;
255 
256  std::vector<std::vector<double> >* t_v_hsimCone ;
257  std::vector<std::vector<double> >* t_v_hCone ;
258  std::vector<std::vector<int> >* t_v_nRecHitsCone;
259  std::vector<std::vector<int> >* t_v_nSimHitsCone;
260 
261  std::vector<std::vector<double> >* t_v_distFromHotCell;
262  std::vector<std::vector<int> >* t_v_ietaFromHotCell;
263  std::vector<std::vector<int> >* t_v_iphiFromHotCell;
264 
265 
266  std::vector<std::vector<int> >* t_v_hlTriggers;
267  std::vector<int>* t_hltHB;
268  std::vector<int>* t_hltHE;
269  std::vector<int>* t_hltL1Jet15 ;
270  std::vector<int>* t_hltJet30 ;
271  std::vector<int>* t_hltJet50 ;
272  std::vector<int>* t_hltJet80 ;
273  std::vector<int>* t_hltJet110 ;
274  std::vector<int>* t_hltJet140 ;
275  std::vector<int>* t_hltJet180 ;
276  std::vector<int>* t_hltL1SingleEG5 ;
277  std::vector<int>* t_hltZeroBias ;
278  std::vector<int>* t_hltMinBiasHcal ;
279  std::vector<int>* t_hltMinBiasEcal ;
280  std::vector<int>* t_hltMinBiasPixel ;
281  std::vector<int>* t_hltSingleIsoTau30_Trk5 ;
282  std::vector<int>* t_hltDoubleLooseIsoTau15_Trk5;
283 
284 
285  std::vector<std::vector<int> >* t_v_RH_h3x3_ieta;
286  std::vector<std::vector<int> >* t_v_RH_h3x3_iphi;
287  std::vector<std::vector<double> >* t_v_RH_h3x3_ene ;
288  std::vector<std::vector<int> >* t_v_RH_h5x5_ieta;
289  std::vector<std::vector<int> >* t_v_RH_h5x5_iphi;
290  std::vector<std::vector<double> >* t_v_RH_h5x5_ene ;
291  std::vector<std::vector<int> >* t_v_RH_r26_ieta ;
292  std::vector<std::vector<int> >* t_v_RH_r26_iphi ;
293  std::vector<std::vector<double> >* t_v_RH_r26_ene ;
294  std::vector<std::vector<int> >* t_v_RH_r44_ieta ;
295  std::vector<std::vector<int> >* t_v_RH_r44_iphi ;
296  std::vector<std::vector<double> >* t_v_RH_r44_ene ;
297 
298  std::vector<unsigned int>* t_irun;
299  std::vector<unsigned int>* t_ievt;
300  std::vector<unsigned int>* t_ilum;
301 
302 
304 
305 
306 
307 };
308 
309 
310 #endif
std::vector< int > * t_hsim5x5NTotal
std::vector< std::vector< double > > * t_v_distFromHotCell
std::vector< double > * t_hsim5x5CharHad
virtual void beginJob()
Definition: EDAnalyzer.h:58
std::vector< std::vector< double > > * t_v_hmaxNearP_goodTrk
std::vector< std::vector< int > > * t_v_hlTriggers
std::vector< double > * t_trkEcalEne
std::vector< std::vector< double > > * t_v_hsimCone
TrackAssociatorParameters parameters_
std::vector< int > * t_hltJet30
std::vector< double > * t_trkPt
std::vector< int > * t_ietaFromHotCell_h5x5
std::vector< double > * t_nRH_h3x3
std::vector< double > * t_distFromHotCell_h3x3
std::vector< std::vector< int > > * t_v_hsimInfoConeNCharHad
std::vector< int > * t_hsim5x5NNeutHad
std::vector< double > * t_hsim5x5Photon
std::vector< int > * t_hltMinBiasHcal
std::vector< std::vector< double > > * t_v_cone_hmaxNearP_goodTrk
std::vector< double > * t_hsim3x3CharHad
std::vector< int > * t_hsim5x5NPhoton
std::vector< std::vector< double > > * t_v_RH_r44_ene
std::vector< int > * t_iphiFromHotCell_h3x3
std::vector< std::vector< int > > * t_v_cone_hnLayers_maxNearP
static const int NEtaBins
std::vector< double > * t_hsim5x5PdgMatched
std::vector< double > * t_hsim3x3NeutHad
std::vector< double > * t_nRH_h5x5
std::vector< std::vector< int > > * t_v_hnLayers_maxNearP
std::vector< int > * t_hltHB
std::vector< std::vector< double > > * t_v_hmaxNearP
std::vector< std::vector< double > > * t_v_RH_h3x3_ene
std::vector< int > * t_hsim5x5NCharHad
std::vector< std::vector< int > > * t_v_hsimInfoConeNNeutHad
std::vector< std::vector< int > > * t_v_nRecHitsCone
std::vector< std::vector< int > > * t_v_hsimInfoConeNMatched
std::vector< double > * t_trkP
std::vector< int > * t_hltL1SingleEG5
std::vector< int > * t_hsim5x5NRest
std::vector< double > * t_hsim5x5NeutHad
std::vector< int > * t_hltJet50
std::vector< std::vector< double > > * t_v_cone_hmaxNearP
std::vector< double > * t_simP
std::vector< double > * t_nRH_hsim9x9dR
std::vector< int > * t_hsim3x3NCharHad
std::vector< std::vector< int > > * t_v_iphiFromHotCell
std::vector< std::vector< int > > * t_v_hnNearTRKs
static const int NPBins
std::vector< std::vector< int > > * t_v_cone_htrkQual_maxNearP
std::vector< std::vector< double > > * t_v_RH_r26_ene
std::vector< int > * t_hltDoubleLooseIsoTau15_Trk5
std::vector< int > * t_hltJet140
std::vector< int > * t_hltMinBiasPixel
std::vector< double > * t_trkPhi
std::vector< double > * t_nRH_h5x5dR
std::vector< double > * t_hsim3x3Total
std::vector< int > * t_hltHE
std::vector< std::vector< int > > * t_v_RH_h3x3_iphi
std::vector< int > * t_iphiFromHotCell_h5x5
std::vector< double > * t_nRH_h3x3dR
std::vector< std::vector< double > > * t_v_hsimInfoConePdgMatched
std::vector< std::vector< int > > * t_v_htrkQual_maxNearP
std::vector< int > * t_hltMinBiasEcal
std::vector< std::vector< int > > * t_v_RH_r44_iphi
std::vector< double > * t_hsim5x5Matched
std::vector< std::vector< double > > * t_v_hsimInfoConeTotal
std::vector< std::vector< double > > * t_v_RH_h5x5_ene
double DeltaPhi(double v1, double v2)
std::vector< std::vector< int > > * t_v_hsimInfoConeNRest
std::vector< std::vector< double > > * t_v_hsimInfoConeCharHad
edm::InputTag _L1extraFwdJetSource
std::vector< double > * t_hsim5x5Total
std::vector< double > * t_hsim3x3Photon
std::vector< double > * t_hsim3x3PdgMatched
std::vector< std::vector< int > > * t_v_ietaFromHotCell
std::vector< double > * t_hsim5x5Rest
std::vector< int > * t_hltJet110
std::vector< double > * t_nRH_hsim3x3dR
std::vector< std::vector< double > > * t_v_eMipDR
std::vector< int > * t_hltL1Jet15
std::vector< double > * t_nRH_hsim5x5dR
std::vector< int > * t_hsim3x3NRest
std::vector< std::vector< double > > * t_v_hsimInfoConeRest
std::vector< std::vector< int > > * t_v_hsimInfoConeNPhoton
std::vector< std::vector< int > > * t_v_RH_r26_ieta
std::vector< double > * t_dtFromLeadJet
std::vector< std::vector< int > > * t_v_RH_h5x5_ieta
std::vector< std::vector< int > > * t_v_RH_h3x3_ieta
static const int NPTBins
std::vector< unsigned int > * t_ievt
std::vector< double > * t_trkNLayersCrossed
edm::InputTag _L1extraCenJetSource
std::vector< std::vector< double > > * t_v_hsimInfoConeNeutHad
std::vector< std::vector< int > > * t_v_nSimHitsCone
std::vector< int > * t_hltSingleIsoTau30_Trk5
std::vector< double > * t_hsim5x5
std::vector< std::vector< int > > * t_v_RH_h5x5_iphi
IsolatedTracksCone(const edm::ParameterSet &)
std::vector< std::vector< int > > * t_v_hsimInfoConeNTotal
std::vector< double > * t_hsim3x3Matched
std::vector< double > * t_nRH_hsim7x7dR
std::vector< int > * t_hsim3x3NNeutHad
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::Service< TFileService > fs
std::vector< double > * t_nRH_h9x9dR
std::vector< int > * t_hltZeroBias
std::vector< double > * t_h5x5
std::vector< double > * t_trkNOuterHits
std::vector< std::vector< double > > * t_v_hCone
std::vector< double > * t_nRH_h7x7dR
std::vector< int > * t_hsim3x3NPhoton
std::vector< double > * t_hsim3x3Rest
std::vector< double > * t_hsim3x3
std::vector< int > * t_hsim3x3NMatched
std::vector< std::vector< int > > * t_v_RH_r44_ieta
std::vector< double > * t_trkHcalEne
std::vector< unsigned int > * t_irun
std::vector< int > * t_hltJet180
std::vector< int > * t_hsim3x3NTotal
void printTrack(const reco::Track *pTrack)
std::vector< int > * t_ietaFromHotCell_h3x3
std::vector< double > * t_distFromHotCell_h5x5
edm::InputTag _L1extraTauJetSource
std::vector< double > * t_e3x3
double DeltaR(double eta1, double phi1, double eta2, double phi2)
std::vector< double > * t_trkEta
std::vector< double > * t_nRH_h40cm
std::vector< double > * t_nRH_hsim40cm
std::vector< double > * t_h3x3
std::vector< std::vector< double > > * t_v_hsimInfoConePhoton
std::vector< unsigned int > * t_ilum
TrackDetectorAssociator * trackAssociator_
std::vector< int > * t_hltJet80
std::vector< std::vector< double > > * t_v_eDR
std::vector< std::vector< double > > * t_v_hsimInfoConeMatched
std::vector< std::vector< int > > * t_v_RH_r26_iphi
std::vector< int > * t_hsim5x5NMatched
std::vector< std::vector< int > > * t_v_cone_hnNearTRKs