8#include "Acts/Definitions/Units.hpp"
9#include "Acts/EventData/SeedContainer2.hpp"
10#include "Acts/EventData/SpacePointContainer2.hpp"
11#include "Acts/MagneticField/MagneticFieldContext.hpp"
12#include "Acts/Seeding/BinnedGroup.hpp"
13#include "Acts/Seeding/SeedFilter.hpp"
14#include "Acts/Seeding/SeedFinder.hpp"
29 ISvcLocator* pSvcLocator)
50 return StatusCode::SUCCESS;
56 std::array<std::string, kNStat>{
57 "Spacepoints",
"Seeds"})
59 return StatusCode::SUCCESS;
66 auto time_seedCreation =
79 ATH_CHECK(seedHandle.
record(std::make_unique<ActsTrk::SeedContainer>()));
90 Acts::Vector3 beamPos(beamSpotData->
beamPos().x() * Acts::UnitConstants::mm,
91 beamSpotData->
beamPos().y() * Acts::UnitConstants::mm,
92 beamSpotData->
beamPos().z() * Acts::UnitConstants::mm);
95 <<
" input collections...");
96 std::vector<const xAOD::SpacePointContainer*> allInputCollections;
100 ATH_MSG_DEBUG(
"Retrieving from Input Collection '" << spacePointKey.key()
104 allInputCollections.push_back(spCont);
108 std::size_t totalSpacePoints = 0;
110 totalSpacePoints += collection->size();
113 ATH_MSG_DEBUG(
" \\__ Total input space points: " << totalSpacePoints);
117 if (totalSpacePoints == 0) {
118 ATH_MSG_DEBUG(
"No input space points found, we stop seeding");
119 return StatusCode::SUCCESS;
132 Acts::MagneticFieldContext magFieldContext(fieldCondObj);
134 Acts::MagneticFieldProvider::Cache magFieldCache =
135 magneticField.
makeCache(magFieldContext);
136 Acts::Vector3 bField = *magneticField.
getField(
137 Acts::Vector3(beamPos.x(), beamPos.y(), 0), magFieldCache);
144 time_seedCreation.start();
147 beamPos.cast<
float>(), bField.z(),
149 }
catch (
const std::exception& e) {
150 ATH_MSG_ERROR(
"Exception caught during seed creation: " << e.what());
151 return StatusCode::FAILURE;
153 time_seedCreation.stop();
155 ATH_MSG_DEBUG(
" \\__ Created " << seedPtrs->size() <<
" seeds");
156 m_stat[
kNSeeds] += seedPtrs->size();
158 mon_nSeeds = seedPtrs->size();
160 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
TableUtils::StatTable< T > makeTable(const std::array< T, N > &counter, const std::array< std::string, N > &label)
Acts::Result< Acts::Vector3 > getField(const Acts::Vector3 &position, Acts::MagneticFieldProvider::Cache &gcache) const override
MagneticFieldProvider::Cache makeCache(const Acts::MagneticFieldContext &mctx) const override
SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey
GridTripletSeedingAlg(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< ActsTrk::ISeedingTool > m_seedsTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Gaudi::Property< bool > m_fastTracking
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override
virtual StatusCode finalize() override
SG::WriteHandleKey< ActsTrk::SeedContainer > m_seedKey
ToolHandle< GenericMonitoringTool > m_monTool
An algorithm that can be simultaneously executed in multiple threads.
size_type size() const noexcept
Returns the number of elements in the collection.
const Amg::Vector3D & beamPos() const noexcept
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SpacePointContainer_v1 SpacePointContainer
Define the version of the space point container.