40 declareInterface<IFPGATrackSimRoadFilterTool>(
this);
55 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
76 throw (
"FPGATrackSimEtaPatternFilterTool couldn't open " + filepath);
84 if (
line.empty() ||
line[0] ==
'#')
continue;
85 std::istringstream sline(
line);
93 ok = ok && (sline >> tech >>
zone >>
mod);
105 throw "FPGATrackSimEtaPatternFilterTool read error";
121 for (
unsigned lyr = 0; lyr <
m_nLayers; lyr++)
131 return StatusCode::SUCCESS;
141 postfilter_roads.clear();
142 for (
auto & road : prefilter_roads)
152 std::set<EtaPattern> usedPatterns;
159 for (
unsigned working_threshold =
m_nLayers; working_threshold >=
m_threshold; working_threshold--)
163 unsigned nLayers = __builtin_popcount(patt_bitmask.second);
164 if (nLayers >= working_threshold)
168 for (
unsigned lyr = 0; lyr <
m_nLayers; lyr++)
169 if (!(patt_bitmask.second & (1 << lyr)))
173 if (usedPatterns.count(subpatt) > 0)
continue;
199 postfilter_roads.push_back(&
r);
200 return StatusCode::SUCCESS;
208 for (
unsigned lyr = 0; lyr <
m_nLayers; lyr++)
210 entry.second.reset();
215 for (
unsigned lyr = 0; lyr <
m_nLayers; lyr++)
216 for (
auto & hit :
r->getHits(lyr))
219 ModuleId mod = { hit->getDetType(), hit->getDetectorZone(), (
int)(hit->getEtaModule()) };
222 itr->second.addHit(hit);
224 ATH_MSG_ERROR(
"Module not in map: " << hit->getDetType() <<
" " << hit->getDetectorZone() <<
" " <<
static_cast<int>(hit->getEtaModule()) );
227 ATH_MSG_ERROR(
" " << itr2.first.siTech <<
" " << itr2.first.zone <<
" " << itr2.first.etaModule);
237 usedPatterns.insert(currPatt);
239 std::vector<unsigned> allowmissing(nExtra, 0);
244 for (
auto h : allowmissing)
246 usedPatterns.insert(subpatt);
249 done = (nExtra == 0);
250 for (
unsigned i = 0;
i < nExtra;
i++)
256 done = (
i==nExtra-1);
271 r.setHitLayers(patt.second);
272 r.setEtaPatternID(etaPatternID);
273 for (
unsigned lyr = 0; lyr <
m_nLayers; lyr++) {
275 if (
r.getNHits_layer().at(lyr) == 0) {
280 r.setHits(lyr, std::vector<const FPGATrackSimHit*>{wcHit});
290 r.setSectorBin(sectorbin);
291 std::vector<module_t> modules;
292 for (
unsigned int il = 0;
il <
r.getNLayers();
il++) {
293 if (
r.getNHits_layer()[
il] == 0) {
294 modules.push_back(-1);
296 modules.push_back(sectorbin);
311 std::ostringstream oss;
315 std::copy(
v.begin(),
v.end()-1, std::ostream_iterator<unsigned>(oss,
", "));
324 std::ostringstream oss;
326 for (
auto mod : patt) {
328 oss <<
mod.siTech <<
", " <<
mod.zone <<
", " <<
mod.etaModule;
337 std::ostringstream oss;