Fork me on GitHub

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

Last change on this file since 446 was 443, checked in by Xavier Rouby, 15 years ago

new header in all files

File size: 12.7 KB
RevLine 
[2]1#ifndef _SMEARUTIL_H_
2#define _SMEARUTIL_H_
3
[260]4/***********************************************************************
5** **
6** /----------------------------------------------\ **
7** | Delphes, a framework for the fast simulation | **
8** | of a generic collider experiment | **
[443]9** \------------- arXiv:0903.2225v1 ------------/ **
[260]10** **
11** **
12** This package uses: **
13** ------------------ **
[443]14** ROOT: Nucl. Inst. & Meth. in Phys. Res. A389 (1997) 81-86 **
15** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
16** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
[260]17** FROG: [hep-ex/0901.2718v1] **
[443]18** HepMC: Comput. Phys. Commun.134 (2001) 41 **
[260]19** **
20** ------------------------------------------------------------------ **
21** **
22** Main authors: **
23** ------------- **
24** **
[443]25** Severine Ovyn Xavier Rouby **
26** severine.ovyn@uclouvain.be xavier.rouby@cern **
[260]27** **
[443]28** Center for Particle Physics and Phenomenology (CP3) **
29** Universite catholique de Louvain (UCL) **
30** Louvain-la-Neuve, Belgium **
31** **
[260]32** Copyright (C) 2008-2009, **
[443]33** All rights reserved. **
[260]34** **
35***********************************************************************/
[2]36
37/// \file SmearUtil.h
38/// \brief RESOLution class, and some generic definitions
39
40
41#include <vector>
42#include "TLorentzVector.h"
43
[264]44#include "D_Constants.h"
45#include "CaloUtil.h"
[223]46#include "BlockClasses.h"
47#include "TSimpleArray.h"
48#include "PhysicsTower.hh"
[380]49#include "PdgParticle.h"
[2]50
51using namespace std;
52
[398]53// forward declaration instead of 'include' statement
54class TStopwatch;
55
[264]56class D_Particle {
[73]57
58 public:
[264]59 D_Particle(const TLorentzVector & p, const int pid, const float etacalo, const float phicalo) :
60 _fourmomentum(p), _pid(pid), _etaCalo(etacalo), _phiCalo(phicalo) {}
61 //D_Particle(const float e, const float eta, const float phi, const float pt, const int pid) :
62 // _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) { TLorentzVector p; p.SetPtEtaPhiE(pt,eta,phi,e); _fourmomentum = p; }
63 D_Particle(const float px, const float py, const float pz, const float e, const int pid) :
64 _fourmomentum(px,py,pz,e), _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) {}
[73]65
[264]66 const float E() const {return _fourmomentum.E();} // particle energy [GeV]
67 const float Px() const {return _fourmomentum.Px();} // horizontal coordinate of momentum [GeV]
68 const float Py() const {return _fourmomentum.Py();} // vertical coordinate of momentum [GeV]
69 const float Pz() const {return _fourmomentum.Pz();} // longitudinal coordinate of momentum [GeV]
70 const float Pt() const {return _fourmomentum.Pt();} // transverse momentum [GeV]
71 const float EtaCalo() const {return _etaCalo;} // pseudorapidity
72 const float Eta() const {return _fourmomentum.Eta();} // pseudorapidity
73 const float PhiCalo() const {return _phiCalo;} // azimuthal angle
74 const float Phi() const {return _fourmomentum.Phi();} // azimuthal angle
75 const int PID() const {return _pid;} // particle energy in [GeV]
76 const TLorentzVector& getFourMomentum() const {return _fourmomentum;}
[73]77
78 private:
[264]79 TLorentzVector _fourmomentum;
[223]80 int _pid;
[264]81 float _etaCalo, _phiCalo;
[73]82};
83
[2]84class RESOLution
85{
86 public:
87 /// Constructor
88 RESOLution();
[223]89 RESOLution(const RESOLution & DET);
90 RESOLution& operator=(const RESOLution& DET);
91 ~RESOLution() { delete [] TOWER_eta_edges; delete [] TOWER_dphi;};
92
[2]93 // Detector coverage
[94]94 float CEN_max_tracker; // tracker pseudorapidity coverage
95 float CEN_max_calo_cen; // central calorimeter pseudorapidity coverage
96 float CEN_max_calo_fwd; // forward calorimeter pseudorapidity coverage
97 float CEN_max_mu; // muon chambers pseudorapidity coverage
[2]98
[94]99 float VFD_min_calo_vfd; // very forward calorimeter pseudorapidity coverage
100 float VFD_max_calo_vfd; // very forward calorimeter pseudorapidity coverage
101 float VFD_min_zdc; // coverage for Zero Degree Calorimeter, for photons and neutrons
102 float VFD_s_zdc; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
[2]103
[264]104 float RP_220_s; // distance of the RP to the IP, in meters
105 float RP_220_x; // distance of the RP to the beam, in meters
106 float RP_420_s; // distance of the RP to the IP, in meters
107 float RP_420_x; // distance of the RP to the beam, in meters
[398]108 string RP_beam1Card; // optics file for beam 1
109 string RP_beam2Card; // optics file for beam 2
110 string RP_IP_name; // label for IP in the optics file ("IP1" or "IP5")
111 float RP_offsetEl_s; // distance from IP (in meter) where both beams separate
[403]112 float RP_offsetEl_x; // distance of separation in horizontal plane, in meter
113 float RP_offsetEl_y; // distance of separation in vertical plane, in meter
[398]114 float RP_cross_x; // IP offset in horizontal plane, in micrometer
115 float RP_cross_y; // IP offset in vertical plane, in micrometer
116 float RP_cross_ang_x; // half crossing angle, in microradian, horizontal plane
117 float RP_cross_ang_y; // half crossing angle, in microradian, vertical plane
[62]118
[94]119
[2]120 //energy resolution for electron/photon
121 // \sigma/E = C + N/E + S/\sqrt{E}
122 float ELG_Scen; // S term for central ECAL
123 float ELG_Ncen; // N term for central ECAL
124 float ELG_Ccen; // C term for central ECAL
125 float ELG_Sfwd; // S term for forward ECAL
126 float ELG_Cfwd; // C term for forward ECAL
[374]127 float ELG_Nfwd; // N term for forward ECAL
128 float ELG_Szdc; // S term for zdc-em sections
129 float ELG_Czdc; // C term for zdc-em sections
130 float ELG_Nzdc; // N term for zdc-em sections
[2]131
132 //energy resolution for hadrons in ecal/hcal/hf
133 // \sigma/E = C + N/E + S/\sqrt{E}
134 float HAD_Shcal; // S term for central HCAL // hadronic calorimeter
135 float HAD_Nhcal; // N term for central HCAL
136 float HAD_Chcal; // C term for central HCAL
137 float HAD_Shf; // S term for central HF // forward calorimeter
138 float HAD_Nhf; // N term for central HF
139 float HAD_Chf; // C term for central HF
[374]140 float HAD_Szdc; // S term for zdc-had sections
141 float HAD_Czdc; // C term for zdc-had sections
142 float HAD_Nzdc; // N term for zdc-had sections
143
[2]144 // muon smearing
145 float MU_SmearPt;
[374]146
147 // time resolution
148 float ZDC_T_resolution;
149 float RP220_T_resolution;
150 float RP420_T_resolution;
[2]151
[94]152 //Magnetic Field information
153 int TRACK_radius; //radius of the BField coverage
154 int TRACK_length; //length of the BField coverage
155 float TRACK_bfield_x;
156 float TRACK_bfield_y;
157 float TRACK_bfield_z;
158 float TRACK_ptmin; // minimal pt needed to reach the calorimeter, in GeV
159 int TRACK_eff; // in percent, should be an integer
[2]160
[72]161
[94]162 //Define Calorimetric towers
163 unsigned int TOWER_number;
164 float * TOWER_eta_edges;
165 float * TOWER_dphi;
[43]166
[94]167 //thresholds for reconstructed objetcs
168 float PTCUT_elec;
169 float PTCUT_muon;
170 float PTCUT_jet;
171 float PTCUT_gamma;
172 float PTCUT_taujet;
[305]173
[374]174 float ZDC_gamma_E; // minimal energy of photons for reconstruction in ZDC
175 float ZDC_n_E; // minimal energy of neutrons for reconstruction in ZDC
176
[305]177 float ISOL_PT; //minimal pt of tracks for isolation criteria
178 float ISOL_Cone; //Cone for isolation criteria
[321]179 float ISOL_Calo_ET; //minimal tower energy for isolation criteria
180 unsigned int ISOL_Calo_Grid; //Grid size (N x N) for calorimetric isolation
[374]181
[94]182
[43]183 //General jet variable
[94]184 double JET_coneradius;
185 int JET_jetalgo;
186 double JET_seed;
187 double JET_overlap;
188
[2]189 // MidPoint algorithm definition
[94]190 double JET_M_coneareafraction;
191 int JET_M_maxpairsize;
192 int JET_M_maxiterations;
[2]193 // Define Cone algorithm.
[94]194 int JET_C_adjacencycut;
195 int JET_C_maxiterations;
196 int JET_C_iratch;
[44]197 //Define SISCone algorithm.
[94]198 int JET_S_npass;
199 double JET_S_protojet_ptmin;
200
201 //For Tau-jet definition
202 // R = sqrt (phi^2 + eta^2)
203 float TAU_energy_scone; // radius R of the cone for tau definition, based on energy threshold
204 float TAU_track_scone; // radius R of the cone for tau definition, based on track number
205 float TAU_track_pt; // minimal pt [GeV] for tracks to be considered in tau definition
206 float TAU_energy_frac; // fraction of energy required in the central part of the cone, for tau jets
207
208 //tagging definition
209 int BTAG_b;
210 int BTAG_mistag_c;
211 int BTAG_mistag_l;
212
[44]213
[94]214 //trigger flag
215 int FLAG_trigger; //flag for trigger
216 int FLAG_frog; //flag for frog display
217 int FLAG_bfield; //flag for bfield propagation
218 int FLAG_vfd; //flag for very forward detector
[306]219 int FLAG_RP; //flag for very forward detector
[307]220 int FLAG_lhco; //flag for very forward detector
[94]221
[421]222 int NEvents_Frog; // number of events to be displayed in frog
223 int NEvents; // number of events to be processed
[380]224 float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV
[383]225 int JET_Eflow;
[94]226
[380]227 string PdgTableFilename;
228 //map<int,PdgParticle> PdgTable;
229 PdgTable PDGtable;
230
[74]231 // to sort a vector
[264]232 //void SortedVector(vector<ParticleUtil> &vect);
233 void SortedVector(vector<D_Particle> &vect);
[71]234
[2]235 /// Reads the data card for the initialisation of the parameters
236 void ReadDataCard(const string datacard);
[380]237
238 /// Reads the PDG table
239 void ReadParticleDataGroupTable();
[44]240
241 /// Create the output log file
[223]242 void Logfile(const string& LogName);
[2]243
244 /// Provides the smeared TLorentzVector for the electrons
245 void SmearElectron(TLorentzVector &electron);
246
247 /// Provides the smeared TLorentzVector for the muons
248 void SmearMu(TLorentzVector &muon);
249
250 /// Provides the smeared TLorentzVector for the hadrons
251 void SmearHadron(TLorentzVector &hadron, const float frac);
252
[223]253 /// For electromagnetic collimation in tau jets
[2]254 double EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi);
255
[223]256 /// Number of tracks in tau jet algo
[287]257 //unsigned int NumTracks(float& charge, const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
258 unsigned int NumTracks(float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi);
[2]259
[223]260 /// b-jets
[350]261 int Bjets(const TSimpleArray<TRootC::GenParticle> &subarray, const float& eta, const float& phi);
[2]262
[223]263 /// b-tag efficiency and misidentification
[350]264 bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootC::GenParticle> &subarray);
[2]265
[321]266 /// Lepton isolation based on tracking
267 bool Isolation(const D_Particle& part, const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone, float& ptiso);
[31]268
[321]269 /// Lepton isolation based on calorimetry (optional. Default: off)
[392]270 float CaloIsolation(const D_Particle& part, const D_CaloTowerList & towers, const float iPhi, const float iEta);
[321]271
[71]272 //********************* returns a segmented value for eta and phi, for calo towers *****
273 void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta);
274
[2]275};
276
277// ** returns the sign (+1 or -1) or an integer
278int sign(const int myint);
279int sign(const float myfloat);
280
281// **************************** Return the Delta Phi****************************
282float DeltaPhi(const float phi1, const float phi2);
283
284// **************************** Returns the Delta R****************************
285float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2);
286
287//************* Returns an array of the quarks sitting within the tracker acceptance ***************
[270]288int ChargeVal(const int pid);
[2]289
[398]290// ********************* prints the time report on screen and in Logfile *********
291void time_report(const TStopwatch& global,const TStopwatch& loop,const TStopwatch& trigger,const TStopwatch& frog,const TStopwatch& lhco, const int flag_frog, const int flag_trigger, const int flag_lhco, const string& LogName, const Long64_t allEntries);
[403]292
293void print_header();
[2]294#endif
Note: See TracBrowser for help on using the repository browser.