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