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

This class provides conversion from TGC RDO data to TGC Digits and offline ID. More...

#include <TgcRDO_Decoder.h>

Inheritance diagram for Muon::TgcRDO_Decoder:
Collaboration diagram for Muon::TgcRDO_Decoder:

Public Member Functions

 TgcRDO_Decoder (const std::string &type, const std::string &name, const IInterface *parent)
 ~TgcRDO_Decoder ()=default
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void applyPatch (bool patch)
 Set a flag for application of patch.
TgcDigitgetDigit (const TgcRawData *rawData, bool orFlag) const
 Get TGC Digit from TGC RDO.
Identifier getOfflineData (const TgcRawData *rawData, bool orFlag, uint16_t &bctag) const
 Get offline ID and bcTag from TGC RDO.
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

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Provide interface ID of ITGC_RDO_Decoder.

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< MuonTGC_CablingSvcm_cabling {this, "CablingSvc", "MuonTGC_CablingSvc"}
bool m_applyPatch
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

This class provides conversion from TGC RDO data to TGC Digits and offline ID.

Author
Susumu Oda Susum.nosp@m.u.Od.nosp@m.a@cer.nosp@m.n.ch

This class was developed by Tadashi Maeno based on CscRDO_Decoder written by Ketevi A. Assamagan.

Definition at line 32 of file TgcRDO_Decoder.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

◆ TgcRDO_Decoder()

Muon::TgcRDO_Decoder::TgcRDO_Decoder ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 12 of file TgcRDO_Decoder.cxx.

14 : AthAlgTool(type, name, parent),
15 m_applyPatch(false)
16{
17 declareInterface<ITGC_RDO_Decoder>(this);
18}
AthAlgTool()
Default constructor:

◆ ~TgcRDO_Decoder()

Muon::TgcRDO_Decoder::~TgcRDO_Decoder ( )
default

Member Function Documentation

◆ applyPatch()

void Muon::TgcRDO_Decoder::applyPatch ( bool patch)
virtual

Set a flag for application of patch.

Need to describe when patch is required.

Implements Muon::ITGC_RDO_Decoder.

Definition at line 35 of file TgcRDO_Decoder.cxx.

36{
37 m_applyPatch = patch;
38}

◆ 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

◆ finalize()

StatusCode Muon::TgcRDO_Decoder::finalize ( )
virtual

Definition at line 30 of file TgcRDO_Decoder.cxx.

31{
32 return StatusCode::SUCCESS;
33}

◆ getDigit()

TgcDigit * Muon::TgcRDO_Decoder::getDigit ( const TgcRawData * rawData,
bool orFlag ) const
virtual

Get TGC Digit from TGC RDO.

Implements Muon::ITGC_RDO_Decoder.

Definition at line 40 of file TgcRDO_Decoder.cxx.

41{
42 // MuonTGC_CablingSvc should be configured at initialise
43 if(!m_cabling){
44 ATH_MSG_ERROR("MuonTGC_CablingSvc is not available in TgcRDO_Decoder::getDigit()");
45 return nullptr;
46 }
47
48 int offset=0, offsetORed=0;
49
50 const uint16_t sswId = rawData->sswId();
51 const uint16_t slbId = rawData->slbId();
52 const uint16_t bitpos = rawData->bitpos();
53
54 if(m_applyPatch) {
55 if(sswId==9) {
56 if((slbId%4==3 && bitpos>=77 && bitpos<=84) ||
57 (slbId%4!=3 && bitpos>=77 && bitpos<=111)) {
58 offset=1;
59 }
60 } else if(sswId>=3 && sswId<=8) {
61 if((slbId==1 && bitpos>=66 && bitpos<=73) ||
62 (slbId==2 && bitpos>=42 && bitpos<=63)) {
63 offset=36;
64 }
65 if((slbId==1 && bitpos>=102 && bitpos<=109) ||
66 (slbId==2 && bitpos>= 78 && bitpos<= 99)) {
67 offset=-36;
68 }
69 if((slbId==1 && bitpos>=74 && bitpos<=75) ||
70 (slbId==2 && bitpos>=40 && bitpos<=41)) {
71 offsetORed=36;
72 }
73 if((slbId==1 && bitpos>=110 && bitpos<=111) ||
74 (slbId==2 && bitpos>= 76 && bitpos<= 77)) {
75 offsetORed=-36;
76 }
77 }
78 }
79 int corr = orFlag ? offsetORed : offset;
80
81 // get official channel ID
82 Identifier chanId;
83 bool c_found = m_cabling->getOfflineIDfromReadoutID
84 (chanId, rawData->subDetectorId(), rawData->rodId(),
85 sswId, slbId, bitpos+corr, orFlag);
86
87 if(!c_found) return nullptr;
88
89 return new TgcDigit(chanId,rawData->bcTag());
90}
#define ATH_MSG_ERROR(x)
ServiceHandle< MuonTGC_CablingSvc > m_cabling
uint16_t sswId() const
Definition TgcRawData.h:272
uint16_t bitpos() const
Definition TgcRawData.h:293
uint16_t bcTag() const
Definition TgcRawData.h:251
uint16_t subDetectorId() const
Definition TgcRawData.h:264
uint16_t slbId() const
Definition TgcRawData.h:276
uint16_t rodId() const
Definition TgcRawData.h:268
setWord1 uint16_t

◆ getOfflineData()

Identifier Muon::TgcRDO_Decoder::getOfflineData ( const TgcRawData * rawData,
bool orFlag,
uint16_t & bctag ) const
virtual

Get offline ID and bcTag from TGC RDO.

Implements Muon::ITGC_RDO_Decoder.

Definition at line 92 of file TgcRDO_Decoder.cxx.

93{
94 Identifier chanId(0);
95
96 // ITGCcablingSvc should be configured at initialise
97 if(!m_cabling){
98 ATH_MSG_ERROR("ITGCcablingSvc is not available in TgcRDO_Decoder::getOfflineData()");
99 return chanId;
100 }
101
102
104
105 const uint16_t sswId = rawData->sswId();
106 const uint16_t slbId = rawData->slbId();
107 const uint16_t bitpos = rawData->bitpos();
108
109 int offset=0, offsetORed=0;
110 if(m_applyPatch) {
111 if(sswId==9) {
112 if((slbId%4==3 && bitpos>=77 && bitpos<= 84) ||
113 (slbId%4!=3 && bitpos>=77 && bitpos<=111)) {
114 offset=1;
115 }
116 } else if(sswId>=3 && sswId<=8) {
117 if((slbId==1 && bitpos>=66 && bitpos<=73) ||
118 (slbId==2 && bitpos>=42 && bitpos<=63)) {
119 offset=36;
120 }
121 if((slbId==1 && bitpos>=102 && bitpos<=109) ||
122 (slbId==2 && bitpos>= 78 && bitpos<= 99)) {
123 offset=-36;
124 }
125 if((slbId==1 && bitpos>=74 && bitpos<=75) ||
126 (slbId==2 && bitpos>=40 && bitpos<=41)) {
127 offsetORed=36;
128 }
129 if((slbId==1 && bitpos>=110 && bitpos<=111) ||
130 (slbId==2 && bitpos>= 76 && bitpos<= 77)) {
131 offsetORed=-36;
132 }
133 }
134 }
135 int corr = orFlag ? offsetORed : offset;
136
137 // get official channel ID
138 bool c_found = m_cabling->getOfflineIDfromReadoutID
139 (chanId, rawData->subDetectorId(), rawData->rodId(),
140 sswId, slbId, bitpos+corr, orFlag);
141
142 if(!c_found) return chanId;
143
144 bctag = rawData->bcTag();
145 return chanId;
146}
@ BC_UNDEFINED
Definition TgcDigit.h:37

◆ initialize()

StatusCode Muon::TgcRDO_Decoder::initialize ( )
virtual

Definition at line 20 of file TgcRDO_Decoder.cxx.

21{
22 ATH_MSG_DEBUG("TgcRDO_Decoder::initialize");
23
24 //try to configure the cabling service
25 ATH_CHECK(m_cabling.retrieve());
26
27 return StatusCode::SUCCESS;
28}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)

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

◆ interfaceID()

const InterfaceID & Muon::ITGC_RDO_Decoder::interfaceID ( )
inlinestaticinherited

Provide interface ID of ITGC_RDO_Decoder.

Definition at line 28 of file ITGC_RDO_Decoder.h.

28{ return IID_ITGC_RDO_Decoder; };
static const InterfaceID IID_ITGC_RDO_Decoder("Muon::ITGC_RDO_Decoder", 1, 0)

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

bool Muon::TgcRDO_Decoder::m_applyPatch
private

Definition at line 51 of file TgcRDO_Decoder.h.

◆ m_cabling

ServiceHandle<MuonTGC_CablingSvc> Muon::TgcRDO_Decoder::m_cabling {this, "CablingSvc", "MuonTGC_CablingSvc"}
private

Definition at line 50 of file TgcRDO_Decoder.h.

50{this, "CablingSvc", "MuonTGC_CablingSvc"};

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