18 return StatusCode::SUCCESS;
32 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);
44 seeds->
reserve(trackOutput->size());
46 for(
unsigned int i = 3; i < trackOutput->size(); i++)
55 std::vector<const xAOD::SpacePoint*> spacePointsToStoreInSeed;
58 unsigned int hitsInTrack = 0;
66 float x =
r * std::cos(
phi);
67 float y =
r * std::sin(
phi);
69 isLast = Ghit_w1.last;
72 auto identifierHashW2 = Ghit_w2.cluster1;
75 auto range = spacePointMap.equal_range(identifierHashW2);
76 for (
auto it = range.first; it != range.second; ++it) {
77 constexpr float kEpsilon = 0.1;
79 if (std::abs(
x - spacePoint->
x()) < kEpsilon &&
80 std::abs(
y - spacePoint->
y()) < kEpsilon&&
81 std::abs(
z - spacePoint->
z()) < kEpsilon) {
82 spacePointsToStoreInSeed.push_back(spacePoint);
89 if(hitsInTrack != spacePointsToStoreInSeed.size())
91 ATH_MSG_WARNING(
"Track does not have the same number of hits in the output as the seed container hitsInTrack: "<<hitsInTrack<<
" spacePointsToStoreInSeed: "<<spacePointsToStoreInSeed.size());
97 const float quality = (chiSquare != 0.0) ? 1.0 / chiSquare : 0.0;
99 seeds->
push_back(spacePointsToStoreInSeed, quality, vertexZ);
108 return StatusCode::SUCCESS;
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Exception-safe IChronoSvc caller.
StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< size_t > m_minSpacePointsPerSeed
SG::ReadHandleKey< xAOD::SpacePointContainer > m_spacePointContainerKey
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGATrackOutput
Gaudi::Property< size_t > m_maxSpacePointsPerSeed
SG::WriteHandleKey< ActsTrk::SeedContainer > m_seedKey
virtual StatusCode initialize() override
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
The class for enconding RDO to FPGA format.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Seed push_back(SpacePointRange spacePoints, float quality, float vertexZ)
void reserve(std::size_t size, float averageSpacePoints=3) noexcept
std::size_t size() const noexcept