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 "TH1F.h"
63 #include "TH2F.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 
108  //static const int NPBins = 21;
109  static const int NPBins = 3;
110  static const int NEtaBins = 4;
115 
116  std::string genSrc_;
118 
120  static const size_t nL1BitsMax=128;
121  std::string algoBitToName[nL1BitsMax];
123 
133 
134 
136 
139 
140  TTree *tree;
141 
142  std::vector<double> *t_isoTrkPAll;
143  std::vector<double> *t_isoTrkPtAll;
144  std::vector<double> *t_isoTrkPhiAll;
145  std::vector<double> *t_isoTrkEtaAll;
146  std::vector<double> *t_isoTrkPdgIdAll;
147  std::vector<double> *t_isoTrkDEtaAll;
148  std::vector<double> *t_isoTrkDPhiAll;
149 
150  std::vector<double> *t_isoTrkP;
151  std::vector<double> *t_isoTrkPt;
152  std::vector<double> *t_isoTrkEne;
153  std::vector<double> *t_isoTrkEta;
154  std::vector<double> *t_isoTrkPhi;
155  std::vector<double> *t_isoTrkEtaEC;
156  std::vector<double> *t_isoTrkPhiEC;
157  std::vector<double> *t_isoTrkPdgId;
158 
159  std::vector<double> *t_maxNearP31x31;
161  std::vector<double> *t_nHadronEne31x31;
162  std::vector<double> *t_photonEne31x31;
163  std::vector<double> *t_eleEne31x31;
164  std::vector<double> *t_muEne31x31;
165 
166  std::vector<double> *t_maxNearP25x25;
168  std::vector<double> *t_nHadronEne25x25;
169  std::vector<double> *t_photonEne25x25;
170  std::vector<double> *t_eleEne25x25;
171  std::vector<double> *t_muEne25x25;
172 
173  std::vector<double> *t_maxNearP21x21;
175  std::vector<double> *t_nHadronEne21x21;
176  std::vector<double> *t_photonEne21x21;
177  std::vector<double> *t_eleEne21x21;
178  std::vector<double> *t_muEne21x21;
179 
180  std::vector<double> *t_maxNearP15x15;
182  std::vector<double> *t_nHadronEne15x15;
183  std::vector<double> *t_photonEne15x15;
184  std::vector<double> *t_eleEne15x15;
185  std::vector<double> *t_muEne15x15;
186 
187  std::vector<double> *t_maxNearP11x11;
189  std::vector<double> *t_nHadronEne11x11;
190  std::vector<double> *t_photonEne11x11;
191  std::vector<double> *t_eleEne11x11;
192  std::vector<double> *t_muEne11x11;
193 
194  std::vector<double> *t_maxNearP9x9;
196  std::vector<double> *t_nHadronEne9x9;
197  std::vector<double> *t_photonEne9x9;
198  std::vector<double> *t_eleEne9x9;
199  std::vector<double> *t_muEne9x9;
200 
201  std::vector<double> *t_maxNearP7x7;
203  std::vector<double> *t_nHadronEne7x7;
204  std::vector<double> *t_photonEne7x7;
205  std::vector<double> *t_eleEne7x7;
206  std::vector<double> *t_muEne7x7;
207 
208  std::vector<double> *t_maxNearP3x3;
210  std::vector<double> *t_nHadronEne3x3;
211  std::vector<double> *t_photonEne3x3;
212  std::vector<double> *t_eleEne3x3;
213  std::vector<double> *t_muEne3x3;
214 
215  std::vector<double> *t_maxNearP1x1;
217  std::vector<double> *t_nHadronEne1x1;
218  std::vector<double> *t_photonEne1x1;
219  std::vector<double> *t_eleEne1x1;
220  std::vector<double> *t_muEne1x1;
221 
222  std::vector<double> *t_maxNearPHC1x1;
224  std::vector<double> *t_nHadronEneHC1x1;
225  std::vector<double> *t_photonEneHC1x1;
226  std::vector<double> *t_eleEneHC1x1;
227  std::vector<double> *t_muEneHC1x1;
228 
229  std::vector<double> *t_maxNearPHC3x3;
231  std::vector<double> *t_nHadronEneHC3x3;
232  std::vector<double> *t_photonEneHC3x3;
233  std::vector<double> *t_eleEneHC3x3;
234  std::vector<double> *t_muEneHC3x3;
235 
236  std::vector<double> *t_maxNearPHC5x5;
238  std::vector<double> *t_nHadronEneHC5x5;
239  std::vector<double> *t_photonEneHC5x5;
240  std::vector<double> *t_eleEneHC5x5;
241  std::vector<double> *t_muEneHC5x5;
242 
243  std::vector<double> *t_maxNearPHC7x7;
245  std::vector<double> *t_nHadronEneHC7x7;
246  std::vector<double> *t_photonEneHC7x7;
247  std::vector<double> *t_eleEneHC7x7;
248  std::vector<double> *t_muEneHC7x7;
249 
250  std::vector<double> *t_maxNearPR;
252  std::vector<double> *t_nHadronEneR;
253  std::vector<double> *t_photonEneR;
254  std::vector<double> *t_eleEneR;
255  std::vector<double> *t_muEneR;
256 
257  std::vector<double> *t_maxNearPIsoR;
259  std::vector<double> *t_nHadronEneIsoR;
260  std::vector<double> *t_photonEneIsoR;
261  std::vector<double> *t_eleEneIsoR;
262  std::vector<double> *t_muEneIsoR;
263 
264  std::vector<double> *t_maxNearPHCR;
266  std::vector<double> *t_nHadronEneHCR;
267  std::vector<double> *t_photonEneHCR;
268  std::vector<double> *t_eleEneHCR;
269  std::vector<double> *t_muEneHCR;
270 
271  std::vector<double> *t_maxNearPIsoHCR;
273  std::vector<double> *t_nHadronEneIsoHCR;
274  std::vector<double> *t_photonEneIsoHCR;
275  std::vector<double> *t_eleEneIsoHCR;
276  std::vector<double> *t_muEneIsoHCR;
277 
278  std::vector<int> *t_L1Decision;
279  std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
280  std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
281  std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
282  std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
283  std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
285  std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
286 
291 
292 };
293 
294 #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
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
std::vector< double > * t_L1IsoEMEta
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
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 &)
std::vector< double > * t_maxNearP7x7
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:30
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
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
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
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
std::vector< double > * t_cHadronEne25x25_2
const MagneticField * bField
std::vector< double > * t_L1IsoEMPhi
std::vector< double > * t_cHadronEneHC5x5_3
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
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