CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IsolatedGenParticles.h
Go to the documentation of this file.
1 #ifndef CalibrationIsolatedParticlesIsolatedGenParticles_h
2 #define CalibrationIsolatedParticlesIsolatedGenParticles_h
3 
4 // system include files
5 #include <memory>
6 
7 // user include files
10 
13 
15 //TFile Service
18 
19 // track associator
23 
24 // ecal / hcal
27 
32 
35 
37 
38 //L1 objects
45 
54 
57 
58 // root objects
59 #include "TROOT.h"
60 #include "TSystem.h"
61 #include "TFile.h"
62 #include "TH1I.h"
63 #include "TH2D.h"
64 #include "TProfile.h"
65 #include "TDirectory.h"
66 #include "TTree.h"
67 
68 
69 namespace{
70  class ParticlePtGreater{
71  public:
72  int operator()(const HepMC::GenParticle * p1,
73  const HepMC::GenParticle * p2) const{
74  return p1->momentum().perp() > p2->momentum().perp();
75  }
76  };
77 
78  class ParticlePGreater{
79  public:
80  int operator()(const HepMC::GenParticle * p1,
81  const HepMC::GenParticle * p2) const{
82  return p1->momentum().rho() > p2->momentum().rho();
83  }
84  };
85 }
86 
87 
89 
90 public:
91  explicit IsolatedGenParticles(const edm::ParameterSet&);
93 
94 private:
95  virtual void beginJob() ;
96  virtual void analyze(const edm::Event&, const edm::EventSetup&);
97  virtual void endJob() ;
98 
99  double DeltaPhi(double v1, double v2);
100  double DeltaR(double eta1, double phi1, double eta2, double phi2);
101  double DeltaR2(double eta1, double phi1, double eta2, double phi2);
102 
103  void fillTrack (GlobalPoint& posVec, math::XYZTLorentzVector& momVec, GlobalPoint& posECAL, int pdgId, bool okECAL, bool accpet);
104  void fillIsolatedTrack(math::XYZTLorentzVector& momVec, GlobalPoint& posECAL, int pdgId);
105  void BookHistograms();
106  void clearTreeVectors();
107  int particleCode(int);
108 
109  static const int NPBins = 3;
110  static const int NEtaBins = 4;
111  static const int PBins=32, EtaBins=60, Particles=12;
116 
119 
122 
124  static const size_t nL1BitsMax=128;
129 
138 
139 
141 
145 
146  TTree *tree;
147 
148  std::vector<double> *t_isoTrkPAll;
149  std::vector<double> *t_isoTrkPtAll;
150  std::vector<double> *t_isoTrkPhiAll;
151  std::vector<double> *t_isoTrkEtaAll;
152  std::vector<double> *t_isoTrkPdgIdAll;
153  std::vector<double> *t_isoTrkDEtaAll;
154  std::vector<double> *t_isoTrkDPhiAll;
155 
156  std::vector<double> *t_isoTrkP;
157  std::vector<double> *t_isoTrkPt;
158  std::vector<double> *t_isoTrkEne;
159  std::vector<double> *t_isoTrkEta;
160  std::vector<double> *t_isoTrkPhi;
161  std::vector<double> *t_isoTrkEtaEC;
162  std::vector<double> *t_isoTrkPhiEC;
163  std::vector<double> *t_isoTrkPdgId;
164 
165  std::vector<double> *t_maxNearP31x31;
167  std::vector<double> *t_nHadronEne31x31;
168  std::vector<double> *t_photonEne31x31;
169  std::vector<double> *t_eleEne31x31;
170  std::vector<double> *t_muEne31x31;
171 
172  std::vector<double> *t_maxNearP25x25;
174  std::vector<double> *t_nHadronEne25x25;
175  std::vector<double> *t_photonEne25x25;
176  std::vector<double> *t_eleEne25x25;
177  std::vector<double> *t_muEne25x25;
178 
179  std::vector<double> *t_maxNearP21x21;
181  std::vector<double> *t_nHadronEne21x21;
182  std::vector<double> *t_photonEne21x21;
183  std::vector<double> *t_eleEne21x21;
184  std::vector<double> *t_muEne21x21;
185 
186  std::vector<double> *t_maxNearP15x15;
188  std::vector<double> *t_nHadronEne15x15;
189  std::vector<double> *t_photonEne15x15;
190  std::vector<double> *t_eleEne15x15;
191  std::vector<double> *t_muEne15x15;
192 
193  std::vector<double> *t_maxNearP11x11;
195  std::vector<double> *t_nHadronEne11x11;
196  std::vector<double> *t_photonEne11x11;
197  std::vector<double> *t_eleEne11x11;
198  std::vector<double> *t_muEne11x11;
199 
200  std::vector<double> *t_maxNearP9x9;
202  std::vector<double> *t_nHadronEne9x9;
203  std::vector<double> *t_photonEne9x9;
204  std::vector<double> *t_eleEne9x9;
205  std::vector<double> *t_muEne9x9;
206 
207  std::vector<double> *t_maxNearP7x7;
209  std::vector<double> *t_nHadronEne7x7;
210  std::vector<double> *t_photonEne7x7;
211  std::vector<double> *t_eleEne7x7;
212  std::vector<double> *t_muEne7x7;
213 
214  std::vector<double> *t_maxNearP3x3;
216  std::vector<double> *t_nHadronEne3x3;
217  std::vector<double> *t_photonEne3x3;
218  std::vector<double> *t_eleEne3x3;
219  std::vector<double> *t_muEne3x3;
220 
221  std::vector<double> *t_maxNearP1x1;
223  std::vector<double> *t_nHadronEne1x1;
224  std::vector<double> *t_photonEne1x1;
225  std::vector<double> *t_eleEne1x1;
226  std::vector<double> *t_muEne1x1;
227 
228  std::vector<double> *t_maxNearPHC1x1;
230  std::vector<double> *t_nHadronEneHC1x1;
231  std::vector<double> *t_photonEneHC1x1;
232  std::vector<double> *t_eleEneHC1x1;
233  std::vector<double> *t_muEneHC1x1;
234 
235  std::vector<double> *t_maxNearPHC3x3;
237  std::vector<double> *t_nHadronEneHC3x3;
238  std::vector<double> *t_photonEneHC3x3;
239  std::vector<double> *t_eleEneHC3x3;
240  std::vector<double> *t_muEneHC3x3;
241 
242  std::vector<double> *t_maxNearPHC5x5;
244  std::vector<double> *t_nHadronEneHC5x5;
245  std::vector<double> *t_photonEneHC5x5;
246  std::vector<double> *t_eleEneHC5x5;
247  std::vector<double> *t_muEneHC5x5;
248 
249  std::vector<double> *t_maxNearPHC7x7;
251  std::vector<double> *t_nHadronEneHC7x7;
252  std::vector<double> *t_photonEneHC7x7;
253  std::vector<double> *t_eleEneHC7x7;
254  std::vector<double> *t_muEneHC7x7;
255 
256  std::vector<double> *t_maxNearPR;
258  std::vector<double> *t_nHadronEneR;
259  std::vector<double> *t_photonEneR;
260  std::vector<double> *t_eleEneR;
261  std::vector<double> *t_muEneR;
262 
263  std::vector<double> *t_maxNearPIsoR;
265  std::vector<double> *t_nHadronEneIsoR;
266  std::vector<double> *t_photonEneIsoR;
267  std::vector<double> *t_eleEneIsoR;
268  std::vector<double> *t_muEneIsoR;
269 
270  std::vector<double> *t_maxNearPHCR;
272  std::vector<double> *t_nHadronEneHCR;
273  std::vector<double> *t_photonEneHCR;
274  std::vector<double> *t_eleEneHCR;
275  std::vector<double> *t_muEneHCR;
276 
277  std::vector<double> *t_maxNearPIsoHCR;
279  std::vector<double> *t_nHadronEneIsoHCR;
280  std::vector<double> *t_photonEneIsoHCR;
281  std::vector<double> *t_eleEneIsoHCR;
282  std::vector<double> *t_muEneIsoHCR;
283 
284  std::vector<int> *t_L1Decision;
285  std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
286  std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
287  std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
288  std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
289  std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
291  std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
292 
297 
298 };
299 
300 #endif
std::vector< double > * t_cHadronEneHC1x1_3
std::vector< double > * t_eleEne7x7
std::vector< double > * t_nHadronEne21x21
std::vector< double > * t_cHadronEneHC7x7_2
spr::genSimInfo isoinfo25x25
std::vector< double > * t_isoTrkEtaAll
TH2D * h_pEta[Particles]
std::vector< double > * t_maxNearPHCR
std::vector< double > * t_isoTrkPdgId
std::vector< double > * t_L1FwdJetPhi
std::vector< double > * t_eleEne31x31
std::vector< double > * t_eleEneHC7x7
std::string algoBitToName[nL1BitsMax]
std::vector< int > * t_L1Decision
spr::genSimInfo isoinfo31x31
std::vector< double > * t_cHadronEneIsoR_1
std::vector< double > * t_nHadronEne7x7
std::vector< double > * t_isoTrkPt
std::vector< double > * t_L1TauJetPhi
std::vector< double > * t_L1TauJetPt
std::vector< double > * t_cHadronEneHCR_1
std::vector< double > * t_L1CenJetEta
std::vector< double > * t_photonEne7x7
spr::genSimInfo isoinfo21x21
std::vector< double > * t_L1MuonPt
std::vector< double > * t_isoTrkEta
std::vector< double > * t_cHadronEneHC7x7
std::vector< double > * t_cHadronEneHC7x7_3
std::vector< double > * t_cHadronEne7x7_2
std::vector< double > * t_cHadronEne15x15_3
std::vector< double > * t_maxNearP15x15
std::vector< double > * t_nHadronEneHC7x7
std::vector< double > * t_photonEne21x21
std::vector< double > * t_cHadronEneIsoHCR_2
std::vector< double > * t_cHadronEne25x25
std::vector< double > * t_photonEneHC5x5
std::vector< double > * t_cHadronEneHC1x1_2
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extCenJet_
std::vector< double > * t_L1IsoEMEta
static const int Particles
std::vector< double > * t_muEneIsoHCR
std::vector< double > * t_eleEne11x11
IsolatedGenParticles(const edm::ParameterSet &)
std::vector< double > * t_cHadronEneR
std::vector< double > * t_eleEne3x3
std::vector< double > * t_L1IsoEMPt
std::vector< double > * t_cHadronEne3x3_2
std::vector< double > * t_cHadronEneHC3x3_2
std::vector< double > * t_photonEne1x1
std::vector< double > * t_cHadronEne1x1_2
std::vector< double > * t_nHadronEneR
std::vector< double > * t_cHadronEneIsoR_3
std::vector< double > * t_maxNearP11x11
std::vector< double > * t_maxNearPHC7x7
spr::genSimInfo isoinfoHC3x3
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extTauJet_
std::vector< double > * t_cHadronEneHC5x5_2
std::vector< double > * t_photonEneHCR
static const size_t nL1BitsMax
std::vector< double > * t_L1METEta
std::vector< double > * t_muEneIsoR
std::vector< double > * t_nHadronEne9x9
std::vector< double > * t_L1MuonEta
std::vector< double > * t_isoTrkPdgIdAll
edm::Service< TFileService > fs
std::vector< double > * t_muEneHC7x7
std::vector< double > * t_cHadronEne31x31
std::vector< double > * t_nHadronEneIsoHCR
std::vector< double > * t_L1FwdJetPt
std::vector< double > * t_cHadronEne31x31_1
std::vector< double > * t_photonEneHC3x3
std::vector< double > * t_cHadronEneIsoHCR_1
std::vector< double > * t_muEneR
std::vector< double > * t_muEne9x9
std::vector< double > * t_muEne21x21
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > tok_L1GTrorsrc_
std::vector< double > * t_maxNearP7x7
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > tok_L1extMusrc_
spr::genSimInfo isoinfoHC7x7
std::vector< double > * t_muEneHC1x1
std::vector< double > * t_photonEneHC7x7
std::vector< double > * t_maxNearPIsoHCR
std::vector< double > * t_L1TauJetEta
std::vector< double > * t_cHadronEneHC5x5
std::vector< double > * t_cHadronEne31x31_2
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
std::vector< double > * t_isoTrkPAll
std::vector< double > * t_nHadronEneHC1x1
spr::genSimInfo isoinfo11x11
std::vector< double > * t_eleEneIsoHCR
std::vector< double > * t_eleEneHC5x5
std::vector< double > * t_cHadronEneIsoHCR
std::vector< double > * t_muEneHCR
std::vector< double > * t_cHadronEne7x7_1
std::vector< double > * t_maxNearP25x25
std::vector< double > * t_cHadronEne3x3_3
std::vector< double > * t_cHadronEneHC7x7_1
std::vector< double > * t_cHadronEneHC5x5_1
edm::EDGetTokenT< l1extra::L1EmParticleCollection > tok_L1Em_
std::vector< double > * t_eleEne25x25
std::vector< double > * t_eleEne9x9
std::vector< double > * t_eleEne1x1
std::vector< double > * t_muEne11x11
std::vector< double > * t_eleEneHCR
std::vector< double > * t_muEne7x7
spr::genSimInfo isoinfoHC5x5
std::vector< double > * t_cHadronEneHC1x1
std::vector< double > * t_cHadronEneR_3
std::vector< double > * t_cHadronEne11x11_1
std::vector< double > * t_muEne1x1
std::vector< double > * t_cHadronEne15x15_1
std::vector< double > * t_cHadronEneIsoHCR_3
std::vector< double > * t_cHadronEneIsoR
spr::genSimInfo isoinfoHC1x1
std::vector< double > * t_eleEneHC3x3
std::vector< double > * t_isoTrkDEtaAll
std::vector< double > * t_muEne25x25
std::vector< double > * t_cHadronEne9x9_3
std::vector< double > * t_L1NonIsoEMPt
double DeltaR2(double eta1, double phi1, double eta2, double phi2)
std::vector< double > * t_photonEne25x25
std::vector< double > * t_maxNearP21x21
std::vector< double > * t_maxNearP31x31
std::vector< double > * t_muEneHC3x3
std::vector< double > * t_cHadronEneHC3x3
std::vector< double > * t_cHadronEne11x11
spr::genSimInfo isoinfoIsoHCR
std::vector< double > * t_cHadronEne25x25_3
std::vector< double > * t_cHadronEneHCR_3
std::vector< double > * t_L1CenJetPt
spr::genSimInfo isoinfo15x15
std::vector< double > * t_maxNearPHC5x5
std::vector< double > * t_cHadronEneHCR_2
std::vector< double > * t_cHadronEne11x11_3
std::vector< double > * t_cHadronEneHCR
std::vector< double > * t_cHadronEne1x1
std::vector< double > * t_isoTrkDPhiAll
std::vector< double > * t_photonEneIsoHCR
std::vector< double > * t_nHadronEne31x31
std::vector< double > * t_maxNearP3x3
double p2[4]
Definition: TauolaWrapper.h:90
std::vector< double > * t_cHadronEne1x1_1
std::vector< double > * t_cHadronEne21x21_1
std::vector< double > * t_isoTrkPhiEC
std::vector< double > * t_cHadronEne11x11_2
std::vector< double > * t_L1CenJetPhi
std::vector< double > * t_maxNearP1x1
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_L1GTobjmap_
std::vector< double > * t_maxNearPHC3x3
double DeltaPhi(double v1, double v2)
std::vector< double > * t_nHadronEneHCR
std::vector< double > * t_eleEneR
std::vector< double > * t_cHadronEneIsoR_2
std::vector< double > * t_cHadronEne9x9_1
std::vector< double > * t_eleEneIsoR
std::vector< double > * t_cHadronEneR_2
std::vector< double > * t_isoTrkPhiAll
void fillTrack(GlobalPoint &posVec, math::XYZTLorentzVector &momVec, GlobalPoint &posECAL, int pdgId, bool okECAL, bool accpet)
bool operator()(const HepMC::GenParticle *a, const HepMC::GenParticle *b) const
std::vector< double > * t_photonEneHC1x1
std::vector< double > * t_L1FwdJetEta
std::vector< double > * t_maxNearPR
edm::EDGetTokenT< l1extra::L1EmParticleCollection > tok_L1extNonIsoEm_
std::vector< double > * t_muEne31x31
void fillIsolatedTrack(math::XYZTLorentzVector &momVec, GlobalPoint &posECAL, int pdgId)
std::vector< double > * t_isoTrkPtAll
double genPartEtaBins[NEtaBins+1]
std::vector< double > * t_isoTrkP
std::vector< double > * t_nHadronEne11x11
std::vector< double > * t_nHadronEneIsoR
std::vector< double > * t_L1NonIsoEMPhi
std::vector< double > * t_eleEne21x21
std::vector< double > * t_maxNearPHC1x1
std::vector< double > * t_cHadronEne9x9_2
std::vector< double > * t_cHadronEne31x31_3
std::vector< double > * t_maxNearP9x9
std::vector< double > * t_photonEne31x31
std::vector< double > * t_nHadronEneHC3x3
std::vector< double > * t_cHadronEne15x15_2
std::vector< double > * t_photonEne15x15
std::vector< double > * t_L1NonIsoEMEta
std::vector< double > * t_isoTrkPhi
std::vector< double > * t_nHadronEne15x15
std::vector< double > * t_cHadronEneHC1x1_1
std::vector< double > * t_photonEneR
std::vector< double > * t_isoTrkEtaEC
std::vector< double > * t_nHadronEne1x1
std::vector< double > * t_cHadronEne3x3
edm::EDGetTokenT< edm::HepMCProduct > tok_hepmc_
std::vector< double > * t_cHadronEne25x25_2
const MagneticField * bField
std::vector< double > * t_L1IsoEMPhi
std::vector< double > * t_cHadronEneHC5x5_3
edm::EDGetTokenT< reco::GenParticleCollection > tok_genParticles_
std::vector< double > * t_photonEne9x9
std::vector< double > * t_L1METPhi
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< double > * t_nHadronEne25x25
std::vector< double > * t_photonEne3x3
std::vector< double > * t_cHadronEneHC3x3_3
std::vector< double > * t_eleEneHC1x1
std::vector< double > * t_photonEne11x11
std::vector< double > * t_muEne3x3
double genPartPBins[NPBins+1]
std::vector< double > * t_cHadronEne9x9
std::vector< double > * t_muEne15x15
std::vector< double > * t_cHadronEne21x21_2
std::vector< double > * t_cHadronEne3x3_1
std::vector< double > * t_cHadronEneHC3x3_1
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extFwdJet_
std::vector< double > * t_cHadronEne25x25_1
std::vector< double > * t_cHadronEne15x15
std::vector< double > * t_cHadronEne21x21
std::vector< double > * t_L1METPt
std::vector< double > * t_muEneHC5x5
std::vector< double > * t_cHadronEneR_1
std::vector< double > * t_cHadronEne21x21_3
std::vector< double > * t_L1MuonPhi
std::vector< double > * t_cHadronEne7x7_3
double DeltaR(double eta1, double phi1, double eta2, double phi2)
std::vector< double > * t_photonEneIsoR
std::vector< double > * t_cHadronEne7x7
std::vector< double > * t_eleEne15x15
std::vector< double > * t_maxNearPIsoR
std::vector< double > * t_nHadronEne3x3
std::vector< double > * t_nHadronEneHC5x5
std::vector< double > * t_isoTrkEne
std::vector< double > * t_cHadronEne1x1_3