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 = 21;
110  static const int NPBins = 3;
111  static const int NEtaBins = 4;
112  static const int Particles=12;
117 
120 
123 
125  static const size_t nL1BitsMax=128;
128 
134 
143 
144 
146 
150 
151  TTree *tree;
152 
153  std::vector<double> *t_isoTrkPAll;
154  std::vector<double> *t_isoTrkPtAll;
155  std::vector<double> *t_isoTrkPhiAll;
156  std::vector<double> *t_isoTrkEtaAll;
157  std::vector<double> *t_isoTrkPdgIdAll;
158  std::vector<double> *t_isoTrkDEtaAll;
159  std::vector<double> *t_isoTrkDPhiAll;
160 
161  std::vector<double> *t_isoTrkP;
162  std::vector<double> *t_isoTrkPt;
163  std::vector<double> *t_isoTrkEne;
164  std::vector<double> *t_isoTrkEta;
165  std::vector<double> *t_isoTrkPhi;
166  std::vector<double> *t_isoTrkEtaEC;
167  std::vector<double> *t_isoTrkPhiEC;
168  std::vector<double> *t_isoTrkPdgId;
169 
170  std::vector<double> *t_maxNearP31x31;
172  std::vector<double> *t_nHadronEne31x31;
173  std::vector<double> *t_photonEne31x31;
174  std::vector<double> *t_eleEne31x31;
175  std::vector<double> *t_muEne31x31;
176 
177  std::vector<double> *t_maxNearP25x25;
179  std::vector<double> *t_nHadronEne25x25;
180  std::vector<double> *t_photonEne25x25;
181  std::vector<double> *t_eleEne25x25;
182  std::vector<double> *t_muEne25x25;
183 
184  std::vector<double> *t_maxNearP21x21;
186  std::vector<double> *t_nHadronEne21x21;
187  std::vector<double> *t_photonEne21x21;
188  std::vector<double> *t_eleEne21x21;
189  std::vector<double> *t_muEne21x21;
190 
191  std::vector<double> *t_maxNearP15x15;
193  std::vector<double> *t_nHadronEne15x15;
194  std::vector<double> *t_photonEne15x15;
195  std::vector<double> *t_eleEne15x15;
196  std::vector<double> *t_muEne15x15;
197 
198  std::vector<double> *t_maxNearP11x11;
200  std::vector<double> *t_nHadronEne11x11;
201  std::vector<double> *t_photonEne11x11;
202  std::vector<double> *t_eleEne11x11;
203  std::vector<double> *t_muEne11x11;
204 
205  std::vector<double> *t_maxNearP9x9;
207  std::vector<double> *t_nHadronEne9x9;
208  std::vector<double> *t_photonEne9x9;
209  std::vector<double> *t_eleEne9x9;
210  std::vector<double> *t_muEne9x9;
211 
212  std::vector<double> *t_maxNearP7x7;
214  std::vector<double> *t_nHadronEne7x7;
215  std::vector<double> *t_photonEne7x7;
216  std::vector<double> *t_eleEne7x7;
217  std::vector<double> *t_muEne7x7;
218 
219  std::vector<double> *t_maxNearP3x3;
221  std::vector<double> *t_nHadronEne3x3;
222  std::vector<double> *t_photonEne3x3;
223  std::vector<double> *t_eleEne3x3;
224  std::vector<double> *t_muEne3x3;
225 
226  std::vector<double> *t_maxNearP1x1;
228  std::vector<double> *t_nHadronEne1x1;
229  std::vector<double> *t_photonEne1x1;
230  std::vector<double> *t_eleEne1x1;
231  std::vector<double> *t_muEne1x1;
232 
233  std::vector<double> *t_maxNearPHC1x1;
235  std::vector<double> *t_nHadronEneHC1x1;
236  std::vector<double> *t_photonEneHC1x1;
237  std::vector<double> *t_eleEneHC1x1;
238  std::vector<double> *t_muEneHC1x1;
239 
240  std::vector<double> *t_maxNearPHC3x3;
242  std::vector<double> *t_nHadronEneHC3x3;
243  std::vector<double> *t_photonEneHC3x3;
244  std::vector<double> *t_eleEneHC3x3;
245  std::vector<double> *t_muEneHC3x3;
246 
247  std::vector<double> *t_maxNearPHC5x5;
249  std::vector<double> *t_nHadronEneHC5x5;
250  std::vector<double> *t_photonEneHC5x5;
251  std::vector<double> *t_eleEneHC5x5;
252  std::vector<double> *t_muEneHC5x5;
253 
254  std::vector<double> *t_maxNearPHC7x7;
256  std::vector<double> *t_nHadronEneHC7x7;
257  std::vector<double> *t_photonEneHC7x7;
258  std::vector<double> *t_eleEneHC7x7;
259  std::vector<double> *t_muEneHC7x7;
260 
261  std::vector<double> *t_maxNearPR;
263  std::vector<double> *t_nHadronEneR;
264  std::vector<double> *t_photonEneR;
265  std::vector<double> *t_eleEneR;
266  std::vector<double> *t_muEneR;
267 
268  std::vector<double> *t_maxNearPIsoR;
270  std::vector<double> *t_nHadronEneIsoR;
271  std::vector<double> *t_photonEneIsoR;
272  std::vector<double> *t_eleEneIsoR;
273  std::vector<double> *t_muEneIsoR;
274 
275  std::vector<double> *t_maxNearPHCR;
277  std::vector<double> *t_nHadronEneHCR;
278  std::vector<double> *t_photonEneHCR;
279  std::vector<double> *t_eleEneHCR;
280  std::vector<double> *t_muEneHCR;
281 
282  std::vector<double> *t_maxNearPIsoHCR;
284  std::vector<double> *t_nHadronEneIsoHCR;
285  std::vector<double> *t_photonEneIsoHCR;
286  std::vector<double> *t_eleEneIsoHCR;
287  std::vector<double> *t_muEneIsoHCR;
288 
289  std::vector<int> *t_L1Decision;
290  std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
291  std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
292  std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
293  std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
294  std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
296  std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
297 
302 
303 };
304 
305 #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
edm::InputTag L1GTReadoutRcdSource_
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
edm::InputTag L1extraNonIsoEmSource_
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
edm::InputTag L1extraTauJetSource_
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
edm::InputTag L1GTObjectMapRcdSource_
std::vector< double > * t_cHadronEneR_3
edm::InputTag L1extraCenJetSource_
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]
edm::InputTag L1extraFwdJetSource_
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
edm::InputTag L1extraMuonSource_
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
edm::InputTag L1extraIsoEmSource_
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