38
38
void ImportTOFRecon::ImportTOFSpacePoints(
39
const MAUS::TOFEventSpacePoint tofEventSpacepoint,
40
MAUS::GlobalEvent* global_event,
41
std::string mapper_name) {
39
const MAUS::TOFEventSpacePoint tofEventSpacepoint,
40
MAUS::GlobalEvent* global_event,
41
std::string mapper_name) {
44
std::vector<TOFSpacePoint> tofarray;
50
MAUS::DataStructure::Global::DetectorPoint detector;
52
44
for (int n = 0; n < 3; n++) {
55
max_i = tofEventSpacepoint.GetTOF0SpacePointArraySize();
56
tofarray = tofEventSpacepoint.GetTOF0SpacePointArray();
60
detector = MAUS::DataStructure::Global::kTOF0;
47
ImportTOF0SpacePoints(tofEventSpacepoint, global_event, mapper_name);
64
max_i = tofEventSpacepoint.GetTOF1SpacePointArraySize();
65
tofarray = tofEventSpacepoint.GetTOF1SpacePointArray();
69
detector = MAUS::DataStructure::Global::kTOF1;
51
ImportTOF1SpacePoints(tofEventSpacepoint, global_event, mapper_name);
73
max_i = tofEventSpacepoint.GetTOF2SpacePointArraySize();
74
tofarray = tofEventSpacepoint.GetTOF2SpacePointArray();
78
detector = MAUS::DataStructure::Global::kTOF2;
82
for (unsigned int i = 0; i < max_i; ++i) {
84
x = tofarray[i].GetSlaby()*40.0 - 180.0;
85
y = tofarray[i].GetSlabx()*40.0 - 180.0;
86
} else if (z == 10572.0) {
87
x = tofarray[i].GetSlaby()*60.0 - 180.0;
88
y = tofarray[i].GetSlabx()*60.0 - 180.0;
89
} else if (z == 17905.74) {
90
x = tofarray[i].GetSlaby()*60 - 270;
91
y = tofarray[i].GetSlabx()*60 - 270;
95
MAUS::DataStructure::Global::SpacePoint* spoint =
96
new MAUS::DataStructure::Global::SpacePoint();
98
// TODO(Pidcott) need to change slab # to a global position
99
// double x = tofarray[i].GetSlaby();
100
// double y = tofarray[i].GetSlabx();
101
double t = tofarray[i].GetTime();
102
TLorentzVector pos(x, y, z, t);
104
// TODO(Pidcott) Not sure what z error should actually be, set as 1 for now
106
double t_err = tofarray[i].GetDt();
107
TLorentzVector pos_err(x_err, y_err, z_err, t_err);
109
spoint->set_detector(detector);
110
spoint->set_position(pos);
111
spoint->set_position_error(pos_err);
113
global_event->add_space_point(spoint);
55
ImportTOF2SpacePoints(tofEventSpacepoint, global_event, mapper_name);
61
void ImportTOFRecon::ImportTOF0SpacePoints(
62
const MAUS::TOFEventSpacePoint tofEventSpacepoint,
63
MAUS::GlobalEvent* global_event,
64
std::string mapper_name) {
66
size_t max_i = tofEventSpacepoint.GetTOF0SpacePointArraySize();
67
std::vector<TOFSpacePoint> tofarray = tofEventSpacepoint.GetTOF0SpacePointArray();
68
MAUS::DataStructure::Global::DetectorPoint detector = MAUS::DataStructure::Global::kTOF0;
69
for (unsigned int i = 0; i < max_i; ++i) {
70
double x = tofarray[i].GetGlobalPosX();
71
double y = tofarray[i].GetGlobalPosY();
72
double z = tofarray[i].GetGlobalPosZ();
73
double x_err = tofarray[i].GetGlobalPosXErr();
74
double y_err = tofarray[i].GetGlobalPosYErr();
75
double z_err = tofarray[i].GetGlobalPosZErr();
76
double t = tofarray[i].GetTime();
77
double t_err = tofarray[i].GetDt();
78
MAUS::DataStructure::Global::SpacePoint* spoint =
79
new MAUS::DataStructure::Global::SpacePoint();
80
TLorentzVector pos(x, y, z, t);
81
TLorentzVector pos_err(x_err, y_err, z_err, t_err);
82
spoint->set_detector(detector);
83
spoint->set_position(pos);
84
spoint->set_position_error(pos_err);
86
global_event->add_space_point(spoint);
90
void ImportTOFRecon::ImportTOF1SpacePoints(
91
const MAUS::TOFEventSpacePoint tofEventSpacepoint,
92
MAUS::GlobalEvent* global_event,
93
std::string mapper_name) {
95
size_t max_i = tofEventSpacepoint.GetTOF1SpacePointArraySize();
96
std::vector<TOFSpacePoint> tofarray = tofEventSpacepoint.GetTOF1SpacePointArray();
97
MAUS::DataStructure::Global::DetectorPoint detector = MAUS::DataStructure::Global::kTOF1;
98
for (unsigned int i = 0; i < max_i; ++i) {
99
double x = tofarray[i].GetGlobalPosX();
100
double y = tofarray[i].GetGlobalPosY();
101
double z = tofarray[i].GetGlobalPosZ();
102
double x_err = tofarray[i].GetGlobalPosXErr();
103
double y_err = tofarray[i].GetGlobalPosYErr();
104
double z_err = tofarray[i].GetGlobalPosZErr();
105
double t = tofarray[i].GetTime();
106
double t_err = tofarray[i].GetDt();
107
MAUS::DataStructure::Global::SpacePoint* spoint =
108
new MAUS::DataStructure::Global::SpacePoint();
109
TLorentzVector pos(x, y, z, t);
110
TLorentzVector pos_err(x_err, y_err, z_err, t_err);
111
spoint->set_detector(detector);
112
spoint->set_position(pos);
113
spoint->set_position_error(pos_err);
115
global_event->add_space_point(spoint);
119
void ImportTOFRecon::ImportTOF2SpacePoints(
120
const MAUS::TOFEventSpacePoint tofEventSpacepoint,
121
MAUS::GlobalEvent* global_event,
122
std::string mapper_name) {
124
size_t max_i = tofEventSpacepoint.GetTOF2SpacePointArraySize();
125
std::vector<TOFSpacePoint> tofarray = tofEventSpacepoint.GetTOF2SpacePointArray();
126
MAUS::DataStructure::Global::DetectorPoint detector = MAUS::DataStructure::Global::kTOF2;
127
for (unsigned int i = 0; i < max_i; ++i) {
128
double x = tofarray[i].GetGlobalPosX();
129
double y = tofarray[i].GetGlobalPosY();
130
double z = tofarray[i].GetGlobalPosZ();
131
double x_err = tofarray[i].GetGlobalPosXErr();
132
double y_err = tofarray[i].GetGlobalPosYErr();
133
double z_err = tofarray[i].GetGlobalPosZErr();
134
double t = tofarray[i].GetTime();
135
double t_err = tofarray[i].GetDt();
136
MAUS::DataStructure::Global::SpacePoint* spoint =
137
new MAUS::DataStructure::Global::SpacePoint();
138
TLorentzVector pos(x, y, z, t);
139
TLorentzVector pos_err(x_err, y_err, z_err, t_err);
140
spoint->set_detector(detector);
141
spoint->set_position(pos);
142
spoint->set_position_error(pos_err);
144
global_event->add_space_point(spoint);
117
147
} // ~namespace global