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
MCParticle.cxx
Go to the documentation of this file.
1
7#include "MCParticle.h"
8
10
12 : TObject() {
13}
14
16 Clear();
17 delete daughters_;
18}
19
20void MCParticle::Clear(Option_t* /* option */) {
21 TObject::Clear();
22 daughters_->Delete();
23 n_daughters_ = 0;
24}
25
28 daughters_->Add(static_cast<TObject*>(particle));
29}
30
31void MCParticle::setMomentum(const double* momentum) {
32 px_ = momentum[0];
33 py_ = momentum[1];
34 pz_ = momentum[2];
35}
36
37void MCParticle::setEndpointMomentum(const double* momentum_ep) {
38 px_ep = momentum_ep[0];
39 py_ep = momentum_ep[1];
40 pz_ep = momentum_ep[2];
41}
42
43std::vector<double> MCParticle::getMomentum() const { return { px_, py_, pz_ }; }
44
45std::vector<double> MCParticle::getEndpointMomentum() const { return { px_ep, py_ep, pz_ep }; }
46
47void MCParticle::setVertexPosition(const double* vtx_pos) {
48 vtx_x_ = vtx_pos[0];
49 vtx_y_ = vtx_pos[1];
50 vtx_z_ = vtx_pos[2];
51}
52
53void MCParticle::setEndPoint(const double* ep_pos) {
54 ep_x_ = ep_pos[0];
55 ep_y_ = ep_pos[1];
56 ep_z_ = ep_pos[2];
57}
58
59std::vector<double> MCParticle::getVertexPosition() const {
60 return { vtx_x_, vtx_y_, vtx_z_ };
61}
62
63std::vector<double> MCParticle::getEndPoint() const {
64 return { ep_x_, ep_y_, ep_z_ };
65}
ClassImp(MCParticle) MCParticle
Definition MCParticle.cxx:9
Class used to encapsulate information about a mc particle.
double py_ep
Definition MCParticle.h:226
std::vector< double > getMomentum() const
double px_
Definition MCParticle.h:214
void setVertexPosition(const double *vtx_pos)
void setEndpointMomentum(const double *momentum_ep)
double pz_ep
Definition MCParticle.h:229
TRefArray * daughters_
Definition MCParticle.h:190
std::vector< double > getVertexPosition() const
void addDaughter(MCParticle *particle)
double vtx_y_
Definition MCParticle.h:235
std::vector< double > getEndPoint() const
double px_ep
Definition MCParticle.h:223
double py_
Definition MCParticle.h:217
int n_daughters_
Definition MCParticle.h:196
double ep_x_
Definition MCParticle.h:241
double vtx_z_
Definition MCParticle.h:238
double vtx_x_
Definition MCParticle.h:232
void Clear(Option_t *option="")
void setMomentum(const double *momentum)
std::vector< double > getEndpointMomentum() const
double pz_
Definition MCParticle.h:220
void setEndPoint(const double *ep_pos)
double ep_z_
Definition MCParticle.h:247
double ep_y_
Definition MCParticle.h:244