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"
27 ISvcLocator* pSvcLocator)
48 return StatusCode::SUCCESS;
54 std::array<std::string, kNStat>{
55 "Spacepoints",
"Seeds"})
57 return StatusCode::SUCCESS;
64 auto time_seedCreation =
77 ATH_CHECK(seedHandle.
record(std::make_unique<ActsTrk::SeedContainer>()));
88 Acts::Vector3 beamPos(beamSpotData->
beamPos().x() * Acts::UnitConstants::mm,
89 beamSpotData->
beamPos().y() * Acts::UnitConstants::mm,
90 beamSpotData->
beamPos().z() * Acts::UnitConstants::mm);
93 <<
" input collections...");
94 std::vector<const xAOD::SpacePointContainer*> allInputCollections;
98 ATH_MSG_DEBUG(
"Retrieving from Input Collection '" << spacePointKey.key()
102 allInputCollections.push_back(spCont);
106 std::size_t totalSpacePoints = 0;
108 totalSpacePoints += collection->size();
111 ATH_MSG_DEBUG(
" \\__ Total input space points: " << totalSpacePoints);
115 if (totalSpacePoints == 0) {
116 ATH_MSG_DEBUG(
"No input space points found, we stop seeding");
117 return StatusCode::SUCCESS;
130 Acts::MagneticFieldContext magFieldContext(fieldCondObj);
132 Acts::MagneticFieldProvider::Cache magFieldCache =
133 magneticField.
makeCache(magFieldContext);
134 Acts::Vector3 bField = *magneticField.
getField(
135 Acts::Vector3(beamPos.x(), beamPos.y(), 0), magFieldCache);
142 time_seedCreation.start();
145 beamPos.cast<
float>(), bField.z(),
147 }
catch (
const std::exception& e) {
148 ATH_MSG_ERROR(
"Exception caught during seed creation: " << e.what());
149 return StatusCode::FAILURE;
151 time_seedCreation.stop();
156 mon_nSeeds = seedPtrs->
size();
158 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
GenericSeedingAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
virtual StatusCode finalize() override
SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey
SG::WriteHandleKey< ActsTrk::SeedContainer > m_seedKey
ToolHandle< GenericMonitoringTool > m_monTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< bool > m_fastTracking
ToolHandle< ActsTrk::ISeedingTool > m_seedsTool
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.
std::size_t size() const noexcept