Fork me on GitHub

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

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

new flag JET_Eflow

File size: 11.5 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 | **
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***********************************************************************/
[2]34
35/// \file SmearUtil.h
36/// \brief RESOLution class, and some generic definitions
37
38
39#include <vector>
40#include "TLorentzVector.h"
41
[264]42#include "D_Constants.h"
43#include "CaloUtil.h"
[223]44#include "BlockClasses.h"
45#include "TSimpleArray.h"
46#include "PhysicsTower.hh"
[380]47#include "PdgParticle.h"
[2]48
49using namespace std;
50
[264]51class D_Particle {
[73]52
53 public:
[264]54 D_Particle(const TLorentzVector & p, const int pid, const float etacalo, const float phicalo) :
55 _fourmomentum(p), _pid(pid), _etaCalo(etacalo), _phiCalo(phicalo) {}
56 //D_Particle(const float e, const float eta, const float phi, const float pt, const int pid) :
57 // _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) { TLorentzVector p; p.SetPtEtaPhiE(pt,eta,phi,e); _fourmomentum = p; }
58 D_Particle(const float px, const float py, const float pz, const float e, const int pid) :
59 _fourmomentum(px,py,pz,e), _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) {}
[73]60
[264]61 const float E() const {return _fourmomentum.E();} // particle energy [GeV]
62 const float Px() const {return _fourmomentum.Px();} // horizontal coordinate of momentum [GeV]
63 const float Py() const {return _fourmomentum.Py();} // vertical coordinate of momentum [GeV]
64 const float Pz() const {return _fourmomentum.Pz();} // longitudinal coordinate of momentum [GeV]
65 const float Pt() const {return _fourmomentum.Pt();} // transverse momentum [GeV]
66 const float EtaCalo() const {return _etaCalo;} // pseudorapidity
67 const float Eta() const {return _fourmomentum.Eta();} // pseudorapidity
68 const float PhiCalo() const {return _phiCalo;} // azimuthal angle
69 const float Phi() const {return _fourmomentum.Phi();} // azimuthal angle
70 const int PID() const {return _pid;} // particle energy in [GeV]
71 const TLorentzVector& getFourMomentum() const {return _fourmomentum;}
[73]72
73 private:
[264]74 TLorentzVector _fourmomentum;
[223]75 int _pid;
[264]76 float _etaCalo, _phiCalo;
[73]77};
78
[2]79class RESOLution
80{
81 public:
82 /// Constructor
83 RESOLution();
[223]84 RESOLution(const RESOLution & DET);
85 RESOLution& operator=(const RESOLution& DET);
86 ~RESOLution() { delete [] TOWER_eta_edges; delete [] TOWER_dphi;};
87
[2]88 // Detector coverage
[94]89 float CEN_max_tracker; // tracker pseudorapidity coverage
90 float CEN_max_calo_cen; // central calorimeter pseudorapidity coverage
91 float CEN_max_calo_fwd; // forward calorimeter pseudorapidity coverage
92 float CEN_max_mu; // muon chambers pseudorapidity coverage
[2]93
[94]94 float VFD_min_calo_vfd; // very forward calorimeter pseudorapidity coverage
95 float VFD_max_calo_vfd; // very forward calorimeter pseudorapidity coverage
96 float VFD_min_zdc; // coverage for Zero Degree Calorimeter, for photons and neutrons
97 float VFD_s_zdc; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
[2]98
[264]99 float RP_220_s; // distance of the RP to the IP, in meters
100 float RP_220_x; // distance of the RP to the beam, in meters
101 float RP_420_s; // distance of the RP to the IP, in meters
102 float RP_420_x; // distance of the RP to the beam, in meters
[252]103 string RP_beam1Card; //
104 string RP_beam2Card; //
[257]105 string RP_IP_name; //
[252]106 float RP_offsetEl_s;
107 float RP_offsetEl_x;
[254]108 float RP_cross_x;
109 float RP_cross_y;
110 float RP_cross_ang;
[62]111
[94]112
[2]113 //energy resolution for electron/photon
114 // \sigma/E = C + N/E + S/\sqrt{E}
115 float ELG_Scen; // S term for central ECAL
116 float ELG_Ncen; // N term for central ECAL
117 float ELG_Ccen; // C term for central ECAL
118 float ELG_Sfwd; // S term for forward ECAL
119 float ELG_Cfwd; // C term for forward ECAL
[374]120 float ELG_Nfwd; // N term for forward ECAL
121 float ELG_Szdc; // S term for zdc-em sections
122 float ELG_Czdc; // C term for zdc-em sections
123 float ELG_Nzdc; // N term for zdc-em sections
[2]124
125 //energy resolution for hadrons in ecal/hcal/hf
126 // \sigma/E = C + N/E + S/\sqrt{E}
127 float HAD_Shcal; // S term for central HCAL // hadronic calorimeter
128 float HAD_Nhcal; // N term for central HCAL
129 float HAD_Chcal; // C term for central HCAL
130 float HAD_Shf; // S term for central HF // forward calorimeter
131 float HAD_Nhf; // N term for central HF
132 float HAD_Chf; // C term for central HF
[374]133 float HAD_Szdc; // S term for zdc-had sections
134 float HAD_Czdc; // C term for zdc-had sections
135 float HAD_Nzdc; // N term for zdc-had sections
136
[2]137 // muon smearing
138 float MU_SmearPt;
[374]139
140 // time resolution
141 float ZDC_T_resolution;
142 float RP220_T_resolution;
143 float RP420_T_resolution;
[2]144
[94]145 //Magnetic Field information
146 int TRACK_radius; //radius of the BField coverage
147 int TRACK_length; //length of the BField coverage
148 float TRACK_bfield_x;
149 float TRACK_bfield_y;
150 float TRACK_bfield_z;
151 float TRACK_ptmin; // minimal pt needed to reach the calorimeter, in GeV
152 int TRACK_eff; // in percent, should be an integer
[2]153
[72]154
[94]155 //Define Calorimetric towers
156 unsigned int TOWER_number;
157 float * TOWER_eta_edges;
158 float * TOWER_dphi;
[43]159
[94]160 //thresholds for reconstructed objetcs
161 float PTCUT_elec;
162 float PTCUT_muon;
163 float PTCUT_jet;
164 float PTCUT_gamma;
165 float PTCUT_taujet;
[305]166
[374]167 float ZDC_gamma_E; // minimal energy of photons for reconstruction in ZDC
168 float ZDC_n_E; // minimal energy of neutrons for reconstruction in ZDC
169
[305]170 float ISOL_PT; //minimal pt of tracks for isolation criteria
171 float ISOL_Cone; //Cone for isolation criteria
[321]172 float ISOL_Calo_ET; //minimal tower energy for isolation criteria
173 unsigned int ISOL_Calo_Grid; //Grid size (N x N) for calorimetric isolation
[374]174
[94]175
[43]176 //General jet variable
[94]177 double JET_coneradius;
178 int JET_jetalgo;
179 double JET_seed;
180 double JET_overlap;
181
[2]182 // MidPoint algorithm definition
[94]183 double JET_M_coneareafraction;
184 int JET_M_maxpairsize;
185 int JET_M_maxiterations;
[2]186 // Define Cone algorithm.
[94]187 int JET_C_adjacencycut;
188 int JET_C_maxiterations;
189 int JET_C_iratch;
[44]190 //Define SISCone algorithm.
[94]191 int JET_S_npass;
192 double JET_S_protojet_ptmin;
193
194 //For Tau-jet definition
195 // R = sqrt (phi^2 + eta^2)
196 float TAU_energy_scone; // radius R of the cone for tau definition, based on energy threshold
197 float TAU_track_scone; // radius R of the cone for tau definition, based on track number
198 float TAU_track_pt; // minimal pt [GeV] for tracks to be considered in tau definition
199 float TAU_energy_frac; // fraction of energy required in the central part of the cone, for tau jets
200
201 //tagging definition
202 int BTAG_b;
203 int BTAG_mistag_c;
204 int BTAG_mistag_l;
205
[44]206
[94]207 //trigger flag
208 int FLAG_trigger; //flag for trigger
209 int FLAG_frog; //flag for frog display
210 int FLAG_bfield; //flag for bfield propagation
211 int FLAG_vfd; //flag for very forward detector
[306]212 int FLAG_RP; //flag for very forward detector
[307]213 int FLAG_lhco; //flag for very forward detector
[94]214
215 int NEvents_Frog;
[380]216 float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV
[383]217 int JET_Eflow;
[94]218
[380]219 string PdgTableFilename;
220 //map<int,PdgParticle> PdgTable;
221 PdgTable PDGtable;
222
[74]223 // to sort a vector
[264]224 //void SortedVector(vector<ParticleUtil> &vect);
225 void SortedVector(vector<D_Particle> &vect);
[71]226
[2]227 /// Reads the data card for the initialisation of the parameters
228 void ReadDataCard(const string datacard);
[380]229
230 /// Reads the PDG table
231 void ReadParticleDataGroupTable();
[44]232
233 /// Create the output log file
[223]234 void Logfile(const string& LogName);
[2]235
236 /// Provides the smeared TLorentzVector for the electrons
237 void SmearElectron(TLorentzVector &electron);
238
239 /// Provides the smeared TLorentzVector for the muons
240 void SmearMu(TLorentzVector &muon);
241
242 /// Provides the smeared TLorentzVector for the hadrons
243 void SmearHadron(TLorentzVector &hadron, const float frac);
244
[223]245 /// For electromagnetic collimation in tau jets
[2]246 double EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi);
247
[223]248 /// Number of tracks in tau jet algo
[287]249 //unsigned int NumTracks(float& charge, const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
250 unsigned int NumTracks(float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi);
[2]251
[223]252 /// b-jets
[350]253 int Bjets(const TSimpleArray<TRootC::GenParticle> &subarray, const float& eta, const float& phi);
[2]254
[223]255 /// b-tag efficiency and misidentification
[350]256 bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootC::GenParticle> &subarray);
[2]257
[321]258 /// Lepton isolation based on tracking
259 bool Isolation(const D_Particle& part, const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone, float& ptiso);
[31]260
[321]261 /// Lepton isolation based on calorimetry (optional. Default: off)
262 float CaloIsolation(const D_Particle& part, const D_CaloTowerList & towers);
263
[71]264 //********************* returns a segmented value for eta and phi, for calo towers *****
265 void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta);
266
[2]267};
268
269// ** returns the sign (+1 or -1) or an integer
270int sign(const int myint);
271int sign(const float myfloat);
272
273// **************************** Return the Delta Phi****************************
274float DeltaPhi(const float phi1, const float phi2);
275
276// **************************** Returns the Delta R****************************
277float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2);
278
279//************* Returns an array of the quarks sitting within the tracker acceptance ***************
[270]280int ChargeVal(const int pid);
[2]281
282#endif
Note: See TracBrowser for help on using the repository browser.