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