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