22 inline unsigned int covarIndex(
unsigned int i,
unsigned int j)
25 return i + 1 + (j + 1) * (j) / 2 - 1;
29 template <
float (TpcPrototypeCluster::*accessor)(
unsigned int,
unsigned int) const>
32 const auto phi = -std::atan2(cluster->
getY(), cluster->
getX());
33 const auto cosphi = std::cos(
phi);
34 const auto sinphi = std::sin(
phi);
36 return square(sinphi) * (cluster->*accessor)(0, 0) +
37 square(cosphi) * (cluster->*accessor)(1, 1) +
38 2. * cosphi * sinphi * (cluster->*accessor)(0, 1);
44 : m_cluskey(TrkrDefs::CLUSKEYMAX)
55 , avg_pad_azimuth(NAN)
57 , size_pad_azimuth(-1)
58 , delta_azimuth_bin(NAN)
61 for (
int i = 0; i < 3; ++
i)
m_pos[i] = NAN;
63 for (
int j = 0; j < 3; ++
j)
65 for (
int i = j; i < 3; ++
i)
75 os <<
"---TpcPrototypeCluster--------------------" << std::endl;
76 os <<
"clusid: " <<
getClusKey() << std::dec << std::endl;
82 os <<
" - global coordinates" << std::endl;
84 os <<
" - local coordinates" << std::endl;
86 os <<
" adc = " <<
getAdc() << std::endl;
89 os <<
" cm, size z = " <<
getZSize() <<
" cm" << std::endl;
94 os <<
getSize(0, 2) <<
" )" << std::endl;
98 os <<
getSize(1, 2) <<
" )" << std::endl;
102 os <<
getSize(2, 2) <<
" )" << std::endl;
107 os <<
getError(0, 2) <<
" )" << std::endl;
111 os <<
getError(1, 2) <<
" )" << std::endl;
115 os <<
getError(2, 2) <<
" )" << std::endl;
118 os <<
" pad_radials = ( ";
120 os <<
")" << std::endl;
123 os <<
" pad_azimuths = ( ";
124 for (
auto& element :
pad_azimuths) os << element <<
" ";
125 os <<
")" << std::endl;
127 os <<
" samples = ( ";
128 for (
auto& element :
samples) os << element <<
" ";
129 os <<
")" << std::endl;
132 os <<
" pad_radial_samples = [ " << std::endl;
135 os << pair.first <<
"->( ";
136 for (
auto& element : pair.second) os << element <<
" ";
137 os <<
")" << std::endl;
139 os <<
"]" << std::endl;
141 os <<
" pad_azimuth_samples = [ " << std::endl;
144 os << pair.first <<
"->( ";
145 for (
auto& element : pair.second) os << element <<
" ";
146 os <<
")" << std::endl;
148 os <<
"]" << std::endl;
150 os <<
" sum_samples = ( ";
151 for (
auto& element :
sum_samples) os << element <<
" ";
152 os <<
")" << std::endl;
155 os <<
" min_sample = " <<
min_sample << std::endl;
157 os <<
" max_sample = " <<
max_sample << std::endl;
164 os <<
" peak = " <<
peak << std::endl;
166 os <<
" peak_sample = " <<
peak_sample << std::endl;
168 os <<
" pedstal = " <<
pedstal << std::endl;
172 os <<
" pad_azimuth_peaks = ( ";
173 for (
auto& element :
pad_azimuth_peaks) os << element.first <<
"->" << element.second <<
" ";
174 os <<
")" << std::endl;
194 os <<
" delta_z = " <<
delta_z << std::endl;
197 os <<
"-----------------------------------------------" << std::endl;
204 if (
m_cluskey == TrkrDefs::CLUSKEYMAX)
return 0;
205 for (
int i = 0; i < 3; ++
i)
209 if (
m_adc == 0xFFFFFFFF)
return 0;
210 for (
int j = 0; j < 3; ++
j)
212 for (
int i = j; i < 3; ++
i)
214 if (isnan(
getSize(i, j)))
return 0;
215 if (isnan(
getError(i, j)))
return 0;
230 return m_size[covarIndex(i, j)];
241 return m_err[covarIndex(i, j)];
246 return 2 * std::sqrt(rotate<&TpcPrototypeCluster::getSize>(
this));
251 return 2. * sqrt(
getSize(2, 2));
263 return std::sqrt(rotate<&TpcPrototypeCluster::getError>(
this));