26 static inline int quant(
double min,
double max,
unsigned nSteps,
double val);
27 static inline double unquant(
double min,
double max,
unsigned nSteps,
int step);
29 static inline std::string
to_string(std::vector<T>
v);
30 static inline std::string instance_name(std::string
const &
s);
40 m_monitorFile((
m_name +
".root").c_str(),
"RECREATE")
56 ATH_MSG_INFO(
"Convolution: " << to_string(
const_cast<std::vector<int>&
>(
m_conv.value())));
67 ATH_MSG_FATAL(
"initialize() Image size must be greater than 0");
73 ATH_MSG_FATAL(
"initialize() Hit extentsion list must have size == nLayers");
80 ATH_MSG_FATAL(
"initialize() The imagesize is not divisible by scale");
84 if (!ok)
return StatusCode::FAILURE;
88 ATH_MSG_WARNING(
"initialize() localMaxWindowSize requires tracing hits, turning on automatically");
94 ATH_MSG_WARNING(
"initialize() idealGeoRoads conflicts with useSectors, switching off FPGATrackSim sector matching");
99 ATH_MSG_WARNING(
"initialize() idealGeoRoads requires tracing hits, turning on automatically");
127 std::vector<size_t> yBins_scaled;
128 for (
unsigned i = 0;
i <= new_size_y;
i++) {
129 yBins_scaled.push_back(
scale *
i);
135 return StatusCode::SUCCESS;
142 return StatusCode::SUCCESS;
174 return StatusCode::SUCCESS;
183 for (
auto const & hit :
hits) {
185 bool belong1 =
false, belong2 =
false;
186 for (
auto layer : combine_layers) {
187 if (belong1 || belong2)
break;
188 if (hit->getLayer() ==
layer)
190 if (hit->getLayer() ==
layer + 1)
199 else if (
m_stereo && !(hit->getLayer() > 1 && (hit->getLayer() % 2 == 1 && belong2))) {
207 for (
unsigned y_ = 0; y_ < new_size_y; y_++) {
214 for (
int y = y_bin_min;
y < y_bin_max;
y++) {
235 if (layerImage(
y,
x).
first > 0) {
284 if (
i == 0 && j == 0)
continue;
290 && j <= 0 &&
i <= 0)
return false;
303 static inline int quant(
double min,
double max,
unsigned nSteps,
double val)
309 static inline double unquant(
double min,
double max,
unsigned nSteps,
int step)
314 template <
typename T>
315 static inline std::string
to_string(std::vector<T>
v)
317 std::ostringstream oss;
320 std::copy(
v.begin(),
v.end()-1, std::ostream_iterator<T>(oss,
", "));
327 static inline std::string instance_name(std::string
const &
s)
329 size_t pos =
s.find_last_of(
'.');
330 if (
pos != std::string::npos)
331 return s.substr(
pos + 1);
340 double r = hit->
getR();
341 double phi_hit = hit->
getGPhi();
345 ATH_MSG_ERROR(
"yToX() not defined for the current m_par selection");
358 if (x_min > x_max)
std::swap(x_min, x_max);
371 if (x_bin_min < 0) x_bin_min = 0;
374 return { x_bin_min, x_bin_max };
379 float pt =
r.getY()*0.001;
384 if (sectorbin < 0) sectorbin = 0;
386 std::vector<module_t> modules;
388 for (
unsigned int il = 0;
il <
r.getNLayers();
il++) {
389 if (
r.getNHits_layer()[
il] == 0) {
390 modules.push_back(-1);
392 wc_layers |= (0x1 <<
il);
393 r.setWCLayers(wc_layers);
395 std::unique_ptr<FPGATrackSimHit> wcHit = std::unique_ptr<FPGATrackSimHit>(
new FPGATrackSimHit());
399 r.setHits(
il,std::vector<std::shared_ptr<const FPGATrackSimHit>>({std::move(wcHit)}));
403 modules.push_back(sectorbin);
412 std::vector<std::shared_ptr<const FPGATrackSimHit>> road_hits;
414 for (
const auto &hit :
hits) {
415 road_hits.push_back(hit);
416 hitLayers |= 1 << hit->getLayer();
426 r.setHitLayers(hitLayers);
427 r.setHits(std::move(sorted_hits));
442 r.setHitLayers(hitLayers);
443 r.setHits(std::move(
hits));
456 for (
auto const & hit :
hits) {
457 hitLayers |= 1 << hit->getLayer();
469 std::vector<std::shared_ptr<const FPGATrackSimHit>> road_hits;
471 for (
const auto &hit :
hits) {
475 unsigned bin_scale = 0;
478 if (hit->getLayer() ==
layer) {
483 if (bin_scale == 0) bin_scale = 1;
484 unsigned y_bin_min = floor(1.0 *
y / bin_scale) * bin_scale;
485 unsigned y_bin_max = ceil(1.0 *
y / bin_scale) * bin_scale;
486 if (y_bin_min == y_bin_max) y_bin_max++;
491 if (
x >=
xBins.first && x < xBins.second && y >= y_bin_min &&
y < y_bin_max) {
492 road_hits.push_back(hit);
493 hitLayers |= 1 << hit->getLayer();
509 TH2I
h(
name.c_str(),
"Hough Transform;phi;d0 (mm)",