![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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(std::vector<T>
v);
30 static inline std::string instance_name(std::string
const &
s);
39 m_name(instance_name(
name)),
40 m_monitorFile((m_name +
".root").c_str(),
"RECREATE")
42 declareInterface<IFPGATrackSimRoadFinderTool>(
this);
57 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");
81 ATH_MSG_FATAL(
"initialize() The imagesize is not divisible by scale");
85 if (!ok)
return StatusCode::FAILURE;
89 ATH_MSG_WARNING(
"initialize() localMaxWindowSize requires tracing hits, turning on automatically");
95 ATH_MSG_WARNING(
"initialize() idealGeoRoads conflicts with useSectors, switching off FPGATrackSim sector matching");
100 ATH_MSG_WARNING(
"initialize() idealGeoRoads requires tracing hits, turning on automatically");
128 std::vector<size_t> yBins_scaled;
129 for (
unsigned i = 0;
i <= new_size_y;
i++) {
130 yBins_scaled.push_back(
scale *
i);
136 return StatusCode::SUCCESS;
143 return StatusCode::SUCCESS;
175 return StatusCode::SUCCESS;
186 bool belong1 =
false, belong2 =
false;
187 for (
auto layer : combine_layers) {
188 if (belong1 || belong2)
break;
189 if (hit->getLayer() ==
layer)
191 if (hit->getLayer() ==
layer + 1)
200 else if (
m_stereo && !(hit->getLayer() > 1 && (hit->getLayer() % 2 == 1 && belong2))) {
208 for (
unsigned y_ = 0; y_ < new_size_y; y_++) {
215 for (
int y = y_bin_min;
y < y_bin_max;
y++) {
236 if (layerImage(
y,
x).
first > 0) {
285 if (
i == 0 && j == 0)
continue;
291 && j <= 0 &&
i <= 0)
return false;
304 static inline int quant(
double min,
double max,
unsigned nSteps,
double val)
310 static inline double unquant(
double min,
double max,
unsigned nSteps,
int step)
315 template <
typename T>
316 static inline std::string
to_string(std::vector<T>
v)
318 std::ostringstream oss;
321 std::copy(
v.begin(),
v.end()-1, std::ostream_iterator<T>(oss,
", "));
328 static inline std::string instance_name(std::string
const &
s)
330 size_t pos =
s.find_last_of(
'.');
331 if (
pos != std::string::npos)
332 return s.substr(
pos + 1);
341 double r = hit->
getR();
342 double phi_hit = hit->
getGPhi();
346 ATH_MSG_ERROR(
"yToX() not defined for the current m_par selection");
359 if (x_min > x_max)
std::swap(x_min, x_max);
372 if (x_bin_min < 0) x_bin_min = 0;
375 return { x_bin_min, x_bin_max };
380 float pt =
r.getY()*0.001;
385 if (sectorbin < 0) sectorbin = 0;
387 std::vector<module_t> modules;
389 for (
unsigned int il = 0;
il <
r.getNLayers();
il++) {
390 if (
r.getNHits_layer()[
il] == 0) {
391 modules.push_back(-1);
393 wc_layers |= (0x1 <<
il);
394 r.setWCLayers(wc_layers);
396 std::unique_ptr<FPGATrackSimHit> wcHit = std::unique_ptr<FPGATrackSimHit>(
new FPGATrackSimHit());
400 r.setHits(
il,std::vector<const FPGATrackSimHit*>({wcHit.get()}));
404 modules.push_back(sectorbin);
413 std::vector<const FPGATrackSimHit*> road_hits;
416 road_hits.push_back(hit);
417 hitLayers |= 1 << hit->getLayer();
427 r.setHitLayers(hitLayers);
428 r.setHits(sorted_hits);
443 r.setHitLayers(hitLayers);
458 hitLayers |= 1 << hit->getLayer();
470 std::vector<FPGATrackSimHit const *> road_hits;
476 unsigned bin_scale = 0;
479 if (hit->getLayer() ==
layer) {
484 if (bin_scale == 0) bin_scale = 1;
485 unsigned y_bin_min = floor(1.0 *
y / bin_scale) * bin_scale;
486 unsigned y_bin_max = ceil(1.0 *
y / bin_scale) * bin_scale;
487 if (y_bin_min == y_bin_max) y_bin_max++;
492 if (
x >=
xBins.first && x < xBins.second && y >= y_bin_min &&
y < y_bin_max) {
493 road_hits.push_back(hit);
494 hitLayers |= 1 << hit->getLayer();
510 TH2I h(
name.c_str(),
"Hough Transform;phi;d0 (mm)",
constexpr std::array< double, 5 > QOVERPT_BINS
Maps physical layers to logical layers.
unsigned getLayer() 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.
std::vector< std::vector< const FPGATrackSimHit * > > sortByLayer(Container const &hits)
std::string to_string(const DetectorType &type)
: FPGATrackSim-specific class to represent an hit in the detector.
void setLayer(unsigned v)
#define ATH_MSG_WARNING(x)
This file declares a class that stores the module IDs of the sectors.
void setHitType(HitType type)