 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 using namespace asg::msgUserCode;
31 m_inclusive(inclusive)
35 ANA_MSG_INFO(
"Region map set to inclusive mode; will always treat hits as being in region");
46 ifstream
fin(filepath);
50 throw (
"FPGATrackSimRegionMap Couldn't open " + filepath);
58 for (
int region = 0; region <
m_nregions; region++){
70 string line, towerKey;
76 istringstream sline(
line);
78 ok = ok && (towerKey ==
"towers");
82 throw (
"Pmap slice size does not match Rmap:" );
91 for (
int iRegion=0; iRegion<
int(
m_map.size()); iRegion++)
93 m_map.at(iRegion).resize(
m_pmaps.at(0)->getNLogiLayers());
94 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));
110 if (
line.empty() ||
line[0] ==
'#')
continue;
111 istringstream sline(
line);
115 ok = ok && (sline >> region);
116 ok = ok && !(sline >>
dummy);
117 ok = ok && (region == expected_region);
122 int isPix{},
BEC{}, physLayer{}, phi_min{}, phi_max{}, phi_tot{}, eta_min{}, eta_max{}, eta_tot{};
124 ok = ok && (sline >>
isPix >>
BEC >> physLayer >> phi_min >> phi_max >> phi_tot >> eta_min >> eta_max >> eta_tot);
131 m_map[region][logiLayer][
section] = { phi_min, phi_max, eta_min, eta_max };
133 if (++linesRead ==
m_pmaps.at(region)->getNDetLayers())
break;
140 throw "FPGATrackSimRegionMap read error";
149 ifstream
fin(filepath);
153 throw (
"FPGATrackSimRegionMap Couldn't open " + filepath);
163 istringstream sline(
line);
165 if (!(sline >> region >>
layer >> globalID >> localID))
179 layer_max = (layer_max == 0) ?
m_pmaps.at(0)->getNLogiLayers() - layer_offset: layer_max - layer_offset;
182 std::ifstream
fin(filepath);
196 if (
line.empty() ||
line[0] ==
'#')
continue;
197 std::istringstream sline(
line);
198 std::vector<int> shifts;
201 ok = ok && (sline >> subregion);
216 ok = ok && (sline >>
r);
218 unsigned eff_layer =
layer + layer_offset;
219 ANA_MSG_DEBUG(
"Reading average radius at effective (actual) layer = " << eff_layer <<
" (" <<
layer <<
") = " <<
r);
221 ANA_MSG_WARNING(
"Radius in radiiFile is "<<
r <<
" for layer: " << eff_layer <<
" setting to dummy value!");
224 if (subregion == -1) {
262 if (
ls.layer<0)
return false;
277 if ( region >=
m_map.size()
287 if (eta < eta_min || eta > eta_max)
return false;
293 if (phi_min <= phi_max)
295 if (phi < phi_min || phi > phi_max)
return false;
299 if (phi < phi_min && phi > phi_max)
return false;
307 std::vector<uint32_t> regions;
310 regions.push_back(region);
337 int err[] = {1,1,1,1,1,1};
339 if (region >=
m_map.size()) anyerr =
err[1] = 2;
349 if (
eta < eta_min)
err[4] = 3;
350 if (
eta > eta_max)
err[4] = 2;
356 if (phi_min <= phi_max)
358 if (phi < phi_min || phi > phi_max)
err[5] = 2;
362 if (phi < phi_min && phi > phi_max)
err[5] = 3;
377 return globalModuleID & 0x3ff;
390 if (g_l.second == localModuleID)
return g_l.first;
392 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
FPGATrackSimRegionMap(const std::vector< std::unique_ptr< FPGATrackSimPlaneMap >> &pmaps, std::string const &filepath, bool m_inclusive)
uint32_t getGlobalID(uint32_t region, uint32_t layer, uint32_t localModuleID) const
def phimod(flags, cells_name, *args, **kw)
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