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