Fork me on GitHub

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

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

sorted vector

File size: 7.9 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 GAMMA_pt;
111 float TAUJET_pt;
112
113 //For Tau-jet definition
114 // R = sqrt (phi^2 + eta^2)
115 float TAU_CONE_ENERGY; // radius R of the cone for tau definition, based on energy threshold
116 float TAU_CONE_TRACKS; // radius R of the cone for tau definition, based on track number
117 float PT_TRACK_TAU; // minimal pt [GeV] for tracks to be considered in tau definition
118 float TAU_EM_COLLIMATION; // fraction of energy required in the central part of the cone, for tau jets
119
120 // Tracker acceptance
121 float PT_TRACKS_MIN; // minimal pt needed to reach the calorimeter, in GeV
122 float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV
123 int TRACKING_EFF; // in percent, should be an integer
124
125 //tagging definition
126 int TAGGING_B; //
127 int MISTAGGING_C;
128 int MISTAGGING_L;
129
130 //trigger flag
131 int DOTRIGGER;
132
133 double CONERADIUS;
134 int JETALGO;
135
136 //General jet variable
137 double SEEDTHRESHOLD;
138 double OVERLAPTHRESHOLD;
139
140 // MidPoint algorithm definition
141 double M_CONEAREAFRACTION;
142 int M_MAXPAIRSIZE;
143 int M_MAXITERATIONS;
144
145 // Define Cone algorithm.
146 int C_ADJACENCYCUT;
147 int C_MAXITERATIONS;
148 int C_IRATCH;
149
150 //Define SISCone algorithm.
151 int NPASS;
152 double PROTOJET_PTMIN;
153
154 // Define Calorimetric towers
155 unsigned int NTOWERS;
156 float * TOWER_ETA_EDGES;
157 float * TOWER_DPHI;
158
159 // to sort a vector
160 void SortedVector(vector<ParticleUtil> &vect);
161
162 /// Reads the data card for the initialisation of the parameters
163 void ReadDataCard(const string datacard);
164
165 /// Create the output log file
166 void Logfile(string LogName);
167
168 /// Provides the smeared TLorentzVector for the electrons
169 void SmearElectron(TLorentzVector &electron);
170
171 /// Provides the smeared TLorentzVector for the muons
172 void SmearMu(TLorentzVector &muon);
173
174 /// Provides the smeared TLorentzVector for the hadrons
175 void SmearHadron(TLorentzVector &hadron, const float frac);
176
177 //*****************************fonction pour avoir les taus************************************
178 double EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi);
179
180 //***************** Fonction pour avoir le nombre de traces pour les taus****************************
181 unsigned int NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
182
183 //**********************fonction pour avoir les b-jets******************************
184 int Bjets(const TSimpleArray<TRootGenParticle> &subarray, const float eta, const float phi);
185
186 //******************** retourne l'efficacite de b-tagging ******************************
187 bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootGenParticle> &subarray);
188
189 //******************************isolation criteria**************************************
190 bool Isolation(Float_t phi,Float_t eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
191
192 //********************* returns a segmented value for eta and phi, for calo towers *****
193 void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta);
194
195};
196
197
198// particles PID (PDG ID)
199const int pU = 1; // c quark
200const int pD = 2; // b quark
201const int pS = 3; // s quark
202const int pC = 4; // c quark
203const int pB = 5; // b quark
204const int pE = 11; // e
205const int pNU1 = 12; // nu_e
206const int pMU = 13; // mu
207const int pNU2 = 14; // nu_mu
208const int pTAU = 15; // tau
209const int pNU3 = 16; // nu_tau
210const int pGLUON = 21; // gluon
211const int pGAMMA = 22; // gamma
212const int pW = 24; // W
213const int pP = 2212; // proton
214const int pN = 2112; // neutron
215const int pPI0 = 111; // pi_0
216const int pK0L = 130; // K^0_L
217const int pK0S = 310; // K^0_S
218const int pLAMBDA = 3122; // Lambda
219const int pSIGMA0 = 3212; // Sigma^0
220const int pDELTA0 = 2114; // Delta^0
221
222const double speed_of_light = 299792458; // m/s
223
224#ifndef __PI__
225#define __PI__
226const double PI = acos(-1.0);
227#endif
228
229// ** returns the sign (+1 or -1) or an integer
230int sign(const int myint);
231int sign(const float myfloat);
232
233// **************************** Return the Delta Phi****************************
234float DeltaPhi(const float phi1, const float phi2);
235
236// **************************** Returns the Delta R****************************
237float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2);
238
239//************* Returns an array of the quarks sitting within the tracker acceptance ***************
240int Charge(int pid);
241
242#endif
Note: See TracBrowser for help on using the repository browser.