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

A tool to decode TGC ROB fragments into TGC RDO. More...

#include <TGC_RawDataProviderToolCore.h>

Inheritance diagram for Muon::TGC_RawDataProviderToolCore:
Collaboration diagram for Muon::TGC_RawDataProviderToolCore:

Public Member Functions

 TGC_RawDataProviderToolCore (const std::string &t, const std::string &n, const IInterface *p)
 Default constructor.
virtual ~TGC_RawDataProviderToolCore ()=default
 Default destructor.
virtual StatusCode initialize ()
 Standard AlgTool method.
virtual StatusCode convertIntoContainer (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, TgcRdoContainer &tgcRdoContainer) 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

std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > getROBData (const std::vector< IdentifierHash > &rdoIdhVect, const EventContext &ctx) const
 Function to get the ROB data from a vector of IdentifierHash.
const MuonTGC_CablingSvcgetCabling () 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

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
ToolHandle< ITGC_RodDecoderm_decoder {this,"Decoder","Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout"}
 Decoder for ROB fragment RDO conversion.
SG::WriteHandleKey< TgcRdoContainerm_rdoContainerKey { this, "RdoLocation", "TGCRDO", "Name of the TGCRDO produced by RawDataProvider"}
 RDO container key.
unsigned int m_maxhashtoUse = 0U
TGC_Hid2RESrcID m_hid2re
 ID converter.
CxxUtils::CachedPointer< const MuonTGC_CablingSvcm_cabling
 TGC cabling Svc.
ServiceHandle< IROBDataProviderSvcm_robDataProvider
 Rob Data Provider handle.

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 TGC ROB fragments into TGC RDO.

Author
Zvi Tarem zvi@c.nosp@m.alip.nosp@m.er.co.nosp@m..il
Mark Owen marko.nosp@m.wen@.nosp@m.cern..nosp@m.ch

Definition at line 31 of file TGC_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

◆ TGC_RawDataProviderToolCore()

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

Default constructor.

Definition at line 12 of file TGC_RawDataProviderToolCore.cxx.

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

◆ ~TGC_RawDataProviderToolCore()

virtual Muon::TGC_RawDataProviderToolCore::~TGC_RawDataProviderToolCore ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ convertIntoContainer()

StatusCode Muon::TGC_RawDataProviderToolCore::convertIntoContainer ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & vecRobs,
TgcRdoContainer & tgcRdoContainer ) const
virtual

Method that converts the ROBFragments into the passed container.

Static variables are not thread safe

Definition at line 52 of file TGC_RawDataProviderToolCore.cxx.

53{
54
56 static thread_local int DecodeErrCount = 0;
57
58 // Update to range based loop
59 for(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* fragment : vecRobs){
60 if(m_decoder->fillCollection(*fragment, tgcRdoContainer).isFailure()) {
61 if(DecodeErrCount < 100) {
62 ATH_MSG_INFO( "Problem with TGC ByteStream Decoding!" );
63 DecodeErrCount++;
64 }
65 else if(100 == DecodeErrCount) {
66 ATH_MSG_INFO( "Too many Problems with TGC Decoding messages. Turning message off." );
67 DecodeErrCount++;
68 }
69 }
70 }
71 ATH_MSG_DEBUG("Size of TgcRdoContainer is " << tgcRdoContainer.size());
72 return StatusCode::SUCCESS;
73}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
size_t size() const
Duplicate of fullSize for backwards compatability.
ToolHandle< ITGC_RodDecoder > 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

◆ getCabling()

const MuonTGC_CablingSvc * Muon::TGC_RawDataProviderToolCore::getCabling ( ) const
protected

Definition at line 75 of file TGC_RawDataProviderToolCore.cxx.

76{
77 const MuonTGC_CablingSvc* cabling = m_cabling.get();
78 if (cabling) {
79 return cabling;
80 }
81
82 ServiceHandle<MuonTGC_CablingSvc> TgcCabGet("MuonTGC_CablingSvc", name());
83 if (TgcCabGet.retrieve().isFailure()) {
84 ATH_MSG_FATAL( "Could not get MuonTGC_CablingSvc !" );
85 return nullptr;
86 }
87
88 m_cabling.set(TgcCabGet.get());
89
90 return m_cabling.get();
91}
#define ATH_MSG_FATAL(x)
CxxUtils::CachedPointer< const MuonTGC_CablingSvc > m_cabling
TGC cabling Svc.

◆ getROBData()

std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > Muon::TGC_RawDataProviderToolCore::getROBData ( const std::vector< IdentifierHash > & rdoIdhVect,
const EventContext & ctx ) const
protected

Function to get the ROB data from a vector of IdentifierHash.

Definition at line 94 of file TGC_RawDataProviderToolCore.cxx.

95{
96 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
97 const MuonTGC_CablingSvc* cabling = getCabling();
98 if(!cabling) {
99 ATH_MSG_ERROR("Could not get cabling, return empty vector of ROB fragments");
100 return vecOfRobf;
101 }
102
103 IdContext tgcContext = m_idHelperSvc->tgcIdHelper().module_context();
104
105 std::vector<uint32_t> robIds;
106
107 unsigned int size = rdoIdhVect.size();
108 for(unsigned int i=0; i<size; ++i) {
109 Identifier Id;
110 if(m_idHelperSvc->tgcIdHelper().get_id(rdoIdhVect[i], Id, &tgcContext)) {
111 ATH_MSG_WARNING( "Unable to get TGC Identifier from collection hash id " );
112 continue;
113 }
114 const Identifier tgcId = Id;
115 uint32_t rodId = m_hid2re.getRodID(tgcId, cabling);
116 uint32_t robId = m_hid2re.getRobID(rodId);
117 std::vector<uint32_t>::iterator it_robId = std::find(robIds.begin(), robIds.end(), robId);
118 if(it_robId==robIds.end()) {
119 robIds.push_back(robId);
120 }
121 }
122 m_robDataProvider->getROBData(ctx, robIds, vecOfRobf);
123 ATH_MSG_VERBOSE( "Number of ROB fragments " << vecOfRobf.size() );
124 return vecOfRobf;
125}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
const MuonTGC_CablingSvc * getCabling() const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
setEventNumber uint32_t

◆ initialize()

StatusCode Muon::TGC_RawDataProviderToolCore::initialize ( )
virtual

Standard AlgTool method.

Definition at line 23 of file TGC_RawDataProviderToolCore.cxx.

24{
25 ATH_CHECK(AthAlgTool::initialize());
26 ATH_CHECK(m_idHelperSvc.retrieve());
27
28 ATH_CHECK(m_decoder.retrieve());
29 ATH_MSG_DEBUG( "Retrieved tool " << m_decoder );
30
31 // Get ROBDataProviderSvc
32 ATH_CHECK(m_robDataProvider.retrieve());
33 ATH_MSG_DEBUG( "Retrieved service " << m_robDataProvider );
34
35 m_maxhashtoUse = m_idHelperSvc->tgcIdHelper().module_hash_max();
36
37 ATH_CHECK(m_rdoContainerKey.initialize());
38
39 //try to configure the cabling service
40 if (!getCabling()) {
41 // ??? Is deferred initialization still needed here?
42 ATH_MSG_INFO( "TGCCablingServerSvc not yet configured; postpone TGCcabling initialization at first event. " );
43 }
44
45 m_hid2re.fillAllRobIds();
46
47 return StatusCode::SUCCESS;
48}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::WriteHandleKey< TgcRdoContainer > 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_cabling

CxxUtils::CachedPointer<const MuonTGC_CablingSvc> Muon::TGC_RawDataProviderToolCore::m_cabling
protected

TGC cabling Svc.

Definition at line 61 of file TGC_RawDataProviderToolCore.h.

◆ m_decoder

ToolHandle<ITGC_RodDecoder> Muon::TGC_RawDataProviderToolCore::m_decoder {this,"Decoder","Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout"}
protected

Decoder for ROB fragment RDO conversion.

Definition at line 52 of file TGC_RawDataProviderToolCore.h.

52{this,"Decoder","Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout"};

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

TGC_Hid2RESrcID Muon::TGC_RawDataProviderToolCore::m_hid2re
protected

ID converter.

Definition at line 59 of file TGC_RawDataProviderToolCore.h.

◆ m_idHelperSvc

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

Definition at line 50 of file TGC_RawDataProviderToolCore.h.

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

◆ m_maxhashtoUse

unsigned int Muon::TGC_RawDataProviderToolCore::m_maxhashtoUse = 0U
protected

Definition at line 56 of file TGC_RawDataProviderToolCore.h.

◆ m_rdoContainerKey

SG::WriteHandleKey<TgcRdoContainer> Muon::TGC_RawDataProviderToolCore::m_rdoContainerKey { this, "RdoLocation", "TGCRDO", "Name of the TGCRDO produced by RawDataProvider"}
protected

RDO container key.

Definition at line 54 of file TGC_RawDataProviderToolCore.h.

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

◆ m_robDataProvider

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

Rob Data Provider handle.

Definition at line 63 of file TGC_RawDataProviderToolCore.h.

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