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 |
|
---|
31 | using namespace std;
|
---|
32 |
|
---|
33 | class 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 |
|
---|
56 | class RESOLution
|
---|
57 | {
|
---|
58 | public:
|
---|
59 | /// Constructor
|
---|
60 | RESOLution();
|
---|
61 |
|
---|
62 | // Detector coverage
|
---|
63 | float CEN_max_tracker; // tracker pseudorapidity coverage
|
---|
64 | float CEN_max_calo_cen; // central calorimeter pseudorapidity coverage
|
---|
65 | float CEN_max_calo_fwd; // forward calorimeter pseudorapidity coverage
|
---|
66 | float CEN_max_mu; // muon chambers pseudorapidity coverage
|
---|
67 |
|
---|
68 | float VFD_min_calo_vfd; // very forward calorimeter pseudorapidity coverage
|
---|
69 | float VFD_max_calo_vfd; // very forward calorimeter pseudorapidity coverage
|
---|
70 | float VFD_min_zdc; // coverage for Zero Degree Calorimeter, for photons and neutrons
|
---|
71 | float VFD_s_zdc; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
|
---|
72 |
|
---|
73 | float RP_220_s; // distance of the RP to the IP, in meters
|
---|
74 | float RP_220_x; // distance of the RP to the beam, in meters
|
---|
75 | float RP_420_s; // distance of the RP to the IP, in meters
|
---|
76 | float RP_420_x; // distance of the RP to the beam, in meters
|
---|
77 |
|
---|
78 |
|
---|
79 | //energy resolution for electron/photon
|
---|
80 | // \sigma/E = C + N/E + S/\sqrt{E}
|
---|
81 | float ELG_Scen; // S term for central ECAL
|
---|
82 | float ELG_Ncen; // N term for central ECAL
|
---|
83 | float ELG_Ccen; // C term for central ECAL
|
---|
84 | float ELG_Sfwd; // S term for forward ECAL
|
---|
85 | float ELG_Cfwd; // C term for forward ECAL
|
---|
86 | float ELG_Nfwd; // N term for central ECAL
|
---|
87 |
|
---|
88 | //energy resolution for hadrons in ecal/hcal/hf
|
---|
89 | // \sigma/E = C + N/E + S/\sqrt{E}
|
---|
90 | float HAD_Shcal; // S term for central HCAL // hadronic calorimeter
|
---|
91 | float HAD_Nhcal; // N term for central HCAL
|
---|
92 | float HAD_Chcal; // C term for central HCAL
|
---|
93 | float HAD_Shf; // S term for central HF // forward calorimeter
|
---|
94 | float HAD_Nhf; // N term for central HF
|
---|
95 | float HAD_Chf; // C term for central HF
|
---|
96 |
|
---|
97 | // muon smearing
|
---|
98 | float MU_SmearPt;
|
---|
99 |
|
---|
100 | //Magnetic Field information
|
---|
101 | int TRACK_radius; //radius of the BField coverage
|
---|
102 | int TRACK_length; //length of the BField coverage
|
---|
103 | float TRACK_bfield_x;
|
---|
104 | float TRACK_bfield_y;
|
---|
105 | float TRACK_bfield_z;
|
---|
106 | float TRACK_ptmin; // minimal pt needed to reach the calorimeter, in GeV
|
---|
107 | int TRACK_eff; // in percent, should be an integer
|
---|
108 |
|
---|
109 |
|
---|
110 | //Define Calorimetric towers
|
---|
111 | unsigned int TOWER_number;
|
---|
112 | float * TOWER_eta_edges;
|
---|
113 | float * TOWER_dphi;
|
---|
114 |
|
---|
115 | //thresholds for reconstructed objetcs
|
---|
116 | float PTCUT_elec;
|
---|
117 | float PTCUT_muon;
|
---|
118 | float PTCUT_jet;
|
---|
119 | float PTCUT_gamma;
|
---|
120 | float PTCUT_taujet;
|
---|
121 |
|
---|
122 | //General jet variable
|
---|
123 | double JET_coneradius;
|
---|
124 | int JET_jetalgo;
|
---|
125 | double JET_seed;
|
---|
126 | double JET_overlap;
|
---|
127 |
|
---|
128 | // MidPoint algorithm definition
|
---|
129 | double JET_M_coneareafraction;
|
---|
130 | int JET_M_maxpairsize;
|
---|
131 | int JET_M_maxiterations;
|
---|
132 | // Define Cone algorithm.
|
---|
133 | int JET_C_adjacencycut;
|
---|
134 | int JET_C_maxiterations;
|
---|
135 | int JET_C_iratch;
|
---|
136 | //Define SISCone algorithm.
|
---|
137 | int JET_S_npass;
|
---|
138 | double JET_S_protojet_ptmin;
|
---|
139 |
|
---|
140 | //For Tau-jet definition
|
---|
141 | // R = sqrt (phi^2 + eta^2)
|
---|
142 | float TAU_energy_scone; // radius R of the cone for tau definition, based on energy threshold
|
---|
143 | float TAU_track_scone; // radius R of the cone for tau definition, based on track number
|
---|
144 | float TAU_track_pt; // minimal pt [GeV] for tracks to be considered in tau definition
|
---|
145 | float TAU_energy_frac; // fraction of energy required in the central part of the cone, for tau jets
|
---|
146 |
|
---|
147 | //tagging definition
|
---|
148 | int BTAG_b;
|
---|
149 | int BTAG_mistag_c;
|
---|
150 | int BTAG_mistag_l;
|
---|
151 |
|
---|
152 |
|
---|
153 | //trigger flag
|
---|
154 | int FLAG_trigger; //flag for trigger
|
---|
155 | int FLAG_frog; //flag for frog display
|
---|
156 | int FLAG_bfield; //flag for bfield propagation
|
---|
157 | int FLAG_vfd; //flag for very forward detector
|
---|
158 |
|
---|
159 | int NEvents_Frog;
|
---|
160 |
|
---|
161 |
|
---|
162 |
|
---|
163 |
|
---|
164 |
|
---|
165 | float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV
|
---|
166 |
|
---|
167 | // to sort a vector
|
---|
168 | void SortedVector(vector<ParticleUtil> &vect);
|
---|
169 |
|
---|
170 | /// Reads the data card for the initialisation of the parameters
|
---|
171 | void ReadDataCard(const string datacard);
|
---|
172 |
|
---|
173 | /// Create the output log file
|
---|
174 | void Logfile(string LogName);
|
---|
175 |
|
---|
176 | /// Provides the smeared TLorentzVector for the electrons
|
---|
177 | void SmearElectron(TLorentzVector &electron);
|
---|
178 |
|
---|
179 | /// Provides the smeared TLorentzVector for the muons
|
---|
180 | void SmearMu(TLorentzVector &muon);
|
---|
181 |
|
---|
182 | /// Provides the smeared TLorentzVector for the hadrons
|
---|
183 | void SmearHadron(TLorentzVector &hadron, const float frac);
|
---|
184 |
|
---|
185 | //*****************************fonction pour avoir les taus************************************
|
---|
186 | double EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi);
|
---|
187 |
|
---|
188 | //***************** Fonction pour avoir le nombre de traces pour les taus****************************
|
---|
189 | unsigned int NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
|
---|
190 |
|
---|
191 | //**********************fonction pour avoir les b-jets******************************
|
---|
192 | int Bjets(const TSimpleArray<TRootGenParticle> &subarray, const float eta, const float phi);
|
---|
193 |
|
---|
194 | //******************** retourne l'efficacite de b-tagging ******************************
|
---|
195 | bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootGenParticle> &subarray);
|
---|
196 |
|
---|
197 | //******************************isolation criteria**************************************
|
---|
198 | bool Isolation(Float_t phi,Float_t eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
|
---|
199 |
|
---|
200 | //********************* returns a segmented value for eta and phi, for calo towers *****
|
---|
201 | void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta);
|
---|
202 |
|
---|
203 | };
|
---|
204 |
|
---|
205 |
|
---|
206 | // particles PID (PDG ID)
|
---|
207 | const int pU = 1; // c quark
|
---|
208 | const int pD = 2; // b quark
|
---|
209 | const int pS = 3; // s quark
|
---|
210 | const int pC = 4; // c quark
|
---|
211 | const int pB = 5; // b quark
|
---|
212 | const int pE = 11; // e
|
---|
213 | const int pNU1 = 12; // nu_e
|
---|
214 | const int pMU = 13; // mu
|
---|
215 | const int pNU2 = 14; // nu_mu
|
---|
216 | const int pTAU = 15; // tau
|
---|
217 | const int pNU3 = 16; // nu_tau
|
---|
218 | const int pGLUON = 21; // gluon
|
---|
219 | const int pGAMMA = 22; // gamma
|
---|
220 | const int pW = 24; // W
|
---|
221 | const int pP = 2212; // proton
|
---|
222 | const int pN = 2112; // neutron
|
---|
223 | const int pPI0 = 111; // pi_0
|
---|
224 | const int pK0L = 130; // K^0_L
|
---|
225 | const int pK0S = 310; // K^0_S
|
---|
226 | const int pLAMBDA = 3122; // Lambda
|
---|
227 | const int pSIGMA0 = 3212; // Sigma^0
|
---|
228 | const int pDELTA0 = 2114; // Delta^0
|
---|
229 |
|
---|
230 | const double speed_of_light = 299792458; // m/s
|
---|
231 |
|
---|
232 | #ifndef __PI__
|
---|
233 | #define __PI__
|
---|
234 | const double PI = acos(-1.0);
|
---|
235 | #endif
|
---|
236 |
|
---|
237 | // ** returns the sign (+1 or -1) or an integer
|
---|
238 | int sign(const int myint);
|
---|
239 | int sign(const float myfloat);
|
---|
240 |
|
---|
241 | // **************************** Return the Delta Phi****************************
|
---|
242 | float DeltaPhi(const float phi1, const float phi2);
|
---|
243 |
|
---|
244 | // **************************** Returns the Delta R****************************
|
---|
245 | float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2);
|
---|
246 |
|
---|
247 | //************* Returns an array of the quarks sitting within the tracker acceptance ***************
|
---|
248 | int Charge(int pid);
|
---|
249 |
|
---|
250 | #endif
|
---|