 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 using namespace asg::msgUserCode;
33 ifstream
fin(filepath);
37 throw (
"FPGATrackSimRegionMap Couldn't open " + filepath);
45 for (
int region = 0; region <
m_nregions; region++){
57 string line, towerKey;
63 istringstream sline(
line);
65 ok = ok && (towerKey ==
"towers");
69 throw (
"Pmap slice size does not match Rmap:" );
78 for (
int iRegion=0; iRegion<
int(
m_map.size()); iRegion++)
80 m_map.at(iRegion).resize(
m_pmaps.at(0)->getNLogiLayers());
81 for (
size_t l = 0;
l <
m_map.at(iRegion).size();
l++)
m_map.at(iRegion).at(
l).resize(
m_pmaps.at(iRegion)->getNSections(
l));
97 if (
line.empty() ||
line[0] ==
'#')
continue;
98 istringstream sline(
line);
102 ok = ok && (sline >> region);
103 ok = ok && !(sline >>
dummy);
104 ok = ok && (region == expected_region);
109 int isPix{},
BEC{}, physLayer{}, phi_min{}, phi_max{}, phi_tot{}, eta_min{}, eta_max{}, eta_tot{};
111 ok = ok && (sline >>
isPix >>
BEC >> physLayer >> phi_min >> phi_max >> phi_tot >> eta_min >> eta_max >> eta_tot);
118 m_map[region][logiLayer][
section] = { phi_min, phi_max, eta_min, eta_max };
120 if (++linesRead ==
m_pmaps.at(region)->getNDetLayers())
break;
127 throw "FPGATrackSimRegionMap read error";
136 ifstream
fin(filepath);
140 throw (
"FPGATrackSimRegionMap Couldn't open " + filepath);
150 istringstream sline(
line);
152 if (!(sline >> region >>
layer >> globalID >> localID))
165 layer_max = (layer_max == 0) ?
m_pmaps.at(0)->getNLogiLayers() - layer_offset: layer_max - layer_offset;
168 std::ifstream
fin(filepath);
182 if (
line.empty() ||
line[0] ==
'#')
continue;
183 std::istringstream sline(
line);
184 std::vector<int> shifts;
187 ok = ok && (sline >> subregion);
202 ok = ok && (sline >>
r);
204 unsigned eff_layer =
layer + layer_offset;
205 ANA_MSG_DEBUG(
"Reading average radius at effective (actual) layer = " << eff_layer <<
" (" <<
layer <<
") = " <<
r);
207 ANA_MSG_WARNING(
"Radius in radiiFile is "<<
r <<
" for layer: " << eff_layer <<
" setting to dummy value!");
210 if (subregion == -1) {
256 if ( region >=
m_map.size()
266 if (eta < eta_min || eta > eta_max)
return false;
272 if (phi_min <= phi_max)
274 if (phi < phi_min || phi > phi_max)
return false;
278 if (phi < phi_min && phi > phi_max)
return false;
286 std::vector<uint32_t> regions;
289 regions.push_back(region);
316 int err[] = {1,1,1,1,1,1};
318 if (region >=
m_map.size()) anyerr =
err[1] = 2;
328 if (
eta < eta_min)
err[4] = 3;
329 if (
eta > eta_max)
err[4] = 2;
335 if (phi_min <= phi_max)
337 if (phi < phi_min || phi > phi_max)
err[5] = 2;
341 if (phi < phi_min && phi > phi_max)
err[5] = 3;
356 return globalModuleID & 0x3ff;
369 if (g_l.second == localModuleID)
return g_l.first;
371 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
int getEtaModule(bool old=false) const
void loadRadiiFile(std::string const &radii_file, unsigned layer_offset, unsigned layer_max)
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
SiliconTech getPairedDetType() const
void readRegion(std::ifstream &fin, int expected_region)
Maps ITK module indices to FPGATrackSim regions.
def etamod(flags, cells_name, *args, **kw)
int getPairedEtaModule() const
uint32_t getGlobalID(uint32_t region, uint32_t layer, uint32_t localModuleID) const
def phimod(flags, cells_name, *args, **kw)
FPGATrackSimRegionMap(const std::vector< std::unique_ptr< FPGATrackSimPlaneMap >> &pmaps, std::string const &filepath)
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
unsigned getPairedPhysLayer() const
std::vector< uint32_t > getRegions(const FPGATrackSimHit &hit) const
void loadModuleIDLUT(std::string const &filepath)
DetectorZone getDetectorZone() const
std::vector< std::vector< std::vector< FPGATrackSimRegionBoundaries > > > m_map
uint32_t getUnmappedID(uint32_t region, const FPGATrackSimHit &hit) const
DetectorZone getPairedDetZone() const
std::vector< std::vector< double > > m_radii_map
SiliconTech getDetType() const
std::vector< std::unique_ptr< FPGATrackSimPlaneMap > > const & m_pmaps
void allocateMap(std::ifstream &fin)
def ls(path, longls=False)
unsigned getPhysLayer(bool old=false) const
HitType getHitType() const
double getAvgRadius(unsigned region, unsigned layer) const