18 return StatusCode::SUCCESS;
31 ATH_CHECK(seedHandle.record(std::make_unique<ActsTrk::SeedContainer>()));
35 std::multimap<xAOD::DetectorIDHashType, const xAOD::SpacePoint*> spacePointMap;
39 if (!spacePoint->measurements().empty()) {
40 spacePointMap.emplace(spacePoint->measurements().at(0)->identifierHash(), spacePoint);
45 for (
const auto&
track : *tracksHandle) {
46 std::vector<const FPGATrackSimHit*> hitsToStoreInSeed;
47 std::vector<const xAOD::SpacePoint*> spacePointsToStoreInSeed;
49 if (hit.isReal() && hit.isPixel()) {
50 ATH_MSG_DEBUG(
"Hit coordinates in module " << hit.getIdentifierHash() <<
": (" << hit.getPhiCoord() <<
", " << hit.getEtaCoord() <<
")");
52 auto range = spacePointMap.equal_range(hit.getIdentifierHash());
54 constexpr
float kEpsilon = std::numeric_limits<float>::epsilon();
55 if (std::abs(hit.getPhiCoord() -
it->second->measurements().at(0)->localPosition<2>()[0]) < kEpsilon &&
56 std::abs(hit.getEtaCoord() -
it->second->measurements().at(0)->localPosition<2>()[1]) < kEpsilon) {
57 spacePointsToStoreInSeed.push_back(
it->second);
63 ATH_MSG_DEBUG(
"SpacePoint coordinates: (" <<
it->second->measurements().at(0)->localPosition<2>()[0] <<
", " <<
it->second->measurements().at(0)->localPosition<2>()[1] <<
")");
71 std::unique_ptr<ActsTrk::ActsSeed<xAOD::SpacePoint>> seed = std::make_unique<ActsTrk::ActsSeed<xAOD::SpacePoint>>(spacePointsToStoreInSeed);
72 seed->setVertexZ(
track.getZ0());
73 if (
track.getChi2ndof() != 0.0) {
74 seed->setQuality(1.0 /
track.getChi2ndof());
76 seed->setQuality(0.0);
83 return StatusCode::SUCCESS;