00001 #ifndef HZZ2L2NU_INCLUDE_PHYSICSOBJECTS_H_ 00002 #define HZZ2L2NU_INCLUDE_PHYSICSOBJECTS_H_ 00003 00004 #include <cmath> 00005 #include <cstdlib> 00006 #include <limits> 00007 00008 #include <TLorentzVector.h> 00009 00010 00012 struct Particle { 00013 00015 TLorentzVector p4; 00016 }; 00017 00018 00026 inline bool PtOrdered(Particle const &p1, Particle const &p2) { 00027 return (p1.p4.Pt() > p2.p4.Pt()); 00028 } 00029 00030 00032 struct GenParticle : public Particle { 00033 00035 GenParticle(int pdgId) noexcept; 00036 00038 int pdgId; 00039 }; 00040 00041 00042 inline GenParticle::GenParticle(int pdgId_) noexcept 00043 : Particle{}, pdgId{pdgId_} {} 00044 00045 00047 struct GenJet : public Particle {}; 00048 00049 00051 struct Jet : public Particle { 00053 enum class PileUpId : int { 00054 None = 0, 00055 Loose, 00056 Medium, 00057 Tight, 00059 PassThrough 00060 }; 00061 00063 Jet() noexcept; 00064 00066 void SetFlavours(int hadronFlavour, int partonFlavour); 00067 00073 double bTag; 00074 00080 int hadronFlavour; 00081 00088 int combFlavour; 00089 00095 PileUpId pileUpId; 00096 00103 bool isPileUp; 00104 }; 00105 00106 00107 inline Jet::Jet() noexcept 00108 : Particle{}, bTag{std::numeric_limits<double>::quiet_NaN()}, 00109 hadronFlavour{0}, combFlavour{0}, 00110 pileUpId{PileUpId::PassThrough}, isPileUp{false} {} 00111 00112 00113 inline void Jet::SetFlavours(int hadronFlavour_, int partonFlavour) { 00114 hadronFlavour = hadronFlavour_; 00115 combFlavour = 00116 (hadronFlavour != 0) ? hadronFlavour : std::abs(partonFlavour); 00117 } 00118 00119 00121 struct PtMiss : public Particle { 00122 00124 PtMiss() noexcept; 00125 00131 double significance; 00132 }; 00133 00134 00135 inline PtMiss::PtMiss() noexcept 00136 : Particle{}, significance{std::numeric_limits<double>::quiet_NaN()} {} 00137 00138 00140 struct Photon : public Particle { 00141 00143 enum class Origin { 00144 PromptPhoton, 00145 PromptElectron, 00146 Unmatched 00147 }; 00148 00150 Origin flavour = Origin::Unmatched; 00151 00153 TLorentzVector genP4; 00154 00156 Photon() noexcept; 00157 }; 00158 00159 inline Photon::Photon() noexcept 00160 : Particle{} {} 00161 00162 00163 struct IsoTrack : public Particle { 00164 00166 IsoTrack() noexcept; 00167 }; 00168 00169 inline IsoTrack::IsoTrack() noexcept 00170 : Particle{} {} 00171 00173 struct Lepton : public Particle { 00174 00176 enum class Flavour { 00177 Electron, 00178 Muon 00179 }; 00180 00182 Lepton(Flavour flavour) noexcept; 00183 00185 Flavour flavour; 00186 00193 int charge; 00194 00203 TLorentzVector uncorrP4; 00204 }; 00205 00206 00207 inline Lepton::Lepton(Flavour flavour_) noexcept 00208 : Particle{}, flavour{flavour_}, charge{0}, uncorrP4{} {} 00209 00210 00212 struct Electron : public Lepton { 00213 00215 Electron() noexcept; 00216 00222 double etaSc; 00223 }; 00224 00225 00226 inline Electron::Electron() noexcept 00227 : Lepton{Lepton::Flavour::Electron}, 00228 etaSc{std::numeric_limits<double>::quiet_NaN()} {} 00229 00230 00232 struct Muon : public Lepton { 00233 00235 Muon() noexcept; 00236 }; 00237 00238 00239 inline Muon::Muon() noexcept 00240 : Lepton{Lepton::Flavour::Muon} {} 00241 00242 #endif // HZZ2L2NU_INCLUDE_PHYSICSOBJECTS_H_ 00243