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

A tool to decode MM ROB fragments into MM RDO (based on the sTGC tool). More...

#include <MM_RawDataProviderToolCore.h>

Inheritance diagram for Muon::MM_RawDataProviderToolCore:
Collaboration diagram for Muon::MM_RawDataProviderToolCore:

Public Member Functions

 MM_RawDataProviderToolCore (const std::string &t, const std::string &n, const IInterface *p)
 Default constructor.
virtual ~MM_RawDataProviderToolCore ()=default
 Default destructor.
virtual StatusCode initialize () override
 Standard AlgTool method.
virtual StatusCode convertIntoContainer (const EventContext &ctx, const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &, const std::vector< IdentifierHash > &, MM_RawDataContainer &) const
 Method that converts the ROBFragments into the passed container.
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

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

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 The ID helper.
ToolHandle< IMM_ROD_Decoderm_decoder {this, "Decoder", "Muon::MmROD_Decoder/MmROD_Decoder"}
 Decoder for ROB fragment RDO conversion.
SG::WriteHandleKey< MM_RawDataContainerm_rdoContainerKey { this, "RdoLocation", "MMRDO", "Name of the MMRDO produced by RawDataProvider"}
 RDO container key.
unsigned int m_maxhashtoUse {0}
ServiceHandle< IROBDataProviderSvcm_robDataProvider
 Rob Data Provider handle.
Gaudi::Property< bool > m_skipDecoding {this, "SkipDecoding", false, "Skip the decoding but still write the container"}
 Flag to skip decoding and write empty container.

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

A tool to decode MM ROB fragments into MM RDO (based on the sTGC tool).

Author
Leonidas Fountas leoni.nosp@m.das..nosp@m.fount.nosp@m.as@c.nosp@m.ern.c.nosp@m.h

Definition at line 29 of file MM_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

◆ MM_RawDataProviderToolCore()

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

Default constructor.

Definition at line 15 of file MM_RawDataProviderToolCore.cxx.

16: AthAlgTool(t, n, p)
17, m_robDataProvider("ROBDataProviderSvc",n)
18{ }
AthAlgTool()
Default constructor:
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Rob Data Provider handle.

◆ ~MM_RawDataProviderToolCore()

virtual Muon::MM_RawDataProviderToolCore::~MM_RawDataProviderToolCore ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ convertIntoContainer()

StatusCode Muon::MM_RawDataProviderToolCore::convertIntoContainer ( const EventContext & ctx,
const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & vecRobs,
const std::vector< IdentifierHash > & rdoIdhVect,
MM_RawDataContainer & mmRdoContainer ) const
virtual

Method that converts the ROBFragments into the passed container.

Definition at line 37 of file MM_RawDataProviderToolCore.cxx.

38{
39 // Since there can be multiple ROBFragments contributing to the same RDO collection a temporary cache is setup and passed to fillCollection by reference. Once all ROBFragments are processed the collections are added into the rdo container
40
41
42 std::unordered_map<IdentifierHash, std::unique_ptr<MM_RawDataCollection>> rdo_map;
43
44
45 // Loop on the passed ROB fragments, and call the decoder for each one to fill the RDO container.
46 for (const ROBFragment* fragment : vecRobs)
47 ATH_CHECK( m_decoder->fillCollection(ctx, *fragment, rdoIdhVect, rdo_map) ); // always returns StatusCode::SUCCESS
48
49 // error counters
50 int nerr_duplicate{0}, nerr_rdo{0};
51
52 // add the RDO collections created from the data of this ROB into the identifiable container.
53 for (auto& [hash, collection]: rdo_map) {
54
55 if ((!collection) or collection->empty()) continue; // skip empty collections
56
57 MM_RawDataContainer::IDC_WriteHandle lock = mmRdoContainer.getWriteHandle(hash);
58
59 if (lock.alreadyPresent()) {
60 ++nerr_duplicate;
61 } else if (!lock.addOrDelete(std::move(collection)).isSuccess()) {
62 // since we prevent duplicates above, this error should never happen.
63 ++nerr_rdo;
64 }
65 }
66
67
68 // error summary (to reduce the number of messages)
69 if (nerr_duplicate) ATH_MSG_WARNING(nerr_duplicate << " elinks skipped since the same module hash has been added by a previous ROB fragment");
70 if (nerr_rdo){
71 ATH_MSG_ERROR("Failed to add "<<nerr_rdo<<" RDOs into the identifiable container");
72 return StatusCode::FAILURE;
73 }
74
75 ATH_MSG_DEBUG("Size of mmRdoContainer is " << mmRdoContainer.size());
76 return StatusCode::SUCCESS;
77}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
ToolHandle< IMM_ROD_Decoder > m_decoder
Decoder for ROB fragment RDO conversion.
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27

◆ 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::MM_RawDataProviderToolCore::initialize ( )
overridevirtual

Standard AlgTool method.

Reimplemented in Muon::MM_RawDataProviderToolMT.

Definition at line 22 of file MM_RawDataProviderToolCore.cxx.

23{
24 ATH_CHECK(AthAlgTool::initialize());
25 ATH_CHECK(m_idHelperSvc.retrieve());
26 ATH_CHECK(m_decoder.retrieve());
27 ATH_CHECK(m_robDataProvider.retrieve());
28 ATH_CHECK(m_rdoContainerKey.initialize());
29
30 m_maxhashtoUse = m_idHelperSvc->mmIdHelper().module_hash_max();
31
32 return StatusCode::SUCCESS;
33}
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
The ID helper.
SG::WriteHandleKey< MM_RawDataContainer > m_rdoContainerKey
RDO container key.

◆ 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.

◆ 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_decoder

ToolHandle<IMM_ROD_Decoder> Muon::MM_RawDataProviderToolCore::m_decoder {this, "Decoder", "Muon::MmROD_Decoder/MmROD_Decoder"}
protected

Decoder for ROB fragment RDO conversion.

Definition at line 51 of file MM_RawDataProviderToolCore.h.

51{this, "Decoder", "Muon::MmROD_Decoder/MmROD_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_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MM_RawDataProviderToolCore::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
protected

The ID helper.

Definition at line 48 of file MM_RawDataProviderToolCore.h.

48{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_maxhashtoUse

unsigned int Muon::MM_RawDataProviderToolCore::m_maxhashtoUse {0}
protected

Definition at line 56 of file MM_RawDataProviderToolCore.h.

56{0}; //MT

◆ m_rdoContainerKey

SG::WriteHandleKey<MM_RawDataContainer> Muon::MM_RawDataProviderToolCore::m_rdoContainerKey { this, "RdoLocation", "MMRDO", "Name of the MMRDO produced by RawDataProvider"}
protected

RDO container key.

Definition at line 54 of file MM_RawDataProviderToolCore.h.

54{ this, "RdoLocation", "MMRDO", "Name of the MMRDO produced by RawDataProvider"}; //MT

◆ m_robDataProvider

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

Rob Data Provider handle.

Definition at line 59 of file MM_RawDataProviderToolCore.h.

◆ m_skipDecoding

Gaudi::Property<bool> Muon::MM_RawDataProviderToolCore::m_skipDecoding {this, "SkipDecoding", false, "Skip the decoding but still write the container"}
protected

Flag to skip decoding and write empty container.

Definition at line 62 of file MM_RawDataProviderToolCore.h.

62{this, "SkipDecoding", false, "Skip the decoding but still write the container"};

◆ 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: