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

#include <TileCondToolMuID.h>

Inheritance diagram for TileCondToolMuID:
Collaboration diagram for TileCondToolMuID:

Public Member Functions

 TileCondToolMuID (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TileCondToolMuID ()
virtual StatusCode initialize () override
virtual StatusCode finalize () override
void getLowThreshold (Identifier &id, int &ros, int &module, int &index) const
void getHighThreshold (Identifier &id, int &ros, int &module, int &index) const
float getLowThresholdValue (Identifier id) const
float getHighThresholdValue (Identifier id) 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 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 ()

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< StoreGateSvc > StoreGateSvc_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

const CaloCell_ID * m_caloID {nullptr}
SG::ReadCondHandleKey< TileCalibDataFlt > m_calibMuIdKey
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 21 of file TileCondToolMuID.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileCondToolMuID()

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

Definition at line 28 of file TileCondToolMuID.cxx.

29 : AthAlgTool(type, name, parent)
30{
31 declareInterface<TileCondToolMuID>(this);
32}
AthAlgTool()
Default constructor:

◆ ~TileCondToolMuID()

TileCondToolMuID::~TileCondToolMuID ( )
virtual

Definition at line 36 of file TileCondToolMuID.cxx.

36 {
37}

Member Function Documentation

◆ 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 TileCondToolMuID::finalize ( )
overridevirtual

Definition at line 56 of file TileCondToolMuID.cxx.

56 {
57 ATH_MSG_DEBUG( "finalize called" );
58 return StatusCode::SUCCESS;
59}
#define ATH_MSG_DEBUG(x,...)

◆ getHighThreshold()

void TileCondToolMuID::getHighThreshold ( Identifier & id,
int & ros,
int & module,
int & index ) const

Definition at line 171 of file TileCondToolMuID.cxx.

171 {
172
173 index = ros = -999;
174 module = m_caloID->module(id);
175
176 if (m_caloID->is_tile_barrel(id) && m_caloID->is_tile_positive(id)) {
177
178 if (m_caloID->sample(id) == 0) {
179 index = m_caloID->tower(id) + 23;
180 }
181
182 if (m_caloID->sample(id) == 1) {
183 index = m_caloID->tower(id) + 10 + 23;
184 }
185
186 if (m_caloID->sample(id) == 2) {
187 index = m_caloID->tower(id) / 2 + 19 + 23;
188 }
189
190 ros = 1;
191
192 }
193
194 if (m_caloID->is_tile_barrel(id) && m_caloID->is_tile_negative(id)) {
195
196 if (m_caloID->sample(id) == 0) {
197 index = m_caloID->tower(id) + 23;
198 }
199
200 if (m_caloID->sample(id) == 1) {
201 index = m_caloID->tower(id) + 10 + 23;
202 }
203
204 if (m_caloID->sample(id) == 2) {
205 index = m_caloID->tower(id) / 2 + 19 + 23;
206 }
207
208 ros = 2;
209
210 }
211
212 if (m_caloID->is_tile_extbarrel(id) && m_caloID->is_tile_positive(id)) {
213
214 if (m_caloID->sample(id) == 0) {
215 index = m_caloID->tower(id) - 11 + 14;
216 }
217
218 if (m_caloID->sample(id) == 1) {
219 index = m_caloID->tower(id) - 4 + 14;
220 }
221
222 if (m_caloID->sample(id) == 2) {
223 index = m_caloID->tower(id) / 2 + 7 + 14;
224 }
225
226 ros = 3;
227
228 }
229
230 if (m_caloID->is_tile_gap(id) && m_caloID->is_tile_positive(id)) {
231
232 if (m_caloID->sample(id) == 1) {
233 index = 5 + 14;
234 }
235
236 if (m_caloID->sample(id) == 2) {
237 index = 11 + 14;
238 }
239
240 ros = 3;
241
242 }
243
244 if (m_caloID->is_tile_extbarrel(id) && m_caloID->is_tile_negative(id)) {
245
246 if (m_caloID->sample(id) == 0) {
247 index = m_caloID->tower(id) - 11 + 14;
248 }
249
250 if (m_caloID->sample(id) == 1) {
251 index = m_caloID->tower(id) - 4 + 14;
252 }
253
254 if (m_caloID->sample(id) == 2) {
255 index = m_caloID->tower(id) / 2 + 7 + 14;
256 }
257
258 ros = 4;
259
260 }
261
262 if (m_caloID->is_tile_gap(id) && m_caloID->is_tile_negative(id)) {
263
264 if (m_caloID->sample(id) == 1) {
265 index = 5 + 14;
266 }
267
268 if (m_caloID->sample(id) == 2) {
269 index = 11 + 14;
270 }
271
272 ros = 4;
273
274 }
275
276}
const CaloCell_ID * m_caloID
str index
Definition DeMoScan.py:362

◆ getHighThresholdValue()

float TileCondToolMuID::getHighThresholdValue ( Identifier id) const

Definition at line 308 of file TileCondToolMuID.cxx.

308 {
309
310 int ros;
311 int module;
312 int index;
313
314 getHighThreshold(id, ros, module, index);
315
316 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, module);
317
318 SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibMuID(m_calibMuIdKey);
319 int nValues = calibMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32();
320
321 if (index >= nValues) {
322 ATH_MSG_ERROR( "getHighThresholdValue: index out of range! -> ros/mod/num_values/ind "
323 << ros << " " << module << " " << nValues << " " << index );
324
325 return -999.;
326 } else {
327 ATH_MSG_DEBUG( "getHighThresholdValue: ros/mod/drawer_ind/num_values/ind " << ros << " "
328 << module << " " << drawerIdx << " " << nValues << " " << index );
329
330 return calibMuID->getCalibDrawer(drawerIdx)->getData(0, 0, index);
331
332 }
333}
#define ATH_MSG_ERROR(x,...)
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
void getHighThreshold(Identifier &id, int &ros, int &module, int &index) const
SG::ReadCondHandleKey< TileCalibDataFlt > m_calibMuIdKey

◆ getLowThreshold()

void TileCondToolMuID::getLowThreshold ( Identifier & id,
int & ros,
int & module,
int & index ) const

Definition at line 63 of file TileCondToolMuID.cxx.

63 {
64
65 module = m_caloID->module(id);
66
67 if (m_caloID->is_tile_barrel(id) && m_caloID->is_tile_positive(id)) {
68
69 if (m_caloID->sample(id) == 0) {
70 index = m_caloID->tower(id);
71 }
72
73 if (m_caloID->sample(id) == 1) {
74 index = m_caloID->tower(id) + 10;
75 }
76
77 if (m_caloID->sample(id) == 2) {
78 index = m_caloID->tower(id) / 2 + 19;
79 }
80
81 ros = 1;
82
83 }
84
85 if (m_caloID->is_tile_barrel(id) && m_caloID->is_tile_negative(id)) {
86
87 if (m_caloID->sample(id) == 0) {
88 index = m_caloID->tower(id);
89 }
90
91 if (m_caloID->sample(id) == 1) {
92 index = m_caloID->tower(id) + 10;
93 }
94
95 if (m_caloID->sample(id) == 2) {
96 index = m_caloID->tower(id) / 2 + 19;
97 }
98
99 ros = 2;
100
101 }
102
103 if (m_caloID->is_tile_extbarrel(id) && m_caloID->is_tile_positive(id)) {
104
105 if (m_caloID->sample(id) == 0) {
106 index = m_caloID->tower(id) - 11;
107 }
108
109 if (m_caloID->sample(id) == 1) {
110 index = m_caloID->tower(id) - 4;
111 }
112
113 if (m_caloID->sample(id) == 2) {
114 index = m_caloID->tower(id) / 2 + 7;
115 }
116
117 ros = 3;
118
119 }
120
121 if (m_caloID->is_tile_gap(id) && m_caloID->is_tile_positive(id)) {
122
123 if (m_caloID->sample(id) == 1) {
124 index = 5;
125 }
126
127 if (m_caloID->sample(id) == 2) {
128 index = 11;
129 }
130
131 ros = 3;
132
133 }
134
135 if (m_caloID->is_tile_extbarrel(id) && m_caloID->is_tile_negative(id)) {
136
137 if (m_caloID->sample(id) == 0) {
138 index = m_caloID->tower(id) - 11;
139 }
140
141 if (m_caloID->sample(id) == 1) {
142 index = m_caloID->tower(id) - 4;
143 }
144
145 if (m_caloID->sample(id) == 2) {
146 index = m_caloID->tower(id) / 2 + 7;
147 }
148
149 ros = 4;
150
151 }
152
153 if (m_caloID->is_tile_gap(id) && m_caloID->is_tile_negative(id)) {
154
155 if (m_caloID->sample(id) == 1) {
156 index = 5;
157 }
158
159 if (m_caloID->sample(id) == 2) {
160 index = 11;
161 }
162
163 ros = 4;
164
165 }
166
167}

◆ getLowThresholdValue()

float TileCondToolMuID::getLowThresholdValue ( Identifier id) const

Definition at line 280 of file TileCondToolMuID.cxx.

280 {
281
282 int ros;
283 int module;
284 int index;
285
286 getLowThreshold(id, ros, module, index);
287
288 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, module);
289
290 SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibMuID(m_calibMuIdKey);
291 int nValues = calibMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32();
292
293
294 if (index >= nValues) {
295 ATH_MSG_ERROR( "getLowThresholdValue: index out of range! -> ros/mod/num_values/ind "
296 << ros << " " << module << " " << nValues << " " << index );
297 return -999.;
298 } else {
299 ATH_MSG_DEBUG( "getLowThresholdValue: ros/mod/drawer_ind/num_values/ind " << ros << " "
300 << module << " " << drawerIdx << " " << nValues << " " << index );
301
302 return calibMuID->getCalibDrawer(drawerIdx)->getData(0, 0, index);
303 }
304}
void getLowThreshold(Identifier &id, int &ros, int &module, int &index) const

◆ initialize()

StatusCode TileCondToolMuID::initialize ( )
overridevirtual

Definition at line 41 of file TileCondToolMuID.cxx.

41 {
42
43 ATH_MSG_DEBUG( "In initialize()" );
44
45 //=== Initialize MuID conditions data key
46 ATH_CHECK( m_calibMuIdKey.initialize() );
47
48 // Retrieve CaloIdManager
49 ATH_CHECK( detStore()->retrieve(m_caloID) );
50
51 return StatusCode::SUCCESS;
52}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const

◆ 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 & TileCondToolMuID::interfaceID ( )
static

Definition at line 22 of file TileCondToolMuID.cxx.

22 {
24}
static const InterfaceID IID_TileCondToolMuID("TileCondToolMuID", 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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_calibMuIdKey

SG::ReadCondHandleKey<TileCalibDataFlt> TileCondToolMuID::m_calibMuIdKey
private
Initial value:
{this,
"TileMuID", "TileMuID", "Input Tile MuID constants"}

Definition at line 41 of file TileCondToolMuID.h.

41 {this,
42 "TileMuID", "TileMuID", "Input Tile MuID constants"};

◆ m_caloID

const CaloCell_ID* TileCondToolMuID::m_caloID {nullptr}
private

Definition at line 38 of file TileCondToolMuID.h.

38{nullptr};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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