LDMX Software
TrigParticle.h
1#ifndef TRIGGER_EVENT_TRIGPARTICLE_H
2#define TRIGGER_EVENT_TRIGPARTICLE_H
3
4// ROOT
5#include "Math/GenVector/LorentzVector.h"
6#include "Math/GenVector/PositionVector3D.h"
7#include "TObject.h" //For ClassDef
8
9namespace trigger {
10
11// Forward declaration needed by typedef
12class TrigParticle;
13typedef std::vector<TrigParticle> TrigParticleCollection;
14
15// move to a central location?
16typedef ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >
17 XYZTLorentzVector;
18typedef XYZTLorentzVector LorentzVector;
19typedef ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<double> > Point;
20
26 public:
27 TrigParticle() = default;
28 TrigParticle(LorentzVector p4);
29 TrigParticle(LorentzVector p4, Point vtx);
30 TrigParticle(LorentzVector p4, Point vtx, int pdgId);
31
32 virtual ~TrigParticle() = default;
33
34 // momenta accessors
35 double p() const { return p4_.P(); }
36 double energy() const { return p4_.E(); }
37 double mass() const { return p4_.mass(); }
38 double px() const { return p4_.Px(); }
39 double py() const { return p4_.Py(); }
40 double pz() const { return p4_.Pz(); }
41 double pt() const { return p4_.pt(); }
42 double phi() const { return p4_.phi(); }
43 double theta() const { return p4_.Theta(); }
44
45 // vertex accessors
46 const Point& vertex() const { return vtx_; }
47 double vx() const { return vtx_.X(); }
48 double vy() const { return vtx_.Y(); }
49 double vz() const { return vtx_.Z(); }
50 const Point& endPoint() const { return end_; }
51 double endx() const { return end_.X(); }
52 double endy() const { return end_.Y(); }
53 double endz() const { return end_.Z(); }
54
55 // cluster access
56 float getClusEnergy() const { return em_clus_e_; }
57 int getClusTP() const { return em_clus_ntp_; }
58 int getClusDepth() const { return em_clus_depth_; }
59 /* const TrigCaloCluster& getCluster() const {return clus_;} */
60
61 // setters
62 void setP4(const LorentzVector& p4) { p4_ = p4; }
63 void setVertex(const Point& v) { vtx_ = v; }
64 void setEndPoint(const Point& v) { end_ = v; }
65 void setClusEnergy(const float n) { em_clus_e_ = n; }
66 void setClusTP(const int n) { em_clus_ntp_ = n; }
67 void setClusDepth(const int n) { em_clus_depth_ = n; }
68
69 /* void setCluster(const TrigCaloCluster& c) { */
70 /* clus_ = c; */
71 /* } */
72
73 // set HW values
74 void setHwPt(int pt) { hw_pt_ = pt; }
75 void setHwEta(int eta) { hw_eta_ = eta; }
76 void setHwPhi(int phi) { hw_phi_ = phi; }
77 void setHwQual(int qual) { hw_qual_ = qual; }
78 void setHwIso(int iso) { hw_iso_ = iso; }
79
80 // retrieve HW values
81 int hwPt() const { return hw_pt_; }
82 int hwEta() const { return hw_eta_; }
83 int hwPhi() const { return hw_phi_; }
84 int hwQual() const { return hw_qual_; }
85 int hwIso() const { return hw_iso_; }
86
87 private:
88 XYZTLorentzVector p4_{};
89 /* TrigCaloCluster clus_; */
90
91 Point vtx_{};
92 Point end_{};
93 int pdg_id_{0};
94
95 int hw_pt_{0};
96 int hw_eta_{0};
97 int hw_phi_{0};
98 int hw_qual_{0};
99 int hw_iso_{0};
100
101 // cluster attributes
102 float em_clus_e_{0};
103 int em_clus_ntp_{0};
104 int em_clus_depth_{0};
105
108};
109} // namespace trigger
110
111#endif // TRIGGER_EVENT_TRIGPARTICLE_H
Class for particles reconstructed by the trigger system.
ClassDef(TrigParticle, 2)
ROOT Dictionary class definition macro.