Fork me on GitHub

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

Last change on this file since 263 was 260, checked in by severine ovyn, 16 years ago

add header

File size: 10.1 KB
Line 
1#ifndef _SMEARUTIL_H_
2#define _SMEARUTIL_H_
3
4/***********************************************************************
5** **
6** /----------------------------------------------\ **
7** | Delphes, a framework for the fast simulation | **
8** | of a generic collider experiment | **
9** \----------------------------------------------/ **
10** **
11** **
12** This package uses: **
13** ------------------ **
14** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
15** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
16** FROG: [hep-ex/0901.2718v1] **
17** **
18** ------------------------------------------------------------------ **
19** **
20** Main authors: **
21** ------------- **
22** **
23** Severine Ovyn Xavier Rouby **
24** severine.ovyn@uclouvain.be xavier.rouby@cern **
25** **
26** Center for Particle Physics and Phenomenology (CP3) **
27** Universite catholique de Louvain (UCL) **
28** Louvain-la-Neuve, Belgium **
29** **
30** Copyright (C) 2008-2009, **
31** All rights reserved. **
32** **
33***********************************************************************/
34
35/// \file SmearUtil.h
36/// \brief RESOLution class, and some generic definitions
37
38
39#include <vector>
40#include "TLorentzVector.h"
41
42#include "BlockClasses.h"
43#include "TSimpleArray.h"
44#include "PhysicsTower.hh"
45
46using namespace std;
47
48class ParticleUtil {
49
50 public:
51 ParticleUtil(const TLorentzVector &genMomentum, int pid);
52
53 float E() {return _e;} // particle energy [GeV]
54 float Px() {return _px;} // horizontal coordinate of momentum [GeV]
55 float Py() {return _py;} // vertical coordinate of momentum [GeV]
56 float Pz() {return _pz;} // longitudinal coordinate of momentum [GeV]
57 float Pt() {return _pt;} // transverse momentum [GeV]
58 float EtaCalo() {return _etaCalo;} // pseudorapidity
59 float Eta() {return _eta;} // pseudorapidity
60 float PhiCalo() {return _phiCalo;} // azimuthal angle
61 float Phi() {return _phi;} // azimuthal angle
62 int PID() {return _pid;} // particle energy in [GeV]
63
64 private:
65 float _e, _px, _py, _pz, _pt;
66 float _eta, _etaCalo, _phi, _phiCalo;
67 int _pid;
68};
69
70#ifndef __PI__
71#define __PI__
72extern const float pi = 3.14159265358979312;
73#endif
74
75class RESOLution
76{
77 public:
78 /// Constructor
79 RESOLution();
80 RESOLution(const RESOLution & DET);
81 RESOLution& operator=(const RESOLution& DET);
82 ~RESOLution() { delete [] TOWER_eta_edges; delete [] TOWER_dphi;};
83
84 // Detector coverage
85 float CEN_max_tracker; // tracker pseudorapidity coverage
86 float CEN_max_calo_cen; // central calorimeter pseudorapidity coverage
87 float CEN_max_calo_fwd; // forward calorimeter pseudorapidity coverage
88 float CEN_max_mu; // muon chambers pseudorapidity coverage
89
90 float VFD_min_calo_vfd; // very forward calorimeter pseudorapidity coverage
91 float VFD_max_calo_vfd; // very forward calorimeter pseudorapidity coverage
92 float VFD_min_zdc; // coverage for Zero Degree Calorimeter, for photons and neutrons
93 float VFD_s_zdc; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
94
95 float RP_220_s; // distance of the RP to the IP, in meters
96 float RP_220_x; // distance of the RP to the beam, in meters
97 float RP_420_s; // distance of the RP to the IP, in meters
98 float RP_420_x; // distance of the RP to the beam, in meters
99 string RP_beam1Card; //
100 string RP_beam2Card; //
101 string RP_IP_name; //
102 float RP_offsetEl_s;
103 float RP_offsetEl_x;
104 float RP_cross_x;
105 float RP_cross_y;
106 float RP_cross_ang;
107
108
109 //energy resolution for electron/photon
110 // \sigma/E = C + N/E + S/\sqrt{E}
111 float ELG_Scen; // S term for central ECAL
112 float ELG_Ncen; // N term for central ECAL
113 float ELG_Ccen; // C term for central ECAL
114 float ELG_Sfwd; // S term for forward ECAL
115 float ELG_Cfwd; // C term for forward ECAL
116 float ELG_Nfwd; // N term for central ECAL
117
118 //energy resolution for hadrons in ecal/hcal/hf
119 // \sigma/E = C + N/E + S/\sqrt{E}
120 float HAD_Shcal; // S term for central HCAL // hadronic calorimeter
121 float HAD_Nhcal; // N term for central HCAL
122 float HAD_Chcal; // C term for central HCAL
123 float HAD_Shf; // S term for central HF // forward calorimeter
124 float HAD_Nhf; // N term for central HF
125 float HAD_Chf; // C term for central HF
126
127 // muon smearing
128 float MU_SmearPt;
129
130 //Magnetic Field information
131 int TRACK_radius; //radius of the BField coverage
132 int TRACK_length; //length of the BField coverage
133 float TRACK_bfield_x;
134 float TRACK_bfield_y;
135 float TRACK_bfield_z;
136 float TRACK_ptmin; // minimal pt needed to reach the calorimeter, in GeV
137 int TRACK_eff; // in percent, should be an integer
138
139
140 //Define Calorimetric towers
141 unsigned int TOWER_number;
142 float * TOWER_eta_edges;
143 float * TOWER_dphi;
144
145 //thresholds for reconstructed objetcs
146 float PTCUT_elec;
147 float PTCUT_muon;
148 float PTCUT_jet;
149 float PTCUT_gamma;
150 float PTCUT_taujet;
151
152 //General jet variable
153 double JET_coneradius;
154 int JET_jetalgo;
155 double JET_seed;
156 double JET_overlap;
157
158 // MidPoint algorithm definition
159 double JET_M_coneareafraction;
160 int JET_M_maxpairsize;
161 int JET_M_maxiterations;
162 // Define Cone algorithm.
163 int JET_C_adjacencycut;
164 int JET_C_maxiterations;
165 int JET_C_iratch;
166 //Define SISCone algorithm.
167 int JET_S_npass;
168 double JET_S_protojet_ptmin;
169
170 //For Tau-jet definition
171 // R = sqrt (phi^2 + eta^2)
172 float TAU_energy_scone; // radius R of the cone for tau definition, based on energy threshold
173 float TAU_track_scone; // radius R of the cone for tau definition, based on track number
174 float TAU_track_pt; // minimal pt [GeV] for tracks to be considered in tau definition
175 float TAU_energy_frac; // fraction of energy required in the central part of the cone, for tau jets
176
177 //tagging definition
178 int BTAG_b;
179 int BTAG_mistag_c;
180 int BTAG_mistag_l;
181
182
183 //trigger flag
184 int FLAG_trigger; //flag for trigger
185 int FLAG_frog; //flag for frog display
186 int FLAG_bfield; //flag for bfield propagation
187 int FLAG_vfd; //flag for very forward detector
188
189 int NEvents_Frog;
190 float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV
191
192 // to sort a vector
193 void SortedVector(vector<ParticleUtil> &vect);
194
195 /// Reads the data card for the initialisation of the parameters
196 void ReadDataCard(const string datacard);
197
198 /// Create the output log file
199 void Logfile(const string& LogName);
200
201 /// Provides the smeared TLorentzVector for the electrons
202 void SmearElectron(TLorentzVector &electron);
203
204 /// Provides the smeared TLorentzVector for the muons
205 void SmearMu(TLorentzVector &muon);
206
207 /// Provides the smeared TLorentzVector for the hadrons
208 void SmearHadron(TLorentzVector &hadron, const float frac);
209
210 /// For electromagnetic collimation in tau jets
211 double EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi);
212
213 /// Number of tracks in tau jet algo
214 unsigned int NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
215
216 /// b-jets
217 int Bjets(const TSimpleArray<TRootGenParticle> &subarray, const float eta, const float phi);
218
219 /// b-tag efficiency and misidentification
220 bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootGenParticle> &subarray);
221
222 /// Lepton isolation
223 bool Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
224
225 //********************* returns a segmented value for eta and phi, for calo towers *****
226 void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta);
227
228};
229
230
231// particles PID (PDG ID)
232const int pU = 1; // c quark
233const int pD = 2; // b quark
234const int pS = 3; // s quark
235const int pC = 4; // c quark
236const int pB = 5; // b quark
237const int pE = 11; // e
238const int pNU1 = 12; // nu_e
239const int pMU = 13; // mu
240const int pNU2 = 14; // nu_mu
241const int pTAU = 15; // tau
242const int pNU3 = 16; // nu_tau
243const int pGLUON = 21; // gluon
244const int pGAMMA = 22; // gamma
245const int pW = 24; // W
246const int pP = 2212; // proton
247const int pN = 2112; // neutron
248const int pPI0 = 111; // pi_0
249const int pK0L = 130; // K^0_L
250const int pK0S = 310; // K^0_S
251const int pLAMBDA = 3122; // Lambda
252const int pSIGMA0 = 3212; // Sigma^0
253const int pDELTA0 = 2114; // Delta^0
254
255const double speed_of_light = 299792458; // m/s
256const float UNDEFINED=-9999.;
257
258
259// ** returns the sign (+1 or -1) or an integer
260int sign(const int myint);
261int sign(const float myfloat);
262
263// **************************** Return the Delta Phi****************************
264float DeltaPhi(const float phi1, const float phi2);
265
266// **************************** Returns the Delta R****************************
267float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2);
268
269//************* Returns an array of the quarks sitting within the tracker acceptance ***************
270int Charge(const int pid);
271
272#endif
Note: See TracBrowser for help on using the repository browser.