ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::RPC_RawDataProviderToolCore Class Reference

Base class for tools to decode RPC raw data. More...

#include <RPC_RawDataProviderToolCore.h>

Inheritance diagram for Muon::RPC_RawDataProviderToolCore:
Collaboration diagram for Muon::RPC_RawDataProviderToolCore:

Public Member Functions

 RPC_RawDataProviderToolCore (const std::string &t, const std::string &n, const IInterface *p)
virtual ~RPC_RawDataProviderToolCore ()=default
virtual StatusCode initialize () override
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 sysInitialize () override
 Perform system initialization for an algorithm.
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

StatusCode convertIntoContainers (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, const std::vector< IdentifierHash > &collections, RpcPadContainer *pad, RpcSectorLogicContainer *logic, const bool &decodeSL) const
std::vector< IdentifierHashto_be_converted (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, const std::vector< IdentifierHash > &coll) const
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.

Protected Attributes

SG::ReadCondHandleKey< RpcCablingCondDatam_readKey {this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"}
ServiceHandle< IROBDataProviderSvcm_robDataProvider
ToolHandle< IRpcROD_Decoderm_decoder {this, "Decoder", "Muon::RpcROD_Decoder/RpcROD_Decoder"}
SG::WriteHandleKey< RpcPadContainerm_containerKey {this, "RdoLocation", "RPCPAD", "Name of the RPCPAD produced by RawDataProvider"}
SG::WriteHandleKey< RpcSectorLogicContainerm_sec

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

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

Base class for tools to decode RPC raw data.

This contains all the logic to decode a vector of ROB fragments into the relevent containers. The derived classes should do the management of the containers and then call the convertIntoContainers from the convert functions required by the interface.

Definition at line 27 of file RPC_RawDataProviderToolCore.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ RPC_RawDataProviderToolCore()

Muon::RPC_RawDataProviderToolCore::RPC_RawDataProviderToolCore ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 11 of file RPC_RawDataProviderToolCore.cxx.

11 :
12 AthAlgTool(t, n, p), m_robDataProvider("ROBDataProviderSvc", n) {}
AthAlgTool()
Default constructor:
ServiceHandle< IROBDataProviderSvc > m_robDataProvider

◆ ~RPC_RawDataProviderToolCore()

virtual Muon::RPC_RawDataProviderToolCore::~RPC_RawDataProviderToolCore ( )
virtualdefault

Member Function Documentation

◆ convertIntoContainers()

StatusCode Muon::RPC_RawDataProviderToolCore::convertIntoContainers ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & vecRobs,
const std::vector< IdentifierHash > & collections,
RpcPadContainer * pad,
RpcSectorLogicContainer * logic,
const bool & decodeSL ) const
protected

Definition at line 29 of file RPC_RawDataProviderToolCore.cxx.

31 {
32 for (auto itFrag = vecRobs.begin(); itFrag != vecRobs.end(); itFrag++) {
33 // convert only if data payload is delivered
34 if ((**itFrag).rod_ndata() != 0) {
35 std::vector<IdentifierHash> coll = to_be_converted(**itFrag, collections);
36
37 if (m_decoder->fillCollections(**itFrag, *pad, coll, logic, decodeSL).isFailure()) {
38 // store the error conditions into the StatusCode and continue
39 }
40 } else {
41 if (msgLvl(MSG::DEBUG)) {
42 uint32_t sourceId = (**itFrag).source_id();
43 msg(MSG::DEBUG) << " ROB " << MSG::hex << sourceId << " is delivered with an empty payload" << MSG::dec << endmsg;
44 }
45 // store the error condition into the StatusCode and continue
46 }
47 }
48
49 ATH_MSG_DEBUG("After processing, number of collections in container : " << pad->numberOfCollections());
50
51 // in presence of errors return FAILURE
52 // CALLGRIND_STOP_INSTRUMENTATION
53 return StatusCode::SUCCESS;
54}
#define endmsg
#define ATH_MSG_DEBUG(x)
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
virtual size_t numberOfCollections() const override final
return number of collections
std::vector< IdentifierHash > to_be_converted(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, const std::vector< IdentifierHash > &coll) const
setEventNumber uint32_t

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ initialize()

StatusCode Muon::RPC_RawDataProviderToolCore::initialize ( )
overridevirtual

Definition at line 14 of file RPC_RawDataProviderToolCore.cxx.

14 {
15 // retrieve ROD decoder
16 ATH_CHECK(m_decoder.retrieve());
17
18 ATH_CHECK(m_containerKey.initialize());
19 ATH_CHECK(m_sec.initialize());
20
21 // get ROB data provider service
22 ATH_CHECK(m_robDataProvider.retrieve());
23
24 ATH_CHECK(m_readKey.initialize());
25
26 return StatusCode::SUCCESS;
27}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadCondHandleKey< RpcCablingCondData > m_readKey
SG::WriteHandleKey< RpcPadContainer > m_containerKey
SG::WriteHandleKey< RpcSectorLogicContainer > m_sec

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ to_be_converted()

std::vector< IdentifierHash > Muon::RPC_RawDataProviderToolCore::to_be_converted ( const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment & robFrag,
const std::vector< IdentifierHash > & coll ) const
protected

Definition at line 56 of file RPC_RawDataProviderToolCore.cxx.

57 {
58 SG::ReadCondHandle<RpcCablingCondData> readHandle{m_readKey};
59 const RpcCablingCondData* readCdo{*readHandle};
60
61 std::vector<IdentifierHash> to_return;
62 if (coll.empty()) {
63 // get SubdetectorId and ModuleId
64 uint32_t source_id = robFrag.rod_source_id();
65 SourceIdentifier sid(source_id);
66 to_return = (readCdo->rod2hash(sid.subdetector_id(), sid.module_id()));
67 } else {
68 uint32_t source_id = robFrag.rod_source_id();
69 std::vector<IdentifierHash>::const_iterator it = coll.begin();
70 to_return.reserve(coll.size());
71 for (; it != coll.end(); ++it) {
72 if (source_id == readCdo->hash2source(*it)) to_return.emplace_back(*it);
73 }
74 }
75
76 return to_return;
77}
std::vector< IdentifierHash > rod2hash(uint16_t subsystem, uint16_t rod) const
uint32_t hash2source(unsigned int h) const

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_containerKey

SG::WriteHandleKey<RpcPadContainer> Muon::RPC_RawDataProviderToolCore::m_containerKey {this, "RdoLocation", "RPCPAD", "Name of the RPCPAD produced by RawDataProvider"}
protected

Definition at line 53 of file RPC_RawDataProviderToolCore.h.

53{this, "RdoLocation", "RPCPAD", "Name of the RPCPAD produced by RawDataProvider"};

◆ m_decoder

ToolHandle<IRpcROD_Decoder> Muon::RPC_RawDataProviderToolCore::m_decoder {this, "Decoder", "Muon::RpcROD_Decoder/RpcROD_Decoder"}
protected

Definition at line 50 of file RPC_RawDataProviderToolCore.h.

50{this, "Decoder", "Muon::RpcROD_Decoder/RpcROD_Decoder"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_readKey

SG::ReadCondHandleKey<RpcCablingCondData> Muon::RPC_RawDataProviderToolCore::m_readKey {this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"}
protected

Definition at line 44 of file RPC_RawDataProviderToolCore.h.

44{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> Muon::RPC_RawDataProviderToolCore::m_robDataProvider
protected

Definition at line 47 of file RPC_RawDataProviderToolCore.h.

◆ m_sec

SG::WriteHandleKey<RpcSectorLogicContainer> Muon::RPC_RawDataProviderToolCore::m_sec
protected
Initial value:
{this, "RPCSec", "RPC_SECTORLOGIC",
"Name of the RPC_SECTORLOGIC produced by RawDataProvider"}

Definition at line 55 of file RPC_RawDataProviderToolCore.h.

55 {this, "RPCSec", "RPC_SECTORLOGIC",
56 "Name of the RPC_SECTORLOGIC produced by RawDataProvider"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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