|
ATLAS Offline Software
|
Go to the documentation of this file.
21 using namespace asg::msgUserCode;
34 ifstream
fin(filepath);
38 throw (
"FPGATrackSimRegionMap Couldn't open " + filepath);
52 string line, towerKey;
58 istringstream sline(
line);
60 ok = ok && (towerKey ==
"towers");
84 if (
line.empty() ||
line[0] ==
'#')
continue;
85 istringstream sline(
line);
89 ok = ok && (sline >> region);
90 ok = ok && !(sline >>
dummy);
91 ok = ok && (region == expected_region);
96 int isPix{},
BEC{}, physLayer{}, phi_min{}, phi_max{}, phi_tot{}, eta_min{}, eta_max{}, eta_tot{};
98 ok = ok && (sline >>
isPix >>
BEC >> physLayer >> phi_min >> phi_max >> phi_tot >> eta_min >> eta_max >> eta_tot);
105 m_map[region][logiLayer][
section] = { phi_min, phi_max, eta_min, eta_max };
114 throw "FPGATrackSimRegionMap read error";
123 ifstream
fin(filepath);
127 throw (
"FPGATrackSimRegionMap Couldn't open " + filepath);
137 istringstream sline(
line);
139 if (!(sline >> region >>
layer >> globalID >> localID))
157 std::ifstream
fin(filepath);
171 if (
line.empty() ||
line[0] ==
'#')
continue;
172 std::istringstream sline(
line);
173 std::vector<int> shifts;
176 ok = ok && (sline >> subregion);
190 ok = ok && (sline >>
r);
193 ANA_MSG_WARNING(
"Radius in radiiFile is "<<
r <<
" for layer: " <<
layer <<
" setting to dummy value!");
196 if (subregion == -1) {
231 if ( region >=
m_map.size()
241 if (eta < eta_min || eta > eta_max)
return false;
247 if (phi_min <= phi_max)
249 if (phi < phi_min || phi > phi_max)
return false;
253 if (phi < phi_min && phi > phi_max)
return false;
261 std::vector<uint32_t> regions;
264 regions.push_back(region);
290 int err[] = {1,1,1,1,1,1};
292 if (region >=
m_map.size()) anyerr =
err[1] = 2;
302 if (
eta < eta_min)
err[4] = 3;
303 if (
eta > eta_max)
err[4] = 2;
309 if (phi_min <= phi_max)
311 if (phi < phi_min || phi > phi_max)
err[5] = 2;
315 if (phi < phi_min && phi > phi_max)
err[5] = 3;
330 return globalModuleID & 0x3ff;
343 if (g_l.second == localModuleID)
return g_l.first;
345 ANA_MSG_ERROR(
"getGlobalID() Did not find global id for region " << region <<
", layer " <<
layer <<
", localID " << localModuleID);
unsigned getSection() const
unsigned getPhiModule() const
std::vector< std::vector< std::map< uint32_t, uint32_t > > > m_global_local_map
uint32_t getNSections(size_t logiLayer) const
uint32_t getNLogiLayers() const
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
unsigned getPairedSection() const
unsigned getLayer() const
unsigned getPairedLayer() const
const LayerSection & getLayerSection(SiliconTech siTech, DetectorZone zone, uint32_t physLayer) const
void readRegion(std::ifstream &fin, int expected_region)
Maps ITK module indices to FPGATrackSim regions.
int getPairedEtaModule() const
FPGATrackSimRegionMap(FPGATrackSimPlaneMap const *pmap, std::string const &filepath)
uint32_t getGlobalID(uint32_t region, uint32_t layer, uint32_t localModuleID) const
uint32_t getLocalID(uint32_t region, uint32_t layer, uint32_t globalModuleID) const
unsigned getPairedPhiModule() const
bool isInRegion(uint32_t region, const FPGATrackSimHit &hit) const
std::vector< uint32_t > getRegions(const FPGATrackSimHit &hit) const
const FPGATrackSimPlaneMap * m_pmap
void loadModuleIDLUT(std::string const &filepath)
std::vector< std::vector< std::vector< FPGATrackSimRegionBoundaries > > > m_map
uint32_t getUnmappedID(uint32_t region, const FPGATrackSimHit &hit) const
std::vector< std::vector< double > > m_radii_map
uint32_t getNDetLayers() const
void allocateMap(std::ifstream &fin)
void loadRadiiFile(std::string const &radii_file)
HitType getHitType() const
double getAvgRadius(unsigned region, unsigned layer) const