Skip to content
Snippets Groups Projects

Add R4 version of MDT hough transform

Files
2
@@ -68,13 +68,11 @@ StatusCode MuonHoughTransformAlg::execute(const EventContext& ctx) const {
ATH_CHECK(prepareHoughPlane(data));
/// now perform the actual HT for each station
for (auto&[stationId, stationHough] : data.houghSpaces){
ATH_CHECK(processStationHough(data, stationHough));
ATH_CHECK(processStationHough(data, stationHough));
/// write the maxima we found
writeMaxima->emplace(StationHoughMaxima(stationId, stationHough.maxima));
}
// write the maxima we found
for (auto & [station, foundMax] : data.maxima){
writeMaxima->emplace(StationHoughMaxima(station,foundMax));
}
return StatusCode::SUCCESS;
}
@@ -174,23 +172,19 @@ StatusCode MuonHoughTransformAlg::execute(const EventContext& ctx) const {
}
auto max = data.peakFinder->findPeaks(*(data.houghPlane), data.currAxisRanges);
if (max.size() > 0) writeMaxima(station, data, max);
return StatusCode::SUCCESS;
}
void MuonHoughTransformAlg::writeMaxima(const StationIdentifier & station, MuonHoughEventData & data, const std::vector<ActsPeakFinderForMuon::Maximum> & maxima) const{
auto [ iter, added] = data.maxima.emplace(station, std::vector<MuonR4::HoughMaximum>{});
iter->second.reserve(maxima.size());
for (const auto & max : maxima){
auto maxima = data.peakFinder->findPeaks(*(data.houghPlane), data.currAxisRanges);
if (maxima.empty()) {
return StatusCode::SUCCESS;
}
for (const auto & max : maxima) {
/// TODO: Proper weighted hit counting...
std::vector<const xAOD::UncalibratedMeasurement*> hitList;
hitList.insert(hitList.end(), max.hitIdentifiers.begin(), max.hitIdentifiers.end());
iter->second.emplace_back(max.x, max.y, hitList.size(), std::move(hitList));
currentStation.maxima.emplace_back(max.x, max.y, hitList.size(), std::move(hitList));
}
}
return StatusCode::SUCCESS;
}
void MuonHoughTransformAlg::fillFromDriftCircle(MuonHoughEventData & data, const xAOD::MdtDriftCircle* driftCircle) const{
data.houghPlane->fill<xAOD::MdtDriftCircle>(*driftCircle,
Loading