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

Class TBCaloPosTool. More...

#include <TBCaloPosTool.h>

Inheritance diagram for TBCaloPosTool:
Collaboration diagram for TBCaloPosTool:

Public Member Functions

 TBCaloPosTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TBCaloPosTool ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual void handle (const Incident &)
virtual double eta ()
 access eta value
virtual double theta ()
 access eta value
virtual double z ()
 access eta value
virtual double delta ()
 access eta value
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
 DeclareInterfaceID (ITBCaloPosTool, 1, 0)
 Declare interface ID.

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

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

Private Attributes

const DataHandle< GenericDbTablem_etaTable
const DataHandle< GenericDbTablem_thetaTable
const DataHandle< GenericDbTablem_zTable
const DataHandle< GenericDbTablem_deltaTable
bool m_init
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

Class TBCaloPosTool.

Implementation of ITBCaloPosTool

Sept 28, 2004 Hong Ma

Definition at line 25 of file TBCaloPosTool.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

◆ TBCaloPosTool()

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

Definition at line 13 of file TBCaloPosTool.cxx.

16 :
17 AthAlgTool(type, name, parent),m_init(0)
18{
19
20 // Declare additional interface
21 declareInterface<ITBCaloPosTool>(this);
22
23}
AthAlgTool()
Default constructor:

◆ ~TBCaloPosTool()

TBCaloPosTool::~TBCaloPosTool ( )
virtual

Definition at line 26 of file TBCaloPosTool.cxx.

27{}

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

bool initHandles TBCaloPosTool::ATLAS_NOT_THREAD_SAFE ( )
private

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

◆ DeclareInterfaceID()

ITBCaloPosTool::DeclareInterfaceID ( ITBCaloPosTool ,
1 ,
0  )
inherited

Declare interface ID.

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

◆ delta()

double TBCaloPosTool::delta ( )
virtual

access eta value

Implements ITBCaloPosTool.

Definition at line 155 of file TBCaloPosTool.cxx.

156{
157 double d=0;
158 if(m_deltaTable->getNumRows() !=1 || m_deltaTable->getNumColumns()!=1) {
159 ATH_MSG_ERROR(" delta GenericDbTable has wrong dimension");
160 return 0 ;
161 }
162
163 m_deltaTable->getCell(0,0,d);
164 return d;
165}
#define ATH_MSG_ERROR(x)
const DataHandle< GenericDbTable > m_deltaTable

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

◆ eta()

double TBCaloPosTool::eta ( )
virtual

access eta value

Implements ITBCaloPosTool.

Definition at line 113 of file TBCaloPosTool.cxx.

114{
115 double e=0;
116 if(m_etaTable->getNumRows() !=1 || m_etaTable->getNumColumns()!=1) {
117 ATH_MSG_ERROR(" eta GenericDbTable has wrong dimension");
118 return 0 ;
119 }
120
121 m_etaTable->getCell(0,0,e);
122 return e;
123}
const DataHandle< GenericDbTable > m_etaTable

◆ 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 TBCaloPosTool::finalize ( )
virtual

Definition at line 30 of file TBCaloPosTool.cxx.

31{
32 return StatusCode::SUCCESS ;
33}

◆ handle()

void TBCaloPosTool::handle ( const Incident & )
virtual

Definition at line 55 of file TBCaloPosTool.cxx.

56{
57 // This should be the beginning of Run.
58
59 ATH_MSG_DEBUG ("in handle()" );
60 if(! m_init) {
61 // not yet initialized.
62 if( initHandles() ) {
63 m_init = true;
64 } else
65 {
66 ATH_MSG_ERROR ( " unable initialize DataHandle in BeginRun Incident " );
67 }
68 }
69
70 return;
71}
#define ATH_MSG_DEBUG(x)

◆ initialize()

StatusCode TBCaloPosTool::initialize ( )
virtual

Definition at line 36 of file TBCaloPosTool.cxx.

37{
38 ATH_MSG_DEBUG ("in initialize()" );
39
40 if( initHandles() ) {
41 m_init = true;
42 } else
43 { // wait for the begin run
44 // start listening to "BeginRun"
45 ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", name());
46 ATH_CHECK( incSvc.retrieve() );
47 int PRIORITY = 100;
48 incSvc->addListener(this, "BeginRun", PRIORITY);
49 }
50
51 return StatusCode::SUCCESS;
52}
#define ATH_CHECK
Evaluate an expression and check for errors.

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

◆ theta()

double TBCaloPosTool::theta ( )
virtual

access eta value

Implements ITBCaloPosTool.

Definition at line 127 of file TBCaloPosTool.cxx.

128{
129 double t=0;
130 if(m_thetaTable->getNumRows() !=1 || m_thetaTable->getNumColumns()!=1) {
131 ATH_MSG_ERROR(" theta GenericDbTable has wrong dimension");
132 return 0 ;
133 }
134
135 m_thetaTable->getCell(0,0,t);
136 return t;
137}
const DataHandle< GenericDbTable > m_thetaTable

◆ 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

◆ z()

double TBCaloPosTool::z ( )
virtual

access eta value

Implements ITBCaloPosTool.

Definition at line 141 of file TBCaloPosTool.cxx.

142{
143 double zzz=0;
144 if(m_zTable->getNumRows() !=1 || m_zTable->getNumColumns()!=1) {
145 ATH_MSG_ERROR(" z GenericDbTable has wrong dimension");
146 return 0 ;
147 }
148
149 m_zTable->getCell(0,0,zzz);
150 return zzz;
151}
const DataHandle< GenericDbTable > m_zTable

Member Data Documentation

◆ m_deltaTable

const DataHandle<GenericDbTable> TBCaloPosTool::m_deltaTable
private

Definition at line 62 of file TBCaloPosTool.h.

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

const DataHandle<GenericDbTable> TBCaloPosTool::m_etaTable
private

Definition at line 59 of file TBCaloPosTool.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_init

bool TBCaloPosTool::m_init
private

Definition at line 64 of file TBCaloPosTool.h.

◆ m_thetaTable

const DataHandle<GenericDbTable> TBCaloPosTool::m_thetaTable
private

Definition at line 60 of file TBCaloPosTool.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.

◆ m_zTable

const DataHandle<GenericDbTable> TBCaloPosTool::m_zTable
private

Definition at line 61 of file TBCaloPosTool.h.


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