Fork me on GitHub

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

Last change on this file since 183 was 177, checked in by Xavier Rouby, 16 years ago

nettoyage

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