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
MCTrackerHit.cxx
Go to the documentation of this file.
1
7#include "MCTrackerHit.h"
8
10
12 : TObject() {
13 }
14
18
19void MCTrackerHit::Clear(Option_t* /* options */) {
20 TObject::Clear();
21}
22
23void MCTrackerHit::setMomentum(const float* momentum, bool rotate) {
24
25 //svt angle: it's already with minus sign.
26 float svtAngle = 30.5e-3;
27 //Rotate the the input position automatically to match with the SVT tracker system
28 if (rotate)
29 {
30 //x_ = position[1];
31 py_ = momentum[2];
32 pz_ = momentum[1] * sin(svtAngle) + momentum[0]*cos(svtAngle);
33 px_ = momentum[1] * cos(svtAngle) - momentum[0]*sin(svtAngle);
34 }
35 else {
36 px_ = momentum[0];
37 py_ = momentum[1];
38 pz_ = momentum[2];
39 }
40}
41
42void MCTrackerHit::setPosition(const double* position, bool rotate) {
43
44 //svt angle: it's already with minus sign.
45 float svtAngle = 30.5e-3;
46 //Rotate the the input position automatically to match with the SVT tracker system
47 if (rotate)
48 {
49 //x_ = position[1];
50 y_ = position[2];
51 z_ = position[1] * sin(svtAngle) + position[0]*cos(svtAngle);
52 x_ = position[1] * cos(svtAngle) - position[0]*sin(svtAngle);
53 }
54 else {
55 x_ = position[0];
56 y_ = position[1];
57 z_ = position[2];
58 }
59}
ClassImp(MCTrackerHit) MCTrackerHit
Class used to encapsulate mc tracker hit information.
virtual ~MCTrackerHit()
void setPosition(const double *position, bool rotate=false)
void Clear(Option_t *option="")
void setMomentum(const float *momentum, bool rotate=false)