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

#include <TileMuonReceiverReadCnt.h>

Inheritance diagram for TileMuonReceiverReadCnt:
Collaboration diagram for TileMuonReceiverReadCnt:

Public Member Functions

 TileMuonReceiverReadCnt (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TileMuonReceiverReadCnt ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< TileDigitsContainerm_digitsContainerKey
SG::ReadHandleKey< TileRawChannelContainerm_rawChannelContainerKey
SG::ReadHandleKey< TileMuonReceiverContainerm_muonReceiverContainerKey
const TileIDm_tileID
const TileHWIDm_tileHWID
DataObjIDColl m_extendedExtraObjects
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 41 of file TileMuonReceiverReadCnt.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileMuonReceiverReadCnt()

TileMuonReceiverReadCnt::TileMuonReceiverReadCnt ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 49 of file TileMuonReceiverReadCnt.cxx.

50 : AthAlgorithm(name, pSvcLocator)
51 , m_tileID(0)
52 , m_tileHWID(0)
53{
54}
AthAlgorithm()
Default constructor:

◆ ~TileMuonReceiverReadCnt()

TileMuonReceiverReadCnt::~TileMuonReceiverReadCnt ( )
virtual

Definition at line 56 of file TileMuonReceiverReadCnt.cxx.

56 {
57}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< 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< 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 TileMuonReceiverReadCnt::execute ( )

Definition at line 75 of file TileMuonReceiverReadCnt.cxx.

75 {
76
77 // step1: read the tile muon receiver container from TES
78 //
79 SG::ReadHandle<TileMuonReceiverContainer> muonReceiverContainer(m_muonReceiverContainerKey);
80 if (muonReceiverContainer.isValid()) {
81
82 ATH_MSG_INFO( "Reading the TileMuRcvContainer: " << m_muonReceiverContainerKey.key());
83
84 // step2: check the number of entries that should be 128 per event
85 //
86 int nentries = muonReceiverContainer->size();
87 ATH_MSG_INFO( "--- The number of container elements in " << m_muonReceiverContainerKey.key() << " is " << nentries );
88
89 // step3: check container contents
90 //
91
92 for (const TileMuonReceiverObj* muonReceiverObj : *muonReceiverContainer) {
93
94 int id = muonReceiverObj->GetID() & 0xFFF;
95 ATH_MSG_INFO( "+-- Identifier of module: 0x" <<MSG::hex<< id <<MSG::dec<< " ros:" << (id>>8) << " module:"<< (id&0xFF));
96
97 // -- read thresholds
98 const std::vector<float> & thresh = muonReceiverObj->GetThresholds();
99 if (thresh.size()>=4)
100 ATH_MSG_INFO( "--- thresholds' vector size : " << thresh.size() << " value: " << thresh[0] << " " << thresh[1] << " " << thresh[2] << " " << thresh[3] );
101 else
102 ATH_MSG_DEBUG( "--- thresholds' vector size : " << thresh.size() );
103
104 // -- read energy
105 const std::vector<float> & ene = muonReceiverObj->GetEne();
106 if (ene.size()==2)
107 ATH_MSG_INFO( "--- energy vector size : " << ene.size() << " value: " << ene[0] << " " << ene[1] );
108 else
109 ATH_MSG_DEBUG( "--- energy vector size : " << ene.size() );
110
111 // -- read time
112 const std::vector<float> & time = muonReceiverObj->GetTime();
113 if (time.size()>=2)
114 ATH_MSG_INFO( "--- time vector size : " << time.size() << " value: " << time[0] << " " << time[1] );
115 else
116 ATH_MSG_DEBUG( "--- time vector size : " << time.size() );
117
118 // -- read decision
119 const std::vector<bool> & decision = muonReceiverObj->GetDecision();
120 if (decision.size()>=4)
121 ATH_MSG_INFO( "--- decision vector size : " << decision.size()
122 << " value: " << decision[0] << " " << decision[1] << " " << decision[2] << " " << decision[3] );
123 else
124 ATH_MSG_DEBUG( "--- decision vector size : " << decision.size() );
125 }
126 } else {
127 ATH_MSG_INFO("Container " << m_muonReceiverContainerKey.key() << " not found") ;
128 }
129
130 SG::ReadHandle<TileRawChannelContainer> rawChannelContainer(m_rawChannelContainerKey);
131 if (rawChannelContainer.isValid()) {
132
133 const float TMDB_AMPLITUDE_FACTOR = 1.0;
134
135 ATH_MSG_INFO( "Reading the TileRawChannelContainer: " << m_rawChannelContainerKey.key());
136
137 for (const TileRawChannelCollection* rawChannelCollection : *rawChannelContainer) {
138
139 for(const TileRawChannel* rawChannel : *rawChannelCollection) {
140 int frag_id = rawChannelCollection->identify();
141 int ros=frag_id>>8;
142 int drawer=(frag_id&0xFF);
143
144 HWIdentifier hwid = rawChannel->adc_HWID() ;
145 int channel = m_tileHWID->channel(hwid) ;
146 ATH_MSG_INFO("+-- hwid : " << m_tileHWID->to_string(hwid,-1)) ;
147 ATH_MSG_INFO("---- channel: " << channel
148 << " ros: " << ros
149 << " drawer: " << drawer
150 << " E[MeV]: " << lround(rawChannel->amplitude()*TMDB_AMPLITUDE_FACTOR));
151 }
152 }
153 } else {
154 ATH_MSG_INFO("Container " << m_rawChannelContainerKey.key() << " not found") ;
155 }
156
157 SG::ReadHandle<TileDigitsContainer> digitsContainer(m_digitsContainerKey);
158 if (digitsContainer.isValid()) {
159
160 ATH_MSG_INFO( "Reading the TileDigitsContainer: " << m_digitsContainerKey.key());
161
162 for(const TileDigitsCollection* digitsCollection : *digitsContainer) {
163
164 for (const TileDigits* tile_digits : *digitsCollection) {
165
166 int frag_id = digitsCollection->identify();
167 int ros=frag_id>>8;
168 int drawer=(frag_id&0xFF);
169
170 HWIdentifier hwid = tile_digits->adc_HWID() ;
171 int channel = m_tileHWID->channel(hwid) ;
172 ATH_MSG_INFO("+-- hwid : " << m_tileHWID->to_string(hwid,-1)) ;
173 ATH_MSG_INFO("---- channel : " << channel << " ros: " << ros << " drawer: " << drawer);
174 const std::vector<float> digits = tile_digits->samples();
175 for (uint ismp=0;ismp<digits.size();ismp++)
176 ATH_MSG_INFO( "----- sample " << ismp << ": " << digits.at(ismp));
177 }
178 }
179 } else {
180 ATH_MSG_INFO("Container " << m_digitsContainerKey.key() << " not found") ;
181 }
182
183 // Execution completed.
184 ATH_MSG_INFO( "TileMuonReceiverReadCnt execution completed successfully" );
185
186 return StatusCode::SUCCESS;
187}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
unsigned int uint
SG::ReadHandleKey< TileMuonReceiverContainer > m_muonReceiverContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
time(flags, cells_name, *args, **kw)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode TileMuonReceiverReadCnt::finalize ( )

Definition at line 189 of file TileMuonReceiverReadCnt.cxx.

189 {
190
191 ATH_MSG_INFO( "TileMuonReceiverReadCnt::finalize()" );
192
193 return StatusCode::SUCCESS;
194}

◆ initialize()

StatusCode TileMuonReceiverReadCnt::initialize ( )

Definition at line 60 of file TileMuonReceiverReadCnt.cxx.

60 {
61
62 // retrieve TileID helper from det store
65
66 ATH_CHECK( m_digitsContainerKey.initialize() );
67 ATH_CHECK( m_rawChannelContainerKey.initialize() );
69
70 ATH_MSG_INFO( "TileMuonReceiverReadCnt initialization completed" );
71
72 return StatusCode::SUCCESS;
73}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

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

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

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

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_digitsContainerKey

SG::ReadHandleKey<TileDigitsContainer> TileMuonReceiverReadCnt::m_digitsContainerKey
private
Initial value:
{this,"TileDigitsContainer",
"MuRcvDigitsCnt", "Input Tile digits container key"}

Definition at line 56 of file TileMuonReceiverReadCnt.h.

56 {this,"TileDigitsContainer",
57 "MuRcvDigitsCnt", "Input Tile digits container key"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_muonReceiverContainerKey

SG::ReadHandleKey<TileMuonReceiverContainer> TileMuonReceiverReadCnt::m_muonReceiverContainerKey
private
Initial value:
{this,"TileMuonReceiverContainer",
"TileMuRcvCnt",
"Input Tile muon receiver container key"}

Definition at line 63 of file TileMuonReceiverReadCnt.h.

63 {this,"TileMuonReceiverContainer",
64 "TileMuRcvCnt",
65 "Input Tile muon receiver container key"};

◆ m_rawChannelContainerKey

SG::ReadHandleKey<TileRawChannelContainer> TileMuonReceiverReadCnt::m_rawChannelContainerKey
private
Initial value:
{this,"TileRawChannelContainer",
"MuRcvRawChCnt",
"Input Tile raw channel container key"}

Definition at line 59 of file TileMuonReceiverReadCnt.h.

59 {this,"TileRawChannelContainer",
60 "MuRcvRawChCnt",
61 "Input Tile raw channel container key"};

◆ m_tileHWID

const TileHWID* TileMuonReceiverReadCnt::m_tileHWID
private

Definition at line 70 of file TileMuonReceiverReadCnt.h.

◆ m_tileID

const TileID* TileMuonReceiverReadCnt::m_tileID
private

Definition at line 69 of file TileMuonReceiverReadCnt.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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