hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Vertex.h
Go to the documentation of this file.
1
8#ifndef _VERTEX_H_
9#define _VERTEX_H_
10
11
12#include <vector>
13
14#include <TObject.h>
15#include <TRefArray.h>
16#include <TRef.h>
17#include <TVector3.h>
18#include <TLorentzVector.h>
19
20//TODO make float/doubles accordingly.
21
22class Vertex : public TObject {
23
24 public:
25
28
30 ~Vertex();
31
33 void Clear(Option_t *option="");
34
41 void addParticle(TObject* part);
42
43 //TODO unify
45 void setChi2(const double chi2) {chi2_ = chi2;}
46
48 void setNdf(const double ndf) {ndf_ = ndf;}
49
51 void setX(const double x) {pos_.SetX(x);}
52
54 void setY(const double y) {pos_.SetY(y);}
55
57 void setZ(const double z) {pos_.SetZ(z);}
58
60 void setPos(const float* pos, bool rotate = false);
61
63 void setPos(const TVector3& pos);
64
70 void setVtxParameters(const std::vector<float>& parameters);
71
72 void setVtxParameters(const TLorentzVector& p1,
73 const TLorentzVector& p2);
74
75 void setVtxParameters(const TVector3& p1,
76 const TVector3& p2,
77 const double m) ;
78
80 void setType(const std::string& type) {type_ = type;}
81
83 void setID (const int id) {id_=id;}
84
89 void setCovariance( const std::vector<float>& vec);
90
92 void setProbability(const float probability) {probability_ = probability;}
93
94 TRefArray getParticles(){return parts_;};
95
97 const std::vector<float>& getCovariance() const {return covariance_;}
98
100 float getProbability() const {return probability_;}
101
103 double getChi2() const {return chi2_;}
104
106 double getNdf() const {return ndf_;}
107
109 double getX() const {return pos_.X();}
110
112 double getY() const {return pos_.Y();}
113
115 double getZ() const {return pos_.Z();}
116
118 TVector3 getPos() const {return pos_;}
119
121 std::string getType() const {return type_;}
122
124 int getID () {return id_;}
125
127 float getInvMass () const {return invM_;}
128
130 float getInvMassErr () const {return invMerr_;}
131
132 //TODO - Change these to use the track references after filling the
133 //track refs
134 TVector3 getP1 () const {return p1_;}
135 double getP1X () const {return p1_.X();}
136 double getP1Y () const {return p1_.Y();}
137 double getP1Z () const {return p1_.Z();}
138
139 TVector3 getP2 () const {return p2_;}
140 double getP2X () const {return p2_.X();}
141 double getP2Y () const {return p2_.Y();}
142 double getP2Z () const {return p2_.Z();}
143
144 TVector3 getP () const {return p_;}
145
147 double getTgtConstrSigmaX() const {return parameters_[9];}
148
150 double getTgtConstrX() const {return parameters_[7];}
151
153 double getTgtConstrSigmaY() const {return parameters_[11];}
154
156 double getTgtConstrY() const {return parameters_[20];}
157
159
160 private:
161
162 double chi2_{-999};
163 int ndf_{-999};
164 TVector3 pos_,p1_,p2_,p_;
165
166 float invM_{-999};
167 float invMerr_{-999};
168
169 std::vector<float> covariance_{};
170 float probability_{-999};
171 int id_;
172 std::string type_{""};
173 TRefArray parts_;
174 int n_parts_{0};
175 std::vector<float> parameters_;
176
177}; // Vertex
178
179#endif // __VERTEX_H__
double getP1X() const
Definition Vertex.h:135
const std::vector< float > & getCovariance() const
Definition Vertex.h:97
TVector3 getP1() const
Definition Vertex.h:134
void setPos(const float *pos, bool rotate=false)
Definition Vertex.cxx:39
double getTgtConstrX() const
Definition Vertex.h:150
TVector3 pos_
Definition Vertex.h:164
double getP1Y() const
Definition Vertex.h:136
double getX() const
Definition Vertex.h:109
void setVtxParameters(const std::vector< float > &parameters)
Definition Vertex.cxx:81
TVector3 p1_
Definition Vertex.h:164
TRefArray getParticles()
Definition Vertex.h:94
float invMerr_
Definition Vertex.h:167
TVector3 getP2() const
Definition Vertex.h:139
std::vector< float > parameters_
Definition Vertex.h:175
double getChi2() const
Definition Vertex.h:103
std::vector< float > covariance_
Definition Vertex.h:169
float getInvMass() const
Definition Vertex.h:127
double getTgtConstrY() const
Definition Vertex.h:156
TVector3 getPos() const
Definition Vertex.h:118
void setID(const int id)
Definition Vertex.h:83
int ndf_
Definition Vertex.h:163
TRefArray parts_
Definition Vertex.h:173
float probability_
Definition Vertex.h:170
double chi2_
Definition Vertex.h:162
std::string getType() const
Definition Vertex.h:121
std::string type_
Definition Vertex.h:172
double getTgtConstrSigmaX() const
Definition Vertex.h:147
float invM_
Definition Vertex.h:166
double getZ() const
Definition Vertex.h:115
void Clear(Option_t *option="")
Definition Vertex.cxx:21
void setPos(const TVector3 &pos)
double getP2Z() const
Definition Vertex.h:142
void setZ(const double z)
Definition Vertex.h:57
void setType(const std::string &type)
Definition Vertex.h:80
float getInvMassErr() const
Definition Vertex.h:130
double getP2Y() const
Definition Vertex.h:141
TVector3 getP() const
Definition Vertex.h:144
void setProbability(const float probability)
Definition Vertex.h:92
int n_parts_
Definition Vertex.h:174
void addParticle(TObject *part)
Definition Vertex.cxx:29
float getProbability() const
Definition Vertex.h:100
double getP1Z() const
Definition Vertex.h:137
TVector3 p2_
Definition Vertex.h:164
double getY() const
Definition Vertex.h:112
int id_
Definition Vertex.h:171
ClassDef(Vertex, 1)
TVector3 p_
Definition Vertex.h:164
void setY(const double y)
Definition Vertex.h:54
void setCovariance(const std::vector< float > &vec)
Definition Vertex.cxx:35
void setNdf(const double ndf)
Definition Vertex.h:48
void setChi2(const double chi2)
Definition Vertex.h:45
double getNdf() const
Definition Vertex.h:106
double getP2X() const
Definition Vertex.h:140
double getTgtConstrSigmaY() const
Definition Vertex.h:153
int getID()
Definition Vertex.h:124
~Vertex()
Definition Vertex.cxx:17
void setX(const double x)
Definition Vertex.h:51