[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 |
|
---|
| 21 | #include "Utilities/ExRootAnalysis/interface/BlockClasses.h"
|
---|
| 22 | #include "Utilities/ExRootAnalysis/interface/TSimpleArray.h"
|
---|
| 23 |
|
---|
[11] | 24 | #include "Utilities/Fastjet/plugins/CDFCones/interface/PhysicsTower.hh"
|
---|
[73] | 25 |
|
---|
| 26 | #include <iostream>
|
---|
| 27 | #include <sstream>
|
---|
| 28 | #include <fstream>
|
---|
| 29 | #include <iomanip>
|
---|
| 30 |
|
---|
[2] | 31 | using namespace std;
|
---|
| 32 |
|
---|
[73] | 33 | class ParticleUtil {
|
---|
| 34 |
|
---|
| 35 | public:
|
---|
| 36 |
|
---|
| 37 | TLorentzVector TLVector;
|
---|
| 38 | int Pid;
|
---|
| 39 |
|
---|
| 40 | ParticleUtil(const TLorentzVector &genMomentum,const int &pid) : TLVector(genMomentum) , Pid(pid) {}
|
---|
| 41 |
|
---|
| 42 | float E() {return TLVector.E();} // particle energy in GeV
|
---|
| 43 | float Px() {return TLVector.Px();} // particle energy in GeV
|
---|
| 44 | float Py() {return TLVector.Py();} // particle energy in GeV
|
---|
| 45 | float Pz() {return TLVector.Pz();} // particle energy in GeV
|
---|
| 46 | float Pt() {return TLVector.Pt();} // particle energy in GeV
|
---|
| 47 | float Eta() {return TLVector.Eta();} // particle energy in GeV
|
---|
| 48 | float Phi() {return TLVector.Phi();} // particle energy in GeV
|
---|
| 49 | float PID() {return Pid;} // particle energy in GeV
|
---|
| 50 |
|
---|
| 51 | private:
|
---|
| 52 |
|
---|
| 53 | };
|
---|
| 54 |
|
---|
| 55 |
|
---|
[2] | 56 | class RESOLution
|
---|
| 57 | {
|
---|
| 58 | public:
|
---|
| 59 | /// Constructor
|
---|
| 60 | RESOLution();
|
---|
| 61 |
|
---|
| 62 | // Detector coverage
|
---|
| 63 | float MAX_TRACKER; // tracker pseudorapidity coverage
|
---|
| 64 | float MAX_CALO_CEN; // central calorimeter pseudorapidity coverage
|
---|
| 65 | float MAX_CALO_FWD; // forward calorimeter pseudorapidity coverage
|
---|
| 66 | float MAX_MU; // muon chambers pseudorapidity coverage
|
---|
| 67 | float MIN_CALO_VFWD; // very forward calorimeter pseudorapidity coverage
|
---|
| 68 | float MAX_CALO_VFWD; // very forward calorimeter pseudorapidity coverage
|
---|
| 69 | float MIN_ZDC; // coverage for Zero Degree Calorimeter, for photons and neutrons
|
---|
| 70 |
|
---|
| 71 | float ZDC_S; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
|
---|
| 72 | float RP220_S; // distance of the RP to the IP, in meters
|
---|
| 73 | float RP220_X; // distance of the RP to the beam, in meters
|
---|
| 74 | float FP420_S; // distance of the RP to the IP, in meters
|
---|
| 75 | float FP420_X; // distance of the RP to the beam, in meters
|
---|
| 76 |
|
---|
[62] | 77 | //Magnetic Field information
|
---|
| 78 | int TRACKING_RADIUS; //radius of the BField coverage
|
---|
| 79 | int TRACKING_LENGTH; //length of the BField coverage
|
---|
| 80 | float BFIELD_X;
|
---|
| 81 | float BFIELD_Y;
|
---|
| 82 | float BFIELD_Z;
|
---|
| 83 |
|
---|
[2] | 84 |
|
---|
| 85 | //energy resolution for electron/photon
|
---|
| 86 | // \sigma/E = C + N/E + S/\sqrt{E}
|
---|
| 87 | float ELG_Scen; // S term for central ECAL
|
---|
| 88 | float ELG_Ncen; // N term for central ECAL
|
---|
| 89 | float ELG_Ccen; // C term for central ECAL
|
---|
| 90 | float ELG_Sfwd; // S term for forward ECAL
|
---|
| 91 | float ELG_Cfwd; // C term for forward ECAL
|
---|
| 92 | float ELG_Nfwd; // N term for central ECAL
|
---|
| 93 |
|
---|
| 94 | //energy resolution for hadrons in ecal/hcal/hf
|
---|
| 95 | // \sigma/E = C + N/E + S/\sqrt{E}
|
---|
| 96 | float HAD_Shcal; // S term for central HCAL // hadronic calorimeter
|
---|
| 97 | float HAD_Nhcal; // N term for central HCAL
|
---|
| 98 | float HAD_Chcal; // C term for central HCAL
|
---|
| 99 | float HAD_Shf; // S term for central HF // forward calorimeter
|
---|
| 100 | float HAD_Nhf; // N term for central HF
|
---|
| 101 | float HAD_Chf; // C term for central HF
|
---|
| 102 |
|
---|
| 103 | // muon smearing
|
---|
| 104 | float MU_SmearPt;
|
---|
[33] | 105 |
|
---|
| 106 | //threshold for reconstructed objetcs
|
---|
| 107 | float ELEC_pt;
|
---|
| 108 | float MUON_pt;
|
---|
| 109 | float JET_pt;
|
---|
| 110 | float TAUJET_pt;
|
---|
| 111 |
|
---|
[2] | 112 | //For Tau-jet definition
|
---|
| 113 | // R = sqrt (phi^2 + eta^2)
|
---|
| 114 | float TAU_CONE_ENERGY; // radius R of the cone for tau definition, based on energy threshold
|
---|
| 115 | float TAU_CONE_TRACKS; // radius R of the cone for tau definition, based on track number
|
---|
| 116 | float PT_TRACK_TAU; // minimal pt [GeV] for tracks to be considered in tau definition
|
---|
| 117 | float TAU_EM_COLLIMATION; // fraction of energy required in the central part of the cone, for tau jets
|
---|
| 118 |
|
---|
| 119 | // Tracker acceptance
|
---|
| 120 | float PT_TRACKS_MIN; // minimal pt needed to reach the calorimeter, in GeV
|
---|
| 121 | float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV
|
---|
| 122 | int TRACKING_EFF; // in percent, should be an integer
|
---|
| 123 |
|
---|
| 124 | //tagging definition
|
---|
| 125 | int TAGGING_B; //
|
---|
| 126 | int MISTAGGING_C;
|
---|
| 127 | int MISTAGGING_L;
|
---|
| 128 |
|
---|
[72] | 129 | //trigger flag
|
---|
| 130 | int DOTRIGGER;
|
---|
| 131 |
|
---|
[2] | 132 | double CONERADIUS;
|
---|
| 133 | int JETALGO;
|
---|
[43] | 134 |
|
---|
| 135 | //General jet variable
|
---|
| 136 | double SEEDTHRESHOLD;
|
---|
| 137 | double OVERLAPTHRESHOLD;
|
---|
| 138 |
|
---|
[2] | 139 | // MidPoint algorithm definition
|
---|
| 140 | double M_CONEAREAFRACTION;
|
---|
| 141 | int M_MAXPAIRSIZE;
|
---|
| 142 | int M_MAXITERATIONS;
|
---|
| 143 |
|
---|
| 144 | // Define Cone algorithm.
|
---|
| 145 | int C_ADJACENCYCUT;
|
---|
| 146 | int C_MAXITERATIONS;
|
---|
| 147 | int C_IRATCH;
|
---|
| 148 |
|
---|
[44] | 149 | //Define SISCone algorithm.
|
---|
| 150 | int NPASS;
|
---|
| 151 | double PROTOJET_PTMIN;
|
---|
| 152 |
|
---|
[71] | 153 | // Define Calorimetric towers
|
---|
| 154 | unsigned int NTOWERS;
|
---|
| 155 | float * TOWER_ETA_EDGES;
|
---|
| 156 | float * TOWER_DPHI;
|
---|
[44] | 157 |
|
---|
[71] | 158 |
|
---|
[2] | 159 | /// Reads the data card for the initialisation of the parameters
|
---|
| 160 | void ReadDataCard(const string datacard);
|
---|
[44] | 161 |
|
---|
| 162 | /// Create the output log file
|
---|
| 163 | void Logfile(string LogName);
|
---|
[2] | 164 |
|
---|
| 165 | /// Provides the smeared TLorentzVector for the electrons
|
---|
| 166 | void SmearElectron(TLorentzVector &electron);
|
---|
| 167 |
|
---|
| 168 | /// Provides the smeared TLorentzVector for the muons
|
---|
| 169 | void SmearMu(TLorentzVector &muon);
|
---|
| 170 |
|
---|
| 171 | /// Provides the smeared TLorentzVector for the hadrons
|
---|
| 172 | void SmearHadron(TLorentzVector &hadron, const float frac);
|
---|
| 173 |
|
---|
| 174 | //*****************************fonction pour avoir les taus************************************
|
---|
| 175 | double EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi);
|
---|
| 176 |
|
---|
| 177 | //***************** Fonction pour avoir le nombre de traces pour les taus****************************
|
---|
| 178 | unsigned int NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
|
---|
| 179 |
|
---|
| 180 | //**********************fonction pour avoir les b-jets******************************
|
---|
| 181 | int Bjets(const TSimpleArray<TRootGenParticle> &subarray, const float eta, const float phi);
|
---|
| 182 |
|
---|
| 183 | //******************** retourne l'efficacite de b-tagging ******************************
|
---|
| 184 | bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootGenParticle> &subarray);
|
---|
| 185 |
|
---|
[31] | 186 | //******************************isolation criteria**************************************
|
---|
| 187 | bool Isolation(Float_t phi,Float_t eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
|
---|
| 188 |
|
---|
[71] | 189 | //********************* returns a segmented value for eta and phi, for calo towers *****
|
---|
| 190 | void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta);
|
---|
| 191 |
|
---|
[2] | 192 | };
|
---|
| 193 |
|
---|
| 194 |
|
---|
| 195 | // particles PID (PDG ID)
|
---|
| 196 | const int pU = 1; // c quark
|
---|
| 197 | const int pD = 2; // b quark
|
---|
| 198 | const int pS = 3; // s quark
|
---|
| 199 | const int pC = 4; // c quark
|
---|
| 200 | const int pB = 5; // b quark
|
---|
| 201 | const int pE = 11; // e
|
---|
| 202 | const int pNU1 = 12; // nu_e
|
---|
| 203 | const int pMU = 13; // mu
|
---|
| 204 | const int pNU2 = 14; // nu_mu
|
---|
| 205 | const int pTAU = 15; // tau
|
---|
| 206 | const int pNU3 = 16; // nu_tau
|
---|
| 207 | const int pGLUON = 21; // gluon
|
---|
| 208 | const int pGAMMA = 22; // gamma
|
---|
| 209 | const int pW = 24; // W
|
---|
| 210 | const int pP = 2212; // proton
|
---|
| 211 | const int pN = 2112; // neutron
|
---|
| 212 | const int pPI0 = 111; // pi_0
|
---|
| 213 | const int pK0L = 130; // K^0_L
|
---|
| 214 | const int pK0S = 310; // K^0_S
|
---|
| 215 | const int pLAMBDA = 3122; // Lambda
|
---|
| 216 | const int pSIGMA0 = 3212; // Sigma^0
|
---|
| 217 | const int pDELTA0 = 2114; // Delta^0
|
---|
| 218 |
|
---|
| 219 | const double speed_of_light = 299792458; // m/s
|
---|
| 220 |
|
---|
| 221 | #ifndef __PI__
|
---|
| 222 | #define __PI__
|
---|
| 223 | const double PI = acos(-1.0);
|
---|
| 224 | #endif
|
---|
| 225 |
|
---|
| 226 | // ** returns the sign (+1 or -1) or an integer
|
---|
| 227 | int sign(const int myint);
|
---|
| 228 | int sign(const float myfloat);
|
---|
| 229 |
|
---|
| 230 | // **************************** Return the Delta Phi****************************
|
---|
| 231 | float DeltaPhi(const float phi1, const float phi2);
|
---|
| 232 |
|
---|
| 233 | // **************************** Returns the Delta R****************************
|
---|
| 234 | float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2);
|
---|
| 235 |
|
---|
| 236 | //************* Returns an array of the quarks sitting within the tracker acceptance ***************
|
---|
[55] | 237 | int Charge(int pid);
|
---|
[2] | 238 |
|
---|
| 239 | #endif
|
---|