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

#include <STGC_RdoToDigit.h>

Inheritance diagram for STGC_RdoToDigit:
Collaboration diagram for STGC_RdoToDigit:

Public Member Functions

virtual ~STGC_RdoToDigit ()=default
virtual StatusCode initialize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
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

StatusCode decodeSTGC (const EventContext &ctx, const Muon::STGC_RawDataCollection *, sTgcDigitContainer *, sTgcDigitCollection *&, Identifier &) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< Muon::ISTGC_RDO_Decoderm_stgcRdoDecoderTool {this, "sTgcRdoDecoderTool", "Muon::STGC_RDO_Decoder", ""}
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
SG::ReadHandleKey< Muon::STGC_RawDataContainerm_stgcRdoKey {this, "sTgcRdoContainer", "sTGCRDO", "sTGC RDO Input"}
SG::WriteHandleKey< sTgcDigitContainerm_stgcDigitKey {this, "sTgcDigitContainer", "sTGC_DIGITS", "sTGC Digit Output"}
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 16 of file STGC_RdoToDigit.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

◆ ~STGC_RdoToDigit()

virtual STGC_RdoToDigit::~STGC_RdoToDigit ( )
virtualdefault

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>

◆ decodeSTGC()

StatusCode STGC_RdoToDigit::decodeSTGC ( const EventContext & ctx,
const Muon::STGC_RawDataCollection * rdoColl,
sTgcDigitContainer * stgcContainer,
sTgcDigitCollection *& collection,
Identifier & oldId ) const
private

Definition at line 41 of file STGC_RdoToDigit.cxx.

42 {
43 const IdContext stgcContext = m_idHelperSvc->stgcIdHelper().module_context();
44
45 if (!rdoColl->empty()) {
46 ATH_MSG_DEBUG(" Number of RawData in this rdo " << rdoColl->size());
47
48 // for each RDO, loop over RawData, converter RawData to digit
49 // retrieve/create digit collection, and insert digit into collection
50 for (const Muon::STGC_RawData* data : *rdoColl) {
51 sTgcDigit* newDigit = m_stgcRdoDecoderTool->getDigit(ctx, data);
52 if (!newDigit) {
53 ATH_MSG_ERROR("Error in sTGC RDO decoder");
54 continue;
55 }
56
57 uint16_t relBcid = newDigit->bcTag();
58 uint16_t bcTag = 0;
59 // Triggering bunch crossing is set to relative_BCID = 3
60 if (relBcid == 3)
61 bcTag = 0;
62 else if (relBcid < 3)
63 bcTag = ~(3 - relBcid);
64 else if (relBcid > 3)
65 bcTag = (relBcid - 3);
66 newDigit->set_bcTag(bcTag);
67
68 // find here the Proper Digit Collection identifier, using the rdo-hit id
69 // (since RDO collections are not in a 1-to-1 relation with digit collections)
70 const Identifier elementId = m_idHelperSvc->stgcIdHelper().elementID(newDigit->identify());
71 IdentifierHash coll_hash;
72 if (m_idHelperSvc->stgcIdHelper().get_hash(elementId, coll_hash, &stgcContext)) {
73 ATH_MSG_WARNING("Unable to get STGC digit collection hash id "
74 << "context begin_index = " << stgcContext.begin_index()
75 << " context end_index = " << stgcContext.end_index() << " the identifier is ");
76 elementId.show();
77 }
78
79 if (oldId != elementId) {
80 const sTgcDigitCollection* coll = stgcContainer->indexFindPtr(coll_hash);
81 if (nullptr == coll) {
82 sTgcDigitCollection* newCollection = new sTgcDigitCollection(elementId, coll_hash);
83 newCollection->push_back(newDigit);
84 collection = newCollection;
85 if (stgcContainer->addCollection(newCollection, coll_hash).isFailure())
86 ATH_MSG_WARNING("Couldn't record sTgcDigitCollection with key=" << coll_hash << " in StoreGate!");
87 } else {
88 sTgcDigitCollection* oldCollection ATLAS_THREAD_SAFE = const_cast<sTgcDigitCollection*>(coll); // FIXME
89 oldCollection->push_back(newDigit);
90 collection = oldCollection;
91 }
92 oldId = elementId;
93 } else {
94 collection->push_back(newDigit);
95 }
96 }
97 }
98 return StatusCode::SUCCESS;
99}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
unsigned bcTag(unsigned bcBitMap)
#define ATLAS_THREAD_SAFE
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
size_type begin_index() const
Definition IdContext.h:45
size_type end_index() const
Definition IdContext.h:46
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
void show() const
Print out in hex form.
Identifier identify() const
Definition MuonDigit.h:30
ToolHandle< Muon::ISTGC_RDO_Decoder > m_stgcRdoDecoderTool
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
void set_bcTag(uint16_t newbcTag)
Definition sTgcDigit.cxx:66
uint16_t bcTag() const
Definition sTgcDigit.cxx:34
setWord1 uint16_t

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

Definition at line 16 of file STGC_RdoToDigit.cxx.

16 {
17 ATH_MSG_DEBUG("in execute()");
18 SG::ReadHandle<Muon::STGC_RawDataContainer> rdoRH(m_stgcRdoKey, ctx);
19 if (!rdoRH.isValid()) {
20 ATH_MSG_ERROR("No STGC RDO container found!");
21 return StatusCode::FAILURE;
22 }
23 const Muon::STGC_RawDataContainer* rdoContainer = rdoRH.cptr();
24 ATH_MSG_DEBUG("Retrieved " << rdoContainer->size() << " sTGC RDOs.");
25
26 SG::WriteHandle<sTgcDigitContainer> wh_stgcDigit(m_stgcDigitKey, ctx);
27 ATH_CHECK(wh_stgcDigit.record(std::make_unique<sTgcDigitContainer>(m_idHelperSvc->stgcIdHelper().detectorElement_hash_max())));
28 ATH_MSG_DEBUG("Decoding sTGC RDO into sTGC Digit");
29
30 // retrieve the collection of RDO
31 Identifier oldId;
32 sTgcDigitCollection* collection = nullptr;
33 // now decode RDO into digits
34 for (const Muon::STGC_RawDataCollection* coll : *rdoContainer) {
35 ATH_CHECK(this->decodeSTGC(ctx, coll, wh_stgcDigit.ptr(), collection, oldId));
36 }
37
38 return StatusCode::SUCCESS;
39}
#define ATH_CHECK
Evaluate an expression and check for errors.
size_t size() const
Duplicate of fullSize for backwards compatability.
StatusCode decodeSTGC(const EventContext &ctx, const Muon::STGC_RawDataCollection *, sTgcDigitContainer *, sTgcDigitCollection *&, Identifier &) const
SG::WriteHandleKey< sTgcDigitContainer > m_stgcDigitKey
SG::ReadHandleKey< Muon::STGC_RawDataContainer > m_stgcRdoKey

◆ 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

◆ initialize()

StatusCode STGC_RdoToDigit::initialize ( )
finaloverridevirtual

Definition at line 8 of file STGC_RdoToDigit.cxx.

8 {
9 ATH_CHECK(m_idHelperSvc.retrieve());
11 ATH_CHECK(m_stgcRdoKey.initialize());
12 ATH_CHECK(m_stgcDigitKey.initialize());
13 return StatusCode::SUCCESS;
14}

◆ 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_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_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> STGC_RdoToDigit::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 27 of file STGC_RdoToDigit.h.

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

◆ m_stgcDigitKey

SG::WriteHandleKey<sTgcDigitContainer> STGC_RdoToDigit::m_stgcDigitKey {this, "sTgcDigitContainer", "sTGC_DIGITS", "sTGC Digit Output"}
private

Definition at line 29 of file STGC_RdoToDigit.h.

29{this, "sTgcDigitContainer", "sTGC_DIGITS", "sTGC Digit Output"};

◆ m_stgcRdoDecoderTool

ToolHandle<Muon::ISTGC_RDO_Decoder> STGC_RdoToDigit::m_stgcRdoDecoderTool {this, "sTgcRdoDecoderTool", "Muon::STGC_RDO_Decoder", ""}
private

Definition at line 26 of file STGC_RdoToDigit.h.

26{this, "sTgcRdoDecoderTool", "Muon::STGC_RDO_Decoder", ""};

◆ m_stgcRdoKey

SG::ReadHandleKey<Muon::STGC_RawDataContainer> STGC_RdoToDigit::m_stgcRdoKey {this, "sTgcRdoContainer", "sTGCRDO", "sTGC RDO Input"}
private

Definition at line 28 of file STGC_RdoToDigit.h.

28{this, "sTgcRdoContainer", "sTGCRDO", "sTGC RDO Input"};

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