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