#ifndef _SMEARUTIL_H_ #define _SMEARUTIL_H_ /*********************************************************************** ** ** ** /----------------------------------------------\ ** ** | Delphes, a framework for the fast simulation | ** ** | of a generic collider experiment | ** ** \------------- arXiv:0903.2225v1 ------------/ ** ** ** ** ** ** This package uses: ** ** ------------------ ** ** ROOT: Nucl. Inst. & Meth. in Phys. Res. A389 (1997) 81-86 ** ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] ** ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] ** ** FROG: [hep-ex/0901.2718v1] ** ** HepMC: Comput. Phys. Commun.134 (2001) 41 ** ** ** ** ------------------------------------------------------------------ ** ** ** ** Main authors: ** ** ------------- ** ** ** ** Severine Ovyn Xavier Rouby ** ** severine.ovyn@uclouvain.be xavier.rouby@cern ** ** ** ** Center for Particle Physics and Phenomenology (CP3) ** ** Universite catholique de Louvain (UCL) ** ** Louvain-la-Neuve, Belgium ** ** ** ** Copyright (C) 2008-2009, ** ** All rights reserved. ** ** ** ***********************************************************************/ /// \file SmearUtil.h /// \brief RESOLution class, and some generic definitions #include #include #include "TLorentzVector.h" #include "D_Constants.h" #include "CaloUtil.h" #include "BlockClasses.h" #include "TSimpleArray.h" #include "PhysicsTower.hh" #include "PdgParticle.h" using namespace std; // forward declaration instead of 'include' statement class TStopwatch; class D_Particle { public: D_Particle(const TLorentzVector & p, const int pid, const float etacalo, const float phicalo) : _fourmomentum(p), _pid(pid), _etaCalo(etacalo), _phiCalo(phicalo) {} //D_Particle(const float e, const float eta, const float phi, const float pt, const int pid) : // _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) { TLorentzVector p; p.SetPtEtaPhiE(pt,eta,phi,e); _fourmomentum = p; } D_Particle(const float px, const float py, const float pz, const float e, const int pid) : _fourmomentum(px,py,pz,e), _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) {} const float E() const {return _fourmomentum.E();} // particle energy [GeV] const float Px() const {return _fourmomentum.Px();} // horizontal coordinate of momentum [GeV] const float Py() const {return _fourmomentum.Py();} // vertical coordinate of momentum [GeV] const float Pz() const {return _fourmomentum.Pz();} // longitudinal coordinate of momentum [GeV] const float Pt() const {return _fourmomentum.Pt();} // transverse momentum [GeV] const float EtaCalo() const {return _etaCalo;} // pseudorapidity const float Eta() const {return _fourmomentum.Eta();} // pseudorapidity const float PhiCalo() const {return _phiCalo;} // azimuthal angle const float Phi() const {return _fourmomentum.Phi();} // azimuthal angle const int PID() const {return _pid;} // particle energy in [GeV] const TLorentzVector& getFourMomentum() const {return _fourmomentum;} private: TLorentzVector _fourmomentum; int _pid; float _etaCalo, _phiCalo; }; 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; // optics file for beam 1 string RP_beam2Card; // optics file for beam 2 string RP_IP_name; // label for IP in the optics file ("IP1" or "IP5") float RP_offsetEl_s; // distance from IP (in meter) where both beams separate float RP_offsetEl_x; // distance of separation in horizontal plane, in meter float RP_offsetEl_y; // distance of separation in vertical plane, in meter float RP_cross_x; // IP offset in horizontal plane, in micrometer float RP_cross_y; // IP offset in vertical plane, in micrometer float RP_cross_ang_x; // half crossing angle, in microradian, horizontal plane float RP_cross_ang_y; // half crossing angle, in microradian, vertical plane //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 forward ECAL float ELG_Szdc; // S term for zdc-em sections float ELG_Czdc; // C term for zdc-em sections float ELG_Nzdc; // N term for zdc-em sections //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 float HAD_Szdc; // S term for zdc-had sections float HAD_Czdc; // C term for zdc-had sections float HAD_Nzdc; // N term for zdc-had sections // muon smearing float MU_SmearPt; // time resolution float ZDC_T_resolution; float RP220_T_resolution; float RP420_T_resolution; //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; float ZDC_gamma_E; // minimal energy of photons for reconstruction in ZDC float ZDC_n_E; // minimal energy of neutrons for reconstruction in ZDC float ISOL_PT; //minimal pt of tracks for isolation criteria float ISOL_Cone; //Cone for isolation criteria float ISOL_Calo_ET; //minimal tower energy for isolation criteria unsigned int ISOL_Calo_Grid; //Grid size (N x N) for calorimetric isolation //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 FLAG_RP; //flag for very forward detector int FLAG_lhco; //flag for very forward detector int NEvents_Frog; // number of events to be displayed in frog int NEvents; // number of events to be processed float PT_QUARKS_MIN; // minimal pt needed for quarks to reach the tracker, in GeV int JET_Eflow; string PdgTableFilename; PdgTable PDGtable; string inputfilelist, detectorcard, triggercard; // to sort a vector //void SortedVector(vector &vect); void SortedVector(vector &vect); /// Reads the data card for the initialisation of the parameters void ReadDataCard(const string datacard); /// Reads the PDG table void ReadParticleDataGroupTable(); /// 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(float& charge, const vector &tracks, const float pt_track, const float eta, const float phi); unsigned int NumTracks(float& charge, 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 based on tracking bool Isolation(const D_Particle& part, const vector &tracks, const float& pt_second_track, const float& isolCone, float& ptiso); /// Lepton isolation based on calorimetry (optional. Default: off) float CaloIsolation(const D_Particle& part, const D_CaloTowerList & towers, const float iPhi, const float iEta); //********************* returns a segmented value for eta and phi, for calo towers ***** void BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta); void setNames(const string& list, const string& det, const string& trig); }; // ** 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 ChargeVal(const int pid); // ********************* prints the time report on screen and in Logfile ********* 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); void print_header(); string get_time_date(); #endif