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 // tracker hit associator
63 
64 // ecal / hcal
72 
75 
81 
82 // root objects
83 #include "TROOT.h"
84 #include "TSystem.h"
85 #include "TFile.h"
86 #include "TH1F.h"
87 #include "TH2F.h"
88 #include "TProfile.h"
89 #include "TDirectory.h"
90 #include "TTree.h"
91 
92 #include <cmath>
93 
95 public:
96  explicit IsolatedTracksCone(const edm::ParameterSet&);
98 
99  // static const int NEtaBins = 4;
100  static const int NEtaBins = 4;
101  static const int NPTBins = 21;
102  static const int NPBins = 21;
103 
104  double genPartPBins[22], genPartEtaBins[5];
105 
106 private:
107  virtual void beginJob(const edm::EventSetup&) ;
108  virtual void analyze(const edm::Event&, const edm::EventSetup&);
109  virtual void endJob() ;
110 
111  void printTrack(const reco::Track* pTrack);
112 
113  // void BookHistograms();
114  void BuildTree();
115  void clearTrackVectors();
116 
117  double DeltaPhi(double v1, double v2);
118  double DeltaR(double eta1, double phi1, double eta2, double phi2);
119 
122  bool doMC;
126 
128 
132 
136 
140 
145 
147 
149 
151 
152  // track associator to detector parameters
155 
156  TTree* ntp;
157 
158  TH1F* hRawPt ;
159  TH1F* hRawP ;
160  TH1F* hRawEta;
161  TH1F* hRawPhi;
162 
163  int nRawTRK ;
165  int nFailPt ;
166  int nFailEta ;
167  int nMissEcal ;
168  int nMissHcal ;
169  int nEVT;
171  int nTRK;
172  double leadL1JetPT;
173  double leadL1JetEta;
174  double leadL1JetPhi;
175 
176  std::vector<std::vector<int> >* t_v_hnNearTRKs ;
177  std::vector<std::vector<int> >* t_v_hnLayers_maxNearP;
178  std::vector<std::vector<int> >* t_v_htrkQual_maxNearP;
179  std::vector<std::vector<double> >* t_v_hmaxNearP_goodTrk;
180  std::vector<std::vector<double> >* t_v_hmaxNearP ;
181 
182  std::vector<std::vector<int> >* t_v_cone_hnNearTRKs ;
183  std::vector<std::vector<int> >* t_v_cone_hnLayers_maxNearP;
184  std::vector<std::vector<int> >* t_v_cone_htrkQual_maxNearP;
185  std::vector<std::vector<double> >* t_v_cone_hmaxNearP_goodTrk;
186  std::vector<std::vector<double> >* t_v_cone_hmaxNearP ;
187 
188  std::vector<double>* t_trkNOuterHits ;
189  std::vector<double>* t_trkNLayersCrossed;
190  std::vector<double>* t_dtFromLeadJet ;
191  std::vector<double>* t_trkP ;
192  std::vector<double>* t_simP ;
193  std::vector<double>* t_trkPt ;
194  std::vector<double>* t_trkEta ;
195  std::vector<double>* t_trkPhi ;
196  std::vector<double>* t_e3x3 ;
197 
198  std::vector<std::vector<double> > *t_v_eDR;
199  std::vector<std::vector<double> > *t_v_eMipDR;
200 
201  std::vector<double>* t_h3x3 ;
202  std::vector<double>* t_h5x5 ;
203  std::vector<double>* t_hsim3x3 ;
204  std::vector<double>* t_hsim5x5 ;
205 
206  std::vector<double>* t_nRH_h3x3 ;
207  std::vector<double>* t_nRH_h5x5 ;
208 
209  std::vector<double>* t_hsim3x3Matched ;
210  std::vector<double>* t_hsim5x5Matched ;
211  std::vector<double>* t_hsim3x3Rest ;
212  std::vector<double>* t_hsim5x5Rest ;
213  std::vector<double>* t_hsim3x3Photon ;
214  std::vector<double>* t_hsim5x5Photon ;
215  std::vector<double>* t_hsim3x3NeutHad ;
216  std::vector<double>* t_hsim5x5NeutHad ;
217  std::vector<double>* t_hsim3x3CharHad ;
218  std::vector<double>* t_hsim5x5CharHad ;
219  std::vector<double>* t_hsim3x3PdgMatched;
220  std::vector<double>* t_hsim5x5PdgMatched;
221  std::vector<double>* t_hsim3x3Total ;
222  std::vector<double>* t_hsim5x5Total ;
223 
224  std::vector<int>* t_hsim3x3NMatched ;
225  std::vector<int>* t_hsim3x3NRest ;
226  std::vector<int>* t_hsim3x3NPhoton ;
227  std::vector<int>* t_hsim3x3NNeutHad ;
228  std::vector<int>* t_hsim3x3NCharHad ;
229  std::vector<int>* t_hsim3x3NTotal ;
230 
231  std::vector<int>* t_hsim5x5NMatched ;
232  std::vector<int>* t_hsim5x5NRest ;
233  std::vector<int>* t_hsim5x5NPhoton ;
234  std::vector<int>* t_hsim5x5NNeutHad ;
235  std::vector<int>* t_hsim5x5NCharHad ;
236  std::vector<int>* t_hsim5x5NTotal ;
237 
238  std::vector<double>* t_distFromHotCell_h3x3;
239  std::vector<int>* t_ietaFromHotCell_h3x3;
240  std::vector<int>* t_iphiFromHotCell_h3x3;
241  std::vector<double>* t_distFromHotCell_h5x5;
242  std::vector<int>* t_ietaFromHotCell_h5x5;
243  std::vector<int>* t_iphiFromHotCell_h5x5;
244 
245  std::vector<double>* t_trkHcalEne ;
246  std::vector<double>* t_trkEcalEne ;
247 
248  std::vector<std::vector<double> >* t_v_hsimInfoConeMatched ;
249  std::vector<std::vector<double> >* t_v_hsimInfoConeRest ;
250  std::vector<std::vector<double> >* t_v_hsimInfoConePhoton ;
251  std::vector<std::vector<double> >* t_v_hsimInfoConeNeutHad ;
252  std::vector<std::vector<double> >* t_v_hsimInfoConeCharHad ;
253  std::vector<std::vector<double> >* t_v_hsimInfoConePdgMatched;
254  std::vector<std::vector<double> >* t_v_hsimInfoConeTotal ;
255 
256  std::vector<std::vector<int> >* t_v_hsimInfoConeNMatched ;
257  std::vector<std::vector<int> >* t_v_hsimInfoConeNRest ;
258  std::vector<std::vector<int> >* t_v_hsimInfoConeNPhoton ;
259  std::vector<std::vector<int> >* t_v_hsimInfoConeNNeutHad ;
260  std::vector<std::vector<int> >* t_v_hsimInfoConeNCharHad ;
261  std::vector<std::vector<int> >* t_v_hsimInfoConeNTotal ;
262 
263  std::vector<std::vector<double> >* t_v_hsimCone ;
264  std::vector<std::vector<double> >* t_v_hCone ;
265  std::vector<std::vector<int> >* t_v_nRecHitsCone;
266  std::vector<std::vector<int> >* t_v_nSimHitsCone;
267 
268  std::vector<std::vector<double> >* t_v_distFromHotCell;
269  std::vector<std::vector<int> >* t_v_ietaFromHotCell;
270  std::vector<std::vector<int> >* t_v_iphiFromHotCell;
271 
272 
273  std::vector<std::vector<int> >* t_v_hlTriggers;
274  std::vector<int>* t_hltHB;
275  std::vector<int>* t_hltHE;
276  std::vector<int>* t_hltL1Jet15 ;
277  std::vector<int>* t_hltJet30 ;
278  std::vector<int>* t_hltJet50 ;
279  std::vector<int>* t_hltJet80 ;
280  std::vector<int>* t_hltJet110 ;
281  std::vector<int>* t_hltJet140 ;
282  std::vector<int>* t_hltJet180 ;
283  std::vector<int>* t_hltL1SingleEG5 ;
284  std::vector<int>* t_hltZeroBias ;
285  std::vector<int>* t_hltMinBiasHcal ;
286  std::vector<int>* t_hltMinBiasEcal ;
287  std::vector<int>* t_hltMinBiasPixel ;
288  std::vector<int>* t_hltSingleIsoTau30_Trk5 ;
289  std::vector<int>* t_hltDoubleLooseIsoTau15_Trk5;
290 
291 
292  std::vector<std::vector<int> >* t_v_RH_h3x3_ieta;
293  std::vector<std::vector<int> >* t_v_RH_h3x3_iphi;
294  std::vector<std::vector<double> >* t_v_RH_h3x3_ene ;
295  std::vector<std::vector<int> >* t_v_RH_h5x5_ieta;
296  std::vector<std::vector<int> >* t_v_RH_h5x5_iphi;
297  std::vector<std::vector<double> >* t_v_RH_h5x5_ene ;
298  std::vector<std::vector<int> >* t_v_RH_r26_ieta ;
299  std::vector<std::vector<int> >* t_v_RH_r26_iphi ;
300  std::vector<std::vector<double> >* t_v_RH_r26_ene ;
301  std::vector<std::vector<int> >* t_v_RH_r44_ieta ;
302  std::vector<std::vector<int> >* t_v_RH_r44_iphi ;
303  std::vector<std::vector<double> >* t_v_RH_r44_ene ;
304 
305  std::vector<unsigned int>* t_irun;
306  std::vector<unsigned int>* t_ievt;
307  std::vector<unsigned int>* t_ilum;
308 
310 
311 };
312 
313 #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:72
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
TrackerHitAssociator::Config trackerHitAssociatorConfig_
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