Fork me on GitHub

source: svn/trunk/interface/SmearUtil.h@ 73

Last change on this file since 73 was 73, checked in by uid677, 16 years ago

new PartUtil class

File size: 7.8 KB
Line 
1#ifndef _SMEARUTIL_H_
2#define _SMEARUTIL_H_
3
4/*
5 ---- Delphes ----
6 A Fast Simulator for general purpose LHC detector
7 S. Ovyn ~~~~ severine.ovyn@uclouvain.be
8
9 Center for Particle Physics and Phenomenology (CP3)
10 Universite Catholique de Louvain (UCL)
11 Louvain-la-Neuve, Belgium
12*/
13
14/// \file SmearUtil.h
15/// \brief RESOLution class, and some generic definitions
16
17
18#include <vector>
19#include "TLorentzVector.h"
20
21#include "Utilities/ExRootAnalysis/interface/BlockClasses.h"
22#include "Utilities/ExRootAnalysis/interface/TSimpleArray.h"
23
24#include "Utilities/Fastjet/plugins/CDFCones/interface/PhysicsTower.hh"
25
26#include <iostream>
27#include <sstream>
28#include <fstream>
29#include <iomanip>
30
31using namespace std;
32
33class ParticleUtil {
34
35 public:
36
37 TLorentzVector TLVector;
38 int Pid;
39
40 ParticleUtil(const TLorentzVector &genMomentum,const int &pid) : TLVector(genMomentum) , Pid(pid) {}
41
42 float E() {return TLVector.E();} // particle energy in GeV
43 float Px() {return TLVector.Px();} // particle energy in GeV
44 float Py() {return TLVector.Py();} // particle energy in GeV
45 float Pz() {return TLVector.Pz();} // particle energy in GeV
46 float Pt() {return TLVector.Pt();} // particle energy in GeV
47 float Eta() {return TLVector.Eta();} // particle energy in GeV
48 float Phi() {return TLVector.Phi();} // particle energy in GeV
49 float PID() {return Pid;} // particle energy in GeV
50
51 private:
52
53};
54
55
56class RESOLution
57{
58 public:
59 /// Constructor
60 RESOLution();
61
62 // Detector coverage
63 float MAX_TRACKER; // tracker pseudorapidity coverage
64 float MAX_CALO_CEN; // central calorimeter pseudorapidity coverage
65 float MAX_CALO_FWD; // forward calorimeter pseudorapidity coverage
66 float MAX_MU; // muon chambers pseudorapidity coverage
67 float MIN_CALO_VFWD; // very forward calorimeter pseudorapidity coverage
68 float MAX_CALO_VFWD; // very forward calorimeter pseudorapidity coverage
69 float MIN_ZDC; // coverage for Zero Degree Calorimeter, for photons and neutrons
70
71 float ZDC_S; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
72 float RP220_S; // distance of the RP to the IP, in meters
73 float RP220_X; // distance of the RP to the beam, in meters
74 float FP420_S; // distance of the RP to the IP, in meters
75 float FP420_X; // distance of the RP to the beam, in meters
76
77 //Magnetic Field information
78 int TRACKING_RADIUS; //radius of the BField coverage
79 int TRACKING_LENGTH; //length of the BField coverage
80 float BFIELD_X;
81 float BFIELD_Y;
82 float BFIELD_Z;
83
84
85 //energy resolution for electron/photon
86 // \sigma/E = C + N/E + S/\sqrt{E}
87 float ELG_Scen; // S term for central ECAL
88 float ELG_Ncen; // N term for central ECAL
89 float ELG_Ccen; // C term for central ECAL
90 float ELG_Sfwd; // S term for forward ECAL
91 float ELG_Cfwd; // C term for forward ECAL
92 float ELG_Nfwd; // N term for central ECAL
93
94 //energy resolution for hadrons in ecal/hcal/hf
95 // \sigma/E = C + N/E + S/\sqrt{E}
96 float HAD_Shcal; // S term for central HCAL // hadronic calorimeter
97 float HAD_Nhcal; // N term for central HCAL
98 float HAD_Chcal; // C term for central HCAL
99 float HAD_Shf; // S term for central HF // forward calorimeter
100 float HAD_Nhf; // N term for central HF
101 float HAD_Chf; // C term for central HF
102
103 // muon smearing
104 float MU_SmearPt;
105
106 //threshold for reconstructed objetcs
107 float ELEC_pt;
108 float MUON_pt;
109 float JET_pt;
110 float TAUJET_pt;
111
112 //For Tau-jet definition
113 // R = sqrt (phi^2 + eta^2)
114 float TAU_CONE_ENERGY; // radius R of the cone for tau definition, based on energy threshold
115 float TAU_CONE_TRACKS; // radius R of the cone for tau definition, based on track number
116 float PT_TRACK_TAU; // minimal pt [GeV] for tracks to be considered in tau definition
117 float TAU_EM_COLLIMATION; // fraction of energy required in the central part of the cone, for tau jets
118
119 // Tracker acceptance
120 float PT_TRACKS_MIN; // minimal pt needed to reach the calorimeter, in GeV
121 float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV
122 int TRACKING_EFF; // in percent, should be an integer
123
124 //tagging definition
125 int TAGGING_B; //
126 int MISTAGGING_C;
127 int MISTAGGING_L;
128
129 //trigger flag
130 int DOTRIGGER;
131
132 double CONERADIUS;
133 int JETALGO;
134
135 //General jet variable
136 double SEEDTHRESHOLD;
137 double OVERLAPTHRESHOLD;
138
139 // MidPoint algorithm definition
140 double M_CONEAREAFRACTION;
141 int M_MAXPAIRSIZE;
142 int M_MAXITERATIONS;
143
144 // Define Cone algorithm.
145 int C_ADJACENCYCUT;
146 int C_MAXITERATIONS;
147 int C_IRATCH;
148
149 //Define SISCone algorithm.
150 int NPASS;
151 double PROTOJET_PTMIN;
152
153 // Define Calorimetric towers
154 unsigned int NTOWERS;
155 float * TOWER_ETA_EDGES;
156 float * TOWER_DPHI;
157
158
159 /// Reads the data card for the initialisation of the parameters
160 void ReadDataCard(const string datacard);
161
162 /// Create the output log file
163 void Logfile(string LogName);
164
165 /// Provides the smeared TLorentzVector for the electrons
166 void SmearElectron(TLorentzVector &electron);
167
168 /// Provides the smeared TLorentzVector for the muons
169 void SmearMu(TLorentzVector &muon);
170
171 /// Provides the smeared TLorentzVector for the hadrons
172 void SmearHadron(TLorentzVector &hadron, const float frac);
173
174 //*****************************fonction pour avoir les taus************************************
175 double EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi);
176
177 //***************** Fonction pour avoir le nombre de traces pour les taus****************************
178 unsigned int NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
179
180 //**********************fonction pour avoir les b-jets******************************
181 int Bjets(const TSimpleArray<TRootGenParticle> &subarray, const float eta, const float phi);
182
183 //******************** retourne l'efficacite de b-tagging ******************************
184 bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootGenParticle> &subarray);
185
186 //******************************isolation criteria**************************************
187 bool Isolation(Float_t phi,Float_t eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
188
189 //********************* returns a segmented value for eta and phi, for calo towers *****
190 void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta);
191
192};
193
194
195// particles PID (PDG ID)
196const int pU = 1; // c quark
197const int pD = 2; // b quark
198const int pS = 3; // s quark
199const int pC = 4; // c quark
200const int pB = 5; // b quark
201const int pE = 11; // e
202const int pNU1 = 12; // nu_e
203const int pMU = 13; // mu
204const int pNU2 = 14; // nu_mu
205const int pTAU = 15; // tau
206const int pNU3 = 16; // nu_tau
207const int pGLUON = 21; // gluon
208const int pGAMMA = 22; // gamma
209const int pW = 24; // W
210const int pP = 2212; // proton
211const int pN = 2112; // neutron
212const int pPI0 = 111; // pi_0
213const int pK0L = 130; // K^0_L
214const int pK0S = 310; // K^0_S
215const int pLAMBDA = 3122; // Lambda
216const int pSIGMA0 = 3212; // Sigma^0
217const int pDELTA0 = 2114; // Delta^0
218
219const double speed_of_light = 299792458; // m/s
220
221#ifndef __PI__
222#define __PI__
223const double PI = acos(-1.0);
224#endif
225
226// ** returns the sign (+1 or -1) or an integer
227int sign(const int myint);
228int sign(const float myfloat);
229
230// **************************** Return the Delta Phi****************************
231float DeltaPhi(const float phi1, const float phi2);
232
233// **************************** Returns the Delta R****************************
234float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2);
235
236//************* Returns an array of the quarks sitting within the tracker acceptance ***************
237int Charge(int pid);
238
239#endif
Note: See TracBrowser for help on using the repository browser.