#include <sndUSPlane.h>
Definition at line 13 of file sndUSPlane.h.
◆ USPlane()
snd::analysis_tools::USPlane::USPlane |
( |
TClonesArray * |
snd_hits, |
|
|
snd::Configuration |
configuration, |
|
|
MuFilter * |
muon_filter_geometry, |
|
|
int |
index_begin, |
|
|
int |
index_end, |
|
|
int |
station |
|
) |
| |
Definition at line 13 of file sndUSPlane.cxx.
14{
15 if (index_begin > index_end)
16 {
17 throw std::runtime_error{"Begin index > end index"};
18 }
19 for (
int j{index_begin};
j < index_end; ++
j)
20 {
21 auto mu_hit =
static_cast<MuFilterHit *
>(snd_hits->At(j));
22
23 for (
int i{0};
i < 16; ++
i)
24 {
25 if (mu_hit->isMasked(i) || mu_hit->GetSignal(i) < -990.) continue;
26 USHit hit;
27 hit.bar = static_cast<int>(mu_hit->GetDetectorID() % 1000);
28 hit.channel_index = 16 * hit.bar +
i;
29 hit.timestamp = mu_hit->GetTime(i);
30 hit.qdc = mu_hit->GetSignal(i);
31 hit.is_large = !mu_hit->isShort(i);
32
34 int detectorID = mu_hit->GetDetectorID();
35 muon_filter_geometry->
GetPosition(detectorID, A, B);
36 hit.is_right =
i > 7 ? true :
false;
37 hit.x = hit.is_right ?
B.X() :
A.X();
41 }
42 }
43}
void GetPosition(Int_t id, TVector3 &vLeft, TVector3 &vRight)
◆ FindCentroid()
void snd::analysis_tools::USPlane::FindCentroid |
( |
| ) |
|
Definition at line 45 of file sndUSPlane.cxx.
46{
47
49 {
50
51 return;
52 }
53
55 if (total_qdc > 0.0)
56 {
57 for (
const auto &hit :
hits_)
58 {
59
60 double weighted_sum_x{0.0}, weighted_sum_y{0.0}, weighted_sum_z{0.0};
61 double total_qdc_positive{0.0};
62
63 if (hit.qdc > 0.0)
64 {
65 weighted_sum_x += hit.x * hit.qdc;
66 weighted_sum_y += hit.y * hit.qdc;
67 weighted_sum_z += hit.z * hit.qdc;
68 total_qdc_positive += hit.qdc;
69 }
70
71 double x = weighted_sum_x / total_qdc_positive;
72 double y = weighted_sum_y / total_qdc_positive;
73 double z = weighted_sum_z / total_qdc_positive;
75 }
76 }
78}
double us_centroid_error_z
double us_centroid_error_y
int us_min_n_hits_for_centroid
double us_centroid_error_x
◆ GetBarNHits()
Definition at line 142 of file sndUSPlane.cxx.
143{
144 sl_pair<int> bar_hit{0, 0};
145 for (
const auto &hit :
hits_)
146 {
147 if (hit.bar != bar_to_compute)
148 continue;
149 else
150 {
151 if (hit.is_large)
152
153 bar_hit.large++;
154 else
155 bar_hit.small++;
156
157 }
158 }
159 return bar_hit;
160}
◆ GetBarQdc()
Definition at line 121 of file sndUSPlane.cxx.
122{
123 rl_pair<double> bar_qdc{0.0, 0.0};
124 for (
const auto &hit :
hits_)
125 {
126 if (hit.bar != bar_to_compute)
127 continue;
128 else
129 {
130 if (hit.is_large)
131 {
132 if (hit.is_right)
133 bar_qdc.right += hit.qdc;
134 else
135 bar_qdc.left += hit.qdc;
136 }
137 }
138 }
139 return bar_qdc;
140}
◆ GetCentroid()
const TVector3 snd::analysis_tools::USPlane::GetCentroid |
( |
| ) |
const |
|
inline |
◆ GetCentroidError()
const TVector3 snd::analysis_tools::USPlane::GetCentroidError |
( |
| ) |
const |
|
inline |
◆ GetHits()
const std::vector< USHit > snd::analysis_tools::USPlane::GetHits |
( |
| ) |
const |
|
inline |
◆ GetNHits()
Definition at line 170 of file sndUSPlane.cxx.
171{
172 sl_pair<int> counts{0, 0};
173 counts.large = std::count_if(
hits_.begin(),
hits_.end(), [](
auto &hit)
174 { return hit.is_large; });
175 counts.small =
hits_.size() - counts.large;
176
177 return counts;
178}
◆ GetSideQdc()
Definition at line 105 of file sndUSPlane.cxx.
106{
107 rl_pair<double> side_qdc{0.0, 0.0};
108 for (
const auto &hit :
hits_)
109 {
110 if (hit.is_large)
111 {
112 if (hit.is_right)
113 side_qdc.right += hit.qdc;
114 else
115 side_qdc.left += hit.qdc;
116 }
117 }
118 return side_qdc;
119}
◆ GetStation()
const int snd::analysis_tools::USPlane::GetStation |
( |
| ) |
const |
|
inline |
◆ GetTotEnergy()
Definition at line 93 of file sndUSPlane.cxx.
94{
95 sl_pair<double> tot_energy{0.0, 0.0};
97
100
101 return tot_energy;
102}
◆ GetTotQdc()
Definition at line 80 of file sndUSPlane.cxx.
81{
82 sl_pair<double> totQdc{0.0, 0.0};
83 for (
const auto &hit :
hits_)
84 {
85 if (hit.is_large)
86 totQdc.large += hit.qdc;
87 else
88 totQdc.small += hit.qdc;
89 }
90 return totQdc;
91}
◆ TimeFilter()
void snd::analysis_tools::USPlane::TimeFilter |
( |
double |
min_timestamp, |
|
|
double |
max_timestamp |
|
) |
| |
Definition at line 162 of file sndUSPlane.cxx.
163{
165 [&](auto &hit)
166 { return hit.timestamp < min_timestamp || hit.timestamp > max_timestamp; }),
168}
◆ centroid_
TVector3 snd::analysis_tools::USPlane::centroid_ |
|
private |
◆ centroid_error_
TVector3 snd::analysis_tools::USPlane::centroid_error_ |
|
private |
◆ configuration_
◆ hits_
std::vector<USHit> snd::analysis_tools::USPlane::hits_ |
|
private |
◆ station_
int snd::analysis_tools::USPlane::station_ |
|
private |
The documentation for this class was generated from the following files: