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