File indexing completed on 2024-04-06 12:03:49
0001 #ifndef Candidate_Particle_h
0002 #define Candidate_Particle_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "ParticleState.h"
0014 namespace reco {
0015
0016 class Particle {
0017 public:
0018
0019 typedef int Charge;
0020
0021 typedef math::XYZTLorentzVector LorentzVector;
0022
0023 typedef math::PtEtaPhiMLorentzVector PolarLorentzVector;
0024
0025 typedef math::XYZPoint Point;
0026
0027 typedef math::XYZVector Vector;
0028
0029 typedef unsigned int index;
0030
0031 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
0032 template <typename... Args>
0033 explicit Particle(Args&&... args) : m_state(std::forward<Args>(args)...) {}
0034
0035 Particle(Particle& rh) : m_state(rh.m_state) {}
0036
0037 Particle(Particle&&) = default;
0038 Particle(Particle const&) = default;
0039 Particle& operator=(Particle&&) = default;
0040 Particle& operator=(Particle const&) = default;
0041 #else
0042
0043 Particle();
0044 Particle(Charge q,
0045 const PtEtaPhiMass& p4,
0046 const Point& vtx = Point(0, 0, 0),
0047 int pdgId = 0,
0048 int status = 0,
0049 bool integerCharge = true);
0050 Particle(Charge q,
0051 const LorentzVector& p4,
0052 const Point& vtx = Point(0, 0, 0),
0053 int pdgId = 0,
0054 int status = 0,
0055 bool integerCharge = true);
0056 Particle(Charge q,
0057 const PolarLorentzVector& p4,
0058 const Point& vtx = Point(0, 0, 0),
0059 int pdgId = 0,
0060 int status = 0,
0061 bool integerCharge = true);
0062 Particle(Charge q,
0063 const GlobalVector& p3,
0064 float iEnergy,
0065 float imass,
0066 const Point& vtx = Point(0, 0, 0),
0067 int pdgId = 0,
0068 int status = 0,
0069 bool integerCharge = true);
0070 #endif
0071
0072 void construct(int qx3, float pt, float eta, float phi, float mass, const Point& vtx, int pdgId, int status) {
0073 m_state = ParticleState(qx3, PolarLorentzVector(pt, eta, phi, mass), vtx, pdgId, status, false);
0074 }
0075
0076
0077 virtual ~Particle() {}
0078
0079
0080 int charge() const { return m_state.charge(); }
0081
0082 void setCharge(Charge q) { m_state.setCharge(q); }
0083
0084 int threeCharge() const { return m_state.threeCharge(); }
0085
0086 void setThreeCharge(Charge qx3) { m_state.setThreeCharge(qx3); }
0087
0088 const LorentzVector& p4() const { return m_state.p4(); }
0089
0090 const PolarLorentzVector& polarP4() const { return m_state.polarP4(); }
0091
0092 Vector momentum() const { return m_state.momentum(); }
0093
0094
0095 Vector boostToCM() const { return m_state.boostToCM(); }
0096
0097 double p() const { return m_state.p(); }
0098
0099 double energy() const { return m_state.energy(); }
0100
0101 double et() const { return m_state.et(); }
0102
0103 double et2() const { return m_state.et2(); }
0104
0105 double mass() const { return m_state.mass(); }
0106
0107 double massSqr() const { return mass() * mass(); }
0108
0109
0110 double mt() const { return m_state.mt(); }
0111
0112 double mtSqr() const { return m_state.mtSqr(); }
0113
0114 double px() const { return m_state.px(); }
0115
0116 double py() const { return m_state.py(); }
0117
0118 double pz() const { return m_state.pz(); }
0119
0120 double pt() const { return m_state.pt(); }
0121
0122 double phi() const { return m_state.phi(); }
0123
0124 double theta() const { return m_state.theta(); }
0125
0126 double eta() const { return m_state.eta(); }
0127
0128 double rapidity() const { return m_state.rapidity(); }
0129
0130 double y() const { return rapidity(); }
0131
0132 void setP4(const LorentzVector& p4) { m_state.setP4(p4); }
0133
0134 void setP4(const PolarLorentzVector& p4) { m_state.setP4(p4); }
0135
0136 void setMass(double m) { m_state.setMass(m); }
0137 void setPz(double pz) { m_state.setPz(pz); }
0138
0139 const Point& vertex() const { return m_state.vertex(); }
0140
0141 double vx() const { return m_state.vx(); }
0142
0143 double vy() const { return m_state.vy(); }
0144
0145 double vz() const { return m_state.vz(); }
0146
0147 void setVertex(const Point& vertex) { m_state.setVertex(vertex); }
0148
0149
0150 int pdgId() const { return m_state.pdgId(); }
0151
0152 void setPdgId(int pdgId) { m_state.setPdgId(pdgId); }
0153
0154 int status() const { return m_state.status(); }
0155
0156 void setStatus(int status) { m_state.setStatus(status); }
0157
0158
0159 void setLongLived() { m_state.setLongLived(); }
0160
0161 bool longLived() const { return m_state.longLived(); }
0162
0163
0164 void setMassConstraint() { m_state.setMassConstraint(); }
0165
0166 bool massConstraint() const { return m_state.massConstraint(); }
0167
0168 private:
0169 ParticleState m_state;
0170 };
0171
0172 }
0173
0174 #endif