|
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;
159 return StatusCode::SUCCESS;
166 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 };
372 double qoverpt =
r.getY()*0.001;
374 qoverpt = abs(qoverpt);
381 auto bounds = std::equal_range(qoverpt_bins.begin(), qoverpt_bins.end(), qoverpt);
385 if (sectorbin < 0) sectorbin = 0;
386 if ((sectorbin / 10) >
static_cast<int>(qoverpt_bins.size() - 2))sectorbin = 10*(qoverpt_bins.size() - 2);
389 int subregion =
r.getSubRegion();
392 std::vector<module_t> modules;
393 for (
unsigned int il = 0;
il <
r.getNLayers();
il++) {
394 if (
r.getNHits_layer()[
il] == 0) {
395 modules.push_back(-1);
398 wc_layers |= (0x1 <<
il);
399 r.setWCLayers(wc_layers);
401 std::shared_ptr<FPGATrackSimHit> wcHit = std::make_shared<FPGATrackSimHit>();
405 std::vector<std::shared_ptr<const FPGATrackSimHit>> wcHits;
406 wcHits.emplace_back(std::move(wcHit));
407 r.setHits(
il,std::move(wcHits));
410 modules.push_back(sectorbin);
422 r.setSectorBin(sectorbin);
436 r.setHits( std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>(
hits));
446 r.setHitLayers(hitLayers);
458 for (
auto const & hit :
hits)
459 hitLayers |= 1 << hit->getLayer();
471 std::vector<std::shared_ptr<const FPGATrackSimHit>> road_hits;
473 for (
const auto & hit :
hits)
479 unsigned int y_bin_max = y_bin_min +
m_binScale[hit->getLayer()];
485 road_hits.push_back(hit);
486 hitLayers |= 1 << hit->getLayer();
constexpr int SUBREGION_SECTOR_OFFSET
std::string find(const std::string &s)
return a remapped string
Maps physical layers to logical layers.
unsigned getLayer() const
const std::vector< double > & getQOverPtBins() const
Maps ITK module indices to FPGATrackSim regions.
void setDetType(SiliconTech detType)
sector_t findSector(std::vector< module_t > const &modules) const
::StatusCode StatusCode
StatusCode definition for legacy code.
double fieldCorrection(unsigned region, double qpt, double r)
constexpr int QPT_SECTOR_OFFSET
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 &)
void setLayer(unsigned v)
#define ATH_MSG_WARNING(x)
bool isAbsQOverPtBinning() const
This file declares a class that stores the module IDs of the sectors.
void setHitType(HitType type)
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)