#ifndef _SMEARUTIL_H_ #define _SMEARUTIL_H_ /* ---- Delphes ---- A Fast Simulator for general purpose LHC detector S. Ovyn ~~~~ severine.ovyn@uclouvain.be Center for Particle Physics and Phenomenology (CP3) Universite Catholique de Louvain (UCL) Louvain-la-Neuve, Belgium */ /// \file SmearUtil.h /// \brief RESOLution class, and some generic definitions #include #include "TLorentzVector.h" #include "BlockClasses.h" #include "TSimpleArray.h" #include "PhysicsTower.hh" using namespace std; class ParticleUtil { public: ParticleUtil(const TLorentzVector &genMomentum, int pid); float E() {return _e;} // particle energy [GeV] float Px() {return _px;} // horizontal coordinate of momentum [GeV] float Py() {return _py;} // vertical coordinate of momentum [GeV] float Pz() {return _pz;} // longitudinal coordinate of momentum [GeV] float Pt() {return _pt;} // transverse momentum [GeV] float EtaCalo() {return _etaCalo;} // pseudorapidity float Eta() {return _eta;} // pseudorapidity float PhiCalo() {return _phiCalo;} // azimuthal angle float Phi() {return _phi;} // azimuthal angle int PID() {return _pid;} // particle energy in [GeV] private: float _e, _px, _py, _pz, _pt; float _eta, _etaCalo, _phi, _phiCalo; int _pid; }; #ifndef __PI__ #define __PI__ extern const float pi = 3.14159265358979312; #endif class RESOLution { public: /// Constructor RESOLution(); RESOLution(const RESOLution & DET); RESOLution& operator=(const RESOLution& DET); ~RESOLution() { delete [] TOWER_eta_edges; delete [] TOWER_dphi;}; // Detector coverage float CEN_max_tracker; // tracker pseudorapidity coverage float CEN_max_calo_cen; // central calorimeter pseudorapidity coverage float CEN_max_calo_fwd; // forward calorimeter pseudorapidity coverage float CEN_max_mu; // muon chambers pseudorapidity coverage float VFD_min_calo_vfd; // very forward calorimeter pseudorapidity coverage float VFD_max_calo_vfd; // very forward calorimeter pseudorapidity coverage float VFD_min_zdc; // coverage for Zero Degree Calorimeter, for photons and neutrons float VFD_s_zdc; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m] float RP_220_s; // distance of the RP to the IP, in meters float RP_220_x; // distance of the RP to the beam, in meters float RP_420_s; // distance of the RP to the IP, in meters float RP_420_x; // distance of the RP to the beam, in meters string RP_beam1Card; // string RP_beam2Card; // float RP_offsetEl_s; float RP_offsetEl_x; //energy resolution for electron/photon // \sigma/E = C + N/E + S/\sqrt{E} float ELG_Scen; // S term for central ECAL float ELG_Ncen; // N term for central ECAL float ELG_Ccen; // C term for central ECAL float ELG_Sfwd; // S term for forward ECAL float ELG_Cfwd; // C term for forward ECAL float ELG_Nfwd; // N term for central ECAL //energy resolution for hadrons in ecal/hcal/hf // \sigma/E = C + N/E + S/\sqrt{E} float HAD_Shcal; // S term for central HCAL // hadronic calorimeter float HAD_Nhcal; // N term for central HCAL float HAD_Chcal; // C term for central HCAL float HAD_Shf; // S term for central HF // forward calorimeter float HAD_Nhf; // N term for central HF float HAD_Chf; // C term for central HF // muon smearing float MU_SmearPt; //Magnetic Field information int TRACK_radius; //radius of the BField coverage int TRACK_length; //length of the BField coverage float TRACK_bfield_x; float TRACK_bfield_y; float TRACK_bfield_z; float TRACK_ptmin; // minimal pt needed to reach the calorimeter, in GeV int TRACK_eff; // in percent, should be an integer //Define Calorimetric towers unsigned int TOWER_number; float * TOWER_eta_edges; float * TOWER_dphi; //thresholds for reconstructed objetcs float PTCUT_elec; float PTCUT_muon; float PTCUT_jet; float PTCUT_gamma; float PTCUT_taujet; //General jet variable double JET_coneradius; int JET_jetalgo; double JET_seed; double JET_overlap; // MidPoint algorithm definition double JET_M_coneareafraction; int JET_M_maxpairsize; int JET_M_maxiterations; // Define Cone algorithm. int JET_C_adjacencycut; int JET_C_maxiterations; int JET_C_iratch; //Define SISCone algorithm. int JET_S_npass; double JET_S_protojet_ptmin; //For Tau-jet definition // R = sqrt (phi^2 + eta^2) float TAU_energy_scone; // radius R of the cone for tau definition, based on energy threshold float TAU_track_scone; // radius R of the cone for tau definition, based on track number float TAU_track_pt; // minimal pt [GeV] for tracks to be considered in tau definition float TAU_energy_frac; // fraction of energy required in the central part of the cone, for tau jets //tagging definition int BTAG_b; int BTAG_mistag_c; int BTAG_mistag_l; //trigger flag int FLAG_trigger; //flag for trigger int FLAG_frog; //flag for frog display int FLAG_bfield; //flag for bfield propagation int FLAG_vfd; //flag for very forward detector int NEvents_Frog; float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV // to sort a vector void SortedVector(vector &vect); /// Reads the data card for the initialisation of the parameters void ReadDataCard(const string datacard); /// Create the output log file void Logfile(const string& LogName); /// Provides the smeared TLorentzVector for the electrons void SmearElectron(TLorentzVector &electron); /// Provides the smeared TLorentzVector for the muons void SmearMu(TLorentzVector &muon); /// Provides the smeared TLorentzVector for the hadrons void SmearHadron(TLorentzVector &hadron, const float frac); /// For electromagnetic collimation in tau jets double EnergySmallCone(const vector &towers, const float eta, const float phi); /// Number of tracks in tau jet algo unsigned int NumTracks(const vector &tracks, const float pt_track, const float eta, const float phi); /// b-jets int Bjets(const TSimpleArray &subarray, const float eta, const float phi); /// b-tag efficiency and misidentification bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray &subarray); /// Lepton isolation bool Isolation(const float phi, const float eta,const vector &tracks,float PT_TRACK2); //********************* returns a segmented value for eta and phi, for calo towers ***** void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta); }; // particles PID (PDG ID) const int pU = 1; // c quark const int pD = 2; // b quark const int pS = 3; // s quark const int pC = 4; // c quark const int pB = 5; // b quark const int pE = 11; // e const int pNU1 = 12; // nu_e const int pMU = 13; // mu const int pNU2 = 14; // nu_mu const int pTAU = 15; // tau const int pNU3 = 16; // nu_tau const int pGLUON = 21; // gluon const int pGAMMA = 22; // gamma const int pW = 24; // W const int pP = 2212; // proton const int pN = 2112; // neutron const int pPI0 = 111; // pi_0 const int pK0L = 130; // K^0_L const int pK0S = 310; // K^0_S const int pLAMBDA = 3122; // Lambda const int pSIGMA0 = 3212; // Sigma^0 const int pDELTA0 = 2114; // Delta^0 const double speed_of_light = 299792458; // m/s const float UNDEFINED=-9999.; // ** returns the sign (+1 or -1) or an integer int sign(const int myint); int sign(const float myfloat); // **************************** Return the Delta Phi**************************** float DeltaPhi(const float phi1, const float phi2); // **************************** Returns the Delta R**************************** float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2); //************* Returns an array of the quarks sitting within the tracker acceptance *************** int Charge(const int pid); #endif