test
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;
123 
127 
130 
139 
141 
143 
145 
146  // track associator to detector parameters
149 
150  TTree* ntp;
151 
152  TH1F* hRawPt ;
153  TH1F* hRawP ;
154  TH1F* hRawEta;
155  TH1F* hRawPhi;
156 
157  int nRawTRK ;
159  int nFailPt ;
160  int nFailEta ;
161  int nMissEcal ;
162  int nMissHcal ;
163  int nEVT;
165  int nTRK;
166 // double hbScale;
167 // double heScale;
168  double leadL1JetPT;
169  double leadL1JetEta;
170  double leadL1JetPhi;
171 
172  std::vector<std::vector<int> >* t_v_hnNearTRKs ;
173  std::vector<std::vector<int> >* t_v_hnLayers_maxNearP;
174  std::vector<std::vector<int> >* t_v_htrkQual_maxNearP;
175  std::vector<std::vector<double> >* t_v_hmaxNearP_goodTrk;
176  std::vector<std::vector<double> >* t_v_hmaxNearP ;
177 
178  std::vector<std::vector<int> >* t_v_cone_hnNearTRKs ;
179  std::vector<std::vector<int> >* t_v_cone_hnLayers_maxNearP;
180  std::vector<std::vector<int> >* t_v_cone_htrkQual_maxNearP;
181  std::vector<std::vector<double> >* t_v_cone_hmaxNearP_goodTrk;
182  std::vector<std::vector<double> >* t_v_cone_hmaxNearP ;
183 
184  // std::vector<double>* t_hScale ;
185  std::vector<double>* t_trkNOuterHits ;
186  std::vector<double>* t_trkNLayersCrossed;
187  std::vector<double>* t_dtFromLeadJet ;
188  std::vector<double>* t_trkP ;
189  std::vector<double>* t_simP ;
190  std::vector<double>* t_trkPt ;
191  std::vector<double>* t_trkEta ;
192  std::vector<double>* t_trkPhi ;
193  std::vector<double>* t_e3x3 ;
194 
195  std::vector<std::vector<double> > *t_v_eDR;
196  std::vector<std::vector<double> > *t_v_eMipDR;
197 
198  std::vector<double>* t_h3x3 ;
199  std::vector<double>* t_h5x5 ;
200  std::vector<double>* t_hsim3x3 ;
201  std::vector<double>* t_hsim5x5 ;
202 
203  std::vector<double>* t_nRH_h3x3 ;
204  std::vector<double>* t_nRH_h5x5 ;
205 
206  std::vector<double>* t_hsim3x3Matched ;
207  std::vector<double>* t_hsim5x5Matched ;
208  std::vector<double>* t_hsim3x3Rest ;
209  std::vector<double>* t_hsim5x5Rest ;
210  std::vector<double>* t_hsim3x3Photon ;
211  std::vector<double>* t_hsim5x5Photon ;
212  std::vector<double>* t_hsim3x3NeutHad ;
213  std::vector<double>* t_hsim5x5NeutHad ;
214  std::vector<double>* t_hsim3x3CharHad ;
215  std::vector<double>* t_hsim5x5CharHad ;
216  std::vector<double>* t_hsim3x3PdgMatched;
217  std::vector<double>* t_hsim5x5PdgMatched;
218  std::vector<double>* t_hsim3x3Total ;
219  std::vector<double>* t_hsim5x5Total ;
220 
221  std::vector<int>* t_hsim3x3NMatched ;
222  std::vector<int>* t_hsim3x3NRest ;
223  std::vector<int>* t_hsim3x3NPhoton ;
224  std::vector<int>* t_hsim3x3NNeutHad ;
225  std::vector<int>* t_hsim3x3NCharHad ;
226  std::vector<int>* t_hsim3x3NTotal ;
227 
228  std::vector<int>* t_hsim5x5NMatched ;
229  std::vector<int>* t_hsim5x5NRest ;
230  std::vector<int>* t_hsim5x5NPhoton ;
231  std::vector<int>* t_hsim5x5NNeutHad ;
232  std::vector<int>* t_hsim5x5NCharHad ;
233  std::vector<int>* t_hsim5x5NTotal ;
234 
235  std::vector<double>* t_distFromHotCell_h3x3;
236  std::vector<int>* t_ietaFromHotCell_h3x3;
237  std::vector<int>* t_iphiFromHotCell_h3x3;
238  std::vector<double>* t_distFromHotCell_h5x5;
239  std::vector<int>* t_ietaFromHotCell_h5x5;
240  std::vector<int>* t_iphiFromHotCell_h5x5;
241 
242  std::vector<double>* t_trkHcalEne ;
243  std::vector<double>* t_trkEcalEne ;
244 
245  std::vector<std::vector<double> >* t_v_hsimInfoConeMatched ;
246  std::vector<std::vector<double> >* t_v_hsimInfoConeRest ;
247  std::vector<std::vector<double> >* t_v_hsimInfoConePhoton ;
248  std::vector<std::vector<double> >* t_v_hsimInfoConeNeutHad ;
249  std::vector<std::vector<double> >* t_v_hsimInfoConeCharHad ;
250  std::vector<std::vector<double> >* t_v_hsimInfoConePdgMatched;
251  std::vector<std::vector<double> >* t_v_hsimInfoConeTotal ;
252 
253  std::vector<std::vector<int> >* t_v_hsimInfoConeNMatched ;
254  std::vector<std::vector<int> >* t_v_hsimInfoConeNRest ;
255  std::vector<std::vector<int> >* t_v_hsimInfoConeNPhoton ;
256  std::vector<std::vector<int> >* t_v_hsimInfoConeNNeutHad ;
257  std::vector<std::vector<int> >* t_v_hsimInfoConeNCharHad ;
258  std::vector<std::vector<int> >* t_v_hsimInfoConeNTotal ;
259 
260  std::vector<std::vector<double> >* t_v_hsimCone ;
261  std::vector<std::vector<double> >* t_v_hCone ;
262  std::vector<std::vector<int> >* t_v_nRecHitsCone;
263  std::vector<std::vector<int> >* t_v_nSimHitsCone;
264 
265  std::vector<std::vector<double> >* t_v_distFromHotCell;
266  std::vector<std::vector<int> >* t_v_ietaFromHotCell;
267  std::vector<std::vector<int> >* t_v_iphiFromHotCell;
268 
269 
270  std::vector<std::vector<int> >* t_v_hlTriggers;
271  std::vector<int>* t_hltHB;
272  std::vector<int>* t_hltHE;
273  std::vector<int>* t_hltL1Jet15 ;
274  std::vector<int>* t_hltJet30 ;
275  std::vector<int>* t_hltJet50 ;
276  std::vector<int>* t_hltJet80 ;
277  std::vector<int>* t_hltJet110 ;
278  std::vector<int>* t_hltJet140 ;
279  std::vector<int>* t_hltJet180 ;
280  std::vector<int>* t_hltL1SingleEG5 ;
281  std::vector<int>* t_hltZeroBias ;
282  std::vector<int>* t_hltMinBiasHcal ;
283  std::vector<int>* t_hltMinBiasEcal ;
284  std::vector<int>* t_hltMinBiasPixel ;
285  std::vector<int>* t_hltSingleIsoTau30_Trk5 ;
286  std::vector<int>* t_hltDoubleLooseIsoTau15_Trk5;
287 
288 
289  std::vector<std::vector<int> >* t_v_RH_h3x3_ieta;
290  std::vector<std::vector<int> >* t_v_RH_h3x3_iphi;
291  std::vector<std::vector<double> >* t_v_RH_h3x3_ene ;
292  std::vector<std::vector<int> >* t_v_RH_h5x5_ieta;
293  std::vector<std::vector<int> >* t_v_RH_h5x5_iphi;
294  std::vector<std::vector<double> >* t_v_RH_h5x5_ene ;
295  std::vector<std::vector<int> >* t_v_RH_r26_ieta ;
296  std::vector<std::vector<int> >* t_v_RH_r26_iphi ;
297  std::vector<std::vector<double> >* t_v_RH_r26_ene ;
298  std::vector<std::vector<int> >* t_v_RH_r44_ieta ;
299  std::vector<std::vector<int> >* t_v_RH_r44_iphi ;
300  std::vector<std::vector<double> >* t_v_RH_r44_ene ;
301 
302  std::vector<unsigned int>* t_irun;
303  std::vector<unsigned int>* t_ievt;
304  std::vector<unsigned int>* t_ilum;
305 
306 
308 
309 
310 
311 };
312 
313 
314 #endif
std::vector< int > * t_hsim5x5NTotal
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extFwdJet_
std::vector< std::vector< double > > * t_v_distFromHotCell
std::vector< double > * t_hsim5x5CharHad
virtual void beginJob()
Definition: EDAnalyzer.h:67
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
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
std::vector< double > * t_trkPt
std::vector< int > * t_ietaFromHotCell_h5x5
std::vector< double > * t_nRH_h3x3
std::vector< double > * t_distFromHotCell_h3x3
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< std::vector< int > > * t_v_hsimInfoConeNCharHad
std::vector< int > * t_hsim5x5NNeutHad
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
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
edm::EDGetTokenT< edm::TriggerResults > tok_trigger_
std::vector< std::vector< double > > * t_v_hmaxNearP
std::vector< std::vector< double > > * t_v_RH_h3x3_ene
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
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< 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
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extTauJet_
std::vector< int > * t_hltJet140
std::vector< int > * t_hltMinBiasPixel
std::vector< double > * t_trkPhi
std::vector< double > * t_hsim3x3Total
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
std::vector< int > * t_hltHE
std::vector< std::vector< int > > * t_v_RH_h3x3_iphi
std::vector< int > * t_iphiFromHotCell_h5x5
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
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
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
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< std::vector< double > > * t_v_eMipDR
std::vector< int > * t_hltL1Jet15
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::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extCenJet_
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< int > * t_hsim3x3NNeutHad
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::Service< TFileService > fs
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
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< 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::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
std::vector< double > * t_e3x3
double DeltaR(double eta1, double phi1, double eta2, double phi2)
std::vector< double > * t_trkEta
std::vector< double > * t_h3x3
std::vector< std::vector< double > > * t_v_hsimInfoConePhoton
std::vector< unsigned int > * t_ilum
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
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