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

#include <AFP_RawDataProvider.h>

Inheritance diagram for AFP_RawDataProvider:
Collaboration diagram for AFP_RawDataProvider:

Public Member Functions

 AFP_RawDataProvider (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~AFP_RawDataProvider ()
 Does nothing.
virtual StatusCode initialize ()
 Initialise tool and service.
virtual StatusCode finalize ()
 Does nothing.
virtual StatusCode execute (const EventContext &ctx) const
 Creates raw objects from bytestream.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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< StoreGateSvcStoreGateSvc_t

Private Member Functions

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

Private Attributes

ServiceHandle< IROBDataProviderSvcm_robDataProvider
ToolHandle< AFP_RawDataProviderToolm_rawDataTool {this, "ProviderTool", "AFP_RawDataProviderTool"}
SG::WriteHandleKey< AFP_RawContainerm_AFP_RawContainerKey
 name used to store AFP_RawContainer in StoreGate
const std::vector< unsigned int > m_robIDs = {AFP_ROBID::sideA, AFP_ROBID::sideC, AFP_ROBID::sideC_2016}
 vector of robIDs from which data should be processed
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

Definition at line 22 of file AFP_RawDataProvider.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ AFP_RawDataProvider()

AFP_RawDataProvider::AFP_RawDataProvider ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 13 of file AFP_RawDataProvider.cxx.

15 : AthReentrantAlgorithm(name, pSvcLocator),
16 m_robDataProvider("ROBDataProviderSvc", name)
17{
18}
ServiceHandle< IROBDataProviderSvc > m_robDataProvider

◆ ~AFP_RawDataProvider()

AFP_RawDataProvider::~AFP_RawDataProvider ( )
virtual

Does nothing.

Definition at line 20 of file AFP_RawDataProvider.cxx.

20{}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ 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 AFP_RawDataProvider::execute ( const EventContext & ctx) const
virtual

Creates raw objects from bytestream.

Creates a new AFP_RawDataContainer saves it to StoreGate and fills with collections based on information from robIDs

Definition at line 43 of file AFP_RawDataProvider.cxx.

43 {
44 ATH_MSG_DEBUG("AFP_RawDataProvider::EXECUTE");
45 auto container = std::make_unique<AFP_RawContainer>();
46 ATH_MSG_DEBUG("Created AFP RDO Container");
47
48 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *> listOfRobf;
49
50 m_robDataProvider->getROBData(ctx, m_robIDs, listOfRobf);
51 ATH_MSG_DEBUG(" ROB ID " << std::hex << m_robIDs<<std::dec);
52 ATH_MSG_DEBUG(" Number of ROB fragments is " << listOfRobf.size());
53
54 if (m_rawDataTool->convert(listOfRobf, container.get()).isFailure()) {
55 ATH_MSG_ERROR("Bytestream conversion into raw failed");
56 return StatusCode::FAILURE;
57 } else {
58 ATH_MSG_DEBUG(" Number of time-of-flight collections in container is "
59 << container->collectionsToF().size());
60 ATH_MSG_DEBUG(" Number of silicon collections in container is "
61 << container->collectionsSi().size());
62 }
63
64 SG::WriteHandle<AFP_RawContainer> writeHandle{m_AFP_RawContainerKey, ctx};
65 StatusCode recordSC = writeHandle.record(std::move(container));
66 if (recordSC.isFailure()) {
67 ATH_MSG_WARNING("Unable to record AFP RDO Container");
68 return StatusCode::SUCCESS;
69 } else {
70 ATH_MSG_DEBUG("AFP RDO Container recorded");
71 }
72
73 return StatusCode::SUCCESS;
74}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
const std::vector< unsigned int > m_robIDs
vector of robIDs from which data should be processed
SG::WriteHandleKey< AFP_RawContainer > m_AFP_RawContainerKey
name used to store AFP_RawContainer in StoreGate
ToolHandle< AFP_RawDataProviderTool > m_rawDataTool
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ 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 & AthCommonReentrantAlgorithm< 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 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

virtual StatusCode AFP_RawDataProvider::finalize ( )
inlinevirtual

Does nothing.

Definition at line 34 of file AFP_RawDataProvider.h.

34{ return StatusCode::SUCCESS; }

◆ initialize()

StatusCode AFP_RawDataProvider::initialize ( )
virtual

Initialise tool and service.

Definition at line 22 of file AFP_RawDataProvider.cxx.

22 {
23 ATH_MSG_DEBUG("AFP_RawDataProvider::initialize");
24
25 if (m_robDataProvider.retrieve().isFailure()) {
26 ATH_MSG_WARNING("Failed to retrieve service " << m_robDataProvider);
27 return StatusCode::SUCCESS;
28 } else
29 ATH_MSG_DEBUG("Retrieved service " << m_robDataProvider);
30
31 if (m_rawDataTool.retrieve().isFailure()) {
32 ATH_MSG_WARNING("Failed to retrieve service " << m_rawDataTool);
33 return StatusCode::SUCCESS;
34 } else {
35 ATH_MSG_DEBUG("Retrieved service " << m_rawDataTool);
36 }
37
38 ATH_CHECK(m_AFP_RawContainerKey.initialize());
39
40 return StatusCode::SUCCESS;
41}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ 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()

◆ 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 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
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 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_AFP_RawContainerKey

SG::WriteHandleKey<AFP_RawContainer> AFP_RawDataProvider::m_AFP_RawContainerKey
private
Initial value:
{this, "AFP_RawContainerKey", "AFP_RawData",
"Name under which AFP_RawContainer object will be saved in StoreGate"}

name used to store AFP_RawContainer in StoreGate

Definition at line 47 of file AFP_RawDataProvider.h.

47 {this, "AFP_RawContainerKey", "AFP_RawData",
48 "Name under which AFP_RawContainer object will be saved in StoreGate"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 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 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_rawDataTool

ToolHandle<AFP_RawDataProviderTool> AFP_RawDataProvider::m_rawDataTool {this, "ProviderTool", "AFP_RawDataProviderTool"}
private

Definition at line 44 of file AFP_RawDataProvider.h.

44{this, "ProviderTool", "AFP_RawDataProviderTool"};

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> AFP_RawDataProvider::m_robDataProvider
private

Definition at line 43 of file AFP_RawDataProvider.h.

◆ m_robIDs

const std::vector<unsigned int> AFP_RawDataProvider::m_robIDs = {AFP_ROBID::sideA, AFP_ROBID::sideC, AFP_ROBID::sideC_2016}
private

vector of robIDs from which data should be processed

Definition at line 51 of file AFP_RawDataProvider.h.

static constexpr unsigned int sideC_2016
ROB ID of stations on C side in 2016.
Definition AFP_ROBID.h:17
static constexpr unsigned int sideC
ROB ID of stations on C side.
Definition AFP_ROBID.h:16
static constexpr unsigned int sideA
ROB ID of stations on A side.
Definition AFP_ROBID.h:15

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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