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
TrackerHit.cxx
Go to the documentation of this file.
1
7#include "TrackerHit.h"
8
10
12 : TObject() {
13 }
14
18
19void TrackerHit::Clear(Option_t* /* options */) {
20 TObject::Clear();
21}
22
23void TrackerHit::setPosition(const double* position, bool rotate, int type) {
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
29 //Rotated Helical Track Hit
30 if (type == 0) {
31 x_ = position[1];
32 y_ = position[2];
33 z_ = position[0];
34 }
35 else if (type==1) {
36 x_ = position[0];
37 y_ = position[1];
38 z_ = position[2];
39 }
40 else {
41 std::cout<<"ERROR::TrackerHit SetPosition"<<std::endl;
42 }
43
44 if (rotate) {
45
46 double tmpx = x_;
47 double tmpz = z_;
48
49 x_ = tmpx*cos(svtAngle) - tmpz*sin(svtAngle);
50 z_ = tmpx*sin(svtAngle) + tmpz*cos(svtAngle);
51 }
52
53
54 /*
55 if (rotate)
56 {
57 //x_ = position[1];
58 y_ = position[2];
59 z_ = position[1] * sin(svtAngle) + position[0]*cos(svtAngle);
60 x_ = position[1] * cos(svtAngle) - position[0]*sin(svtAngle);
61 }
62 else {
63 x_ = position[1];
64 y_ = position[2];
65 z_ = position[0];
66 }
67 */
68}
69
70void TrackerHit::setCovarianceMatrix(const std::vector<float> covariance_matrix) {
71 cxx_ = covariance_matrix[0];
72 cxy_ = covariance_matrix[1];
73 cxz_ = covariance_matrix[2];
74 cyy_ = covariance_matrix[3];
75 cyz_ = covariance_matrix[4];
76 czz_ = covariance_matrix[5];
77}
78
79std::vector<double> TrackerHit::getCovarianceMatrix() const {
80 return { cxx_, cxy_, cxz_, cyy_, cyz_, czz_ };
81}
ClassImp(TrackerHit) TrackerHit
Definition TrackerHit.cxx:9
Class used to encapsulate tracker hit information.
virtual ~TrackerHit()
double cyy_
Definition TrackerHit.h:155
double cxz_
Definition TrackerHit.h:154
void setCovarianceMatrix(std::vector< float > cov)
double cyz_
Definition TrackerHit.h:156
double cxx_
Definition TrackerHit.h:152
double cxy_
Definition TrackerHit.h:153
void Clear(Option_t *option="")
double czz_
Definition TrackerHit.h:157
double z_
Definition TrackerHit.h:149
double y_
Definition TrackerHit.h:146
double x_
Definition TrackerHit.h:143
void setPosition(const double *position, bool rotate=false, int type=0)
std::vector< double > getCovarianceMatrix() const