ATLAS Offline Software
Loading...
Searching...
No Matches
ITkPixelDecodingTracccCellAlg Class Reference

ITk Pixel byte stream CPU decoding alg for Traccc EDM This algorithm converts the Pixel byte streams into Traccc cells, used by GPU track reconstruction. More...

#include <ITkPixelDecodingTracccCellAlg.h>

Inheritance diagram for ITkPixelDecodingTracccCellAlg:
Collaboration diagram for ITkPixelDecodingTracccCellAlg:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

StatusCode moduleIdToDetrayIndex (uint32_t module_id, uint32_t &detray_index) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< ITkPixelDecodingTool > m_decodingTool
SG::WriteHandleKey< traccc::edm::silicon_cell_collection::buffer > m_tracccCellsKey {this, "TracccCells", "TracccCells", "Output traccc cell collection"}
ToolHandle< AthDevice::IMemoryResourcesTool > m_mrTool
ToolHandle< AthDevice::ICopiesTool > m_copiesTool
Gaudi::Property< std::string > m_geoIdMappingObjectName
const ActsTrk::GeometryIdMapping * m_geoIdMapping {nullptr}
const Gaudi::Property< uint32_t > m_n_rdos_est
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

ITk Pixel byte stream CPU decoding alg for Traccc EDM This algorithm converts the Pixel byte streams into Traccc cells, used by GPU track reconstruction.

The conversion is done on CPU, using itksw Endec, and the cells are then copied to GPU memory. The final container is register in StoreGate and only contains the cells corresponding to the Pixel hits.

Author
Fabrice Le Goff

Definition at line 26 of file ITkPixelDecodingTracccCellAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode ITkPixelDecodingTracccCellAlg::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 29 of file ITkPixelDecodingTracccCellAlg.cxx.

30{
31 // ---- Create host-resident cell container
32 auto & host_mr = *m_mrTool->hostMR();
33 traccc::edm::silicon_cell_collection::host traccc_cells_host{host_mr};
34 traccc_cells_host.reserve(m_n_rdos_est);
35
36 std::vector<uint64_t> bytestream_data;
37 std::vector<ITkPixelDecodingStreamInfo> streams_info;
38 try {
39 ATH_CHECK(m_decodingTool->aggregateData(ctx, bytestream_data, streams_info,
40 std::function<StatusCode (uint32_t, uint32_t&)>{
41 [this](uint32_t module_id, uint32_t& detray_index) {
42 return moduleIdToDetrayIndex(module_id, detray_index);
43 }}));
44 } catch (std::runtime_error const & exc) {
45 ATH_MSG_ERROR("aggregateData error: " << exc.what());
46 return StatusCode::FAILURE;
47 }
48
49 ITkPixelDecodingCallback::TracccCellCallback cb(msg(), traccc_cells_host);
50 ATH_CHECK(m_decodingTool->decodeData(bytestream_data, streams_info, cb));
51
52 // ---- The host-resident traccc cell collection is ready: upload cells to
53 // the GPU and register the resulting GPU-resident container to StoreGate
54 auto device_copy = m_copiesTool->deviceCopy(ctx);
55
56 auto traccc_cells_gpu_buffer = std::make_unique<
57 traccc::edm::silicon_cell_collection::buffer>(
58 traccc_cells_host.size(), m_mrTool->mainMR());
59
60 // We ignore() the setup and wait() on the copy to allow parallelism.
61 device_copy->setup(*traccc_cells_gpu_buffer)->ignore();
62 (*device_copy)(vecmem::get_data(traccc_cells_host),
63 *traccc_cells_gpu_buffer)->wait();
64
65 auto outputTracccCells = SG::makeHandle(m_tracccCellsKey, ctx);
66 ATH_CHECK(outputTracccCells.record(std::move(traccc_cells_gpu_buffer)));
67
68 ATH_MSG_DEBUG("nb cells created from Pixels: " << traccc_cells_host.size());
69
70 return StatusCode::SUCCESS;
71}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
const Gaudi::Property< uint32_t > m_n_rdos_est
SG::WriteHandleKey< traccc::edm::silicon_cell_collection::buffer > m_tracccCellsKey
ToolHandle< AthDevice::ICopiesTool > m_copiesTool
ToolHandle< AthDevice::IMemoryResourcesTool > m_mrTool
ToolHandle< ITkPixelDecodingTool > m_decodingTool
StatusCode moduleIdToDetrayIndex(uint32_t module_id, uint32_t &detray_index) const
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
setEventNumber uint32_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode ITkPixelDecodingTracccCellAlg::initialize ( )
overridevirtual

Definition at line 19 of file ITkPixelDecodingTracccCellAlg.cxx.

20{
21 ATH_CHECK(m_decodingTool.retrieve());
22 ATH_CHECK(m_tracccCellsKey.initialize());
23 ATH_CHECK(m_mrTool.retrieve());
24 ATH_CHECK(m_copiesTool.retrieve());
26 return StatusCode::SUCCESS;
27}
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< std::string > m_geoIdMappingObjectName
const ActsTrk::GeometryIdMapping * m_geoIdMapping

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ moduleIdToDetrayIndex()

StatusCode ITkPixelDecodingTracccCellAlg::moduleIdToDetrayIndex ( uint32_t module_id,
uint32_t & detray_index ) const
private

Definition at line 73 of file ITkPixelDecodingTracccCellAlg.cxx.

75{
76 const std::optional<size_t> module_index_opt =
77 m_geoIdMapping->athenaToDetDescIndex(Identifier(module_id));
78 if (!module_index_opt.has_value()) {
79 ATH_MSG_ERROR("no module index for " << Identifier(module_id));
80 return StatusCode::FAILURE;
81 }
82 detray_index = module_index_opt.value();
83 return StatusCode::SUCCESS;
84}

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_copiesTool

ToolHandle<AthDevice::ICopiesTool> ITkPixelDecodingTracccCellAlg::m_copiesTool
private
Initial value:
{
this, "CopiesTool", "", "Tool that provides host and device copy objects"}

Definition at line 44 of file ITkPixelDecodingTracccCellAlg.h.

44 {
45 this, "CopiesTool", "", "Tool that provides host and device copy objects"};

◆ m_decodingTool

ToolHandle<ITkPixelDecodingTool> ITkPixelDecodingTracccCellAlg::m_decodingTool
private
Initial value:
{this,
"PixelDecodingTool", "ITkPixelDecodingTool", "The decoding tool"}

Definition at line 37 of file ITkPixelDecodingTracccCellAlg.h.

37 {this,
38 "PixelDecodingTool", "ITkPixelDecodingTool", "The decoding tool"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_geoIdMapping

const ActsTrk::GeometryIdMapping* ITkPixelDecodingTracccCellAlg::m_geoIdMapping {nullptr}
private

Definition at line 50 of file ITkPixelDecodingTracccCellAlg.h.

50{nullptr};

◆ m_geoIdMappingObjectName

Gaudi::Property<std::string> ITkPixelDecodingTracccCellAlg::m_geoIdMappingObjectName
private
Initial value:
{
this, "GeoIdMappingObjectName", "",
"Detray/Acts/Athena geometry ID mapping"}

Definition at line 47 of file ITkPixelDecodingTracccCellAlg.h.

47 {
48 this, "GeoIdMappingObjectName", "",
49 "Detray/Acts/Athena geometry ID mapping"};

◆ m_mrTool

ToolHandle<AthDevice::IMemoryResourcesTool> ITkPixelDecodingTracccCellAlg::m_mrTool
private
Initial value:
{
this, "MemoryResourcesTool", "", "Tool that provides host and device memory resources"}

Definition at line 42 of file ITkPixelDecodingTracccCellAlg.h.

42 {
43 this, "MemoryResourcesTool", "", "Tool that provides host and device memory resources"};

◆ m_n_rdos_est

const Gaudi::Property<uint32_t> ITkPixelDecodingTracccCellAlg::m_n_rdos_est
private
Initial value:
{
this, "nRDOs", 1200000, "Estimated number of RDOs per event"}

Definition at line 55 of file ITkPixelDecodingTracccCellAlg.h.

55 {
56 this, "nRDOs", 1200000, "Estimated number of RDOs per event"};

◆ m_tracccCellsKey

SG::WriteHandleKey<traccc::edm::silicon_cell_collection::buffer> ITkPixelDecodingTracccCellAlg::m_tracccCellsKey {this, "TracccCells", "TracccCells", "Output traccc cell collection"}
private

Definition at line 39 of file ITkPixelDecodingTracccCellAlg.h.

40{this, "TracccCells", "TracccCells", "Output traccc cell collection"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: