|
ATLAS Offline Software
|
Go to the documentation of this file.
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(
const std::vector<T> &
v);
37 declareInterface<IFPGATrackSimRoadFinderTool>(
this);
56 ATH_MSG_INFO(
"Convolution: " << to_string(
const_cast<std::vector<int>&
>(
m_conv.value())));
68 ATH_MSG_FATAL(
"initialize() Image size must be greater than 0");
74 ATH_MSG_FATAL(
"initialize() Hit extentsion list must have size % nLayers");
76 ATH_MSG_FATAL(
"initialize() Combine layers list must have size = nLayers");
80 ATH_MSG_FATAL(
"initialize() Bin scale list must have size = nLayers");
81 else if (std::any_of(
m_binScale.begin(),
m_binScale.end(), [&](
unsigned i){ return m_imageSize_y % i != 0; }))
82 ATH_MSG_FATAL(
"initialize() The imagesize is not divisible by scale");
85 if (!ok)
return StatusCode::FAILURE;
90 ATH_MSG_WARNING(
"initialize() localMaxWindowSize requires tracing hits, turning on automatically");
97 ATH_MSG_WARNING(
"initialize() idealGeoRoads conflicts with useSectors, switching off FPGATrackSim sector matching");
102 ATH_MSG_WARNING(
"initialize() idealGeoRoads requires tracing hits, turning on automatically");
131 return StatusCode::SUCCESS;
166 return StatusCode::SUCCESS;
173 for (
auto const & hit :
hits)
181 for (
unsigned y_ = 0; y_ < new_size_y; y_++)
183 unsigned y_bin_min =
scale * y_;
184 unsigned y_bin_max =
scale * (y_ + 1);
190 for (
unsigned y = y_bin_min;
y < y_bin_max;
y++)
211 if (layerImage(
y,
x).
first > 0)
256 if (
i == 0 && j == 0)
continue;
275 static inline int quant(
double min,
double max,
unsigned nSteps,
double val)
281 static inline double unquant(
double min,
double max,
unsigned nSteps,
int step)
286 template <
typename T>
287 static inline std::string
to_string(
const std::vector<T> &
v)
289 std::ostringstream oss;
293 std::copy(
v.begin(),
v.end()-1, std::ostream_iterator<T>(oss,
", "));
306 double r = hit->
getR();
307 double phi_hit = hit->
getGPhi();
309 x = asin(
r * fpgatracksim::A *
y -
d0 /
r) + phi_hit;
315 ATH_MSG_ERROR(
"yToX() not defined for the current m_par selection");
328 if (x_min > x_max)
std::swap(x_min, x_max);
342 if (x_bin_min < 0) x_bin_min = 0;
345 return { x_bin_min, x_bin_max };
370 r.setHits( std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>(
hits));
380 r.setHitLayers(hitLayers);
389 for (
auto const & hit :
hits)
390 hitLayers |= 1 << hit->getLayer();
402 std::vector<std::shared_ptr<const FPGATrackSimHit>> road_hits;
404 for (
const auto & hit :
hits)
408 unsigned int y_bin_max = y_bin_min +
m_binScale[hit->getLayer()];
414 road_hits.push_back(hit);
415 hitLayers |= 1 << hit->getLayer();
std::string find(const std::string &s)
return a remapped string
Maps physical layers to logical layers.
unsigned getLayer() const
Maps ITK module indices to FPGATrackSim regions.
::StatusCode StatusCode
StatusCode definition for legacy code.
double fieldCorrection(unsigned region, double qpt, double r)
std::string to_string(const DetectorType &type)
: FPGATrackSim-specific class to represent an hit in the detector.
constexpr std::variant< Args..., T > extend(const std::variant< Args... > &, const T &)
#define ATH_MSG_WARNING(x)
This file declares a class that stores the module IDs of the sectors.
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)