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

This class creates ntuple with calibration hits info. More...

#include <TileCalibHitNtuple.h>

Inheritance diagram for TileCalibHitNtuple:
Collaboration diagram for TileCalibHitNtuple:

Public Member Functions

 TileCalibHitNtuple (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor.
virtual ~TileCalibHitNtuple ()
 Destructor.
virtual StatusCode initialize ()
 intialize method
virtual StatusCode finalize ()
 finalize method
void storeHit (int det, int mod, int tow, int samp, int reg, int calc, int evt, float x, float y, float z, float e, const char *volume=0, int pid=0, float ekine=0., float xLocal=0., float yLocal=0., float zLocal=0., float phiLocal=0.)
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 ()
 AlgTool 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< 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< ITHistSvc > m_thistSvc
std::string m_streamName
std::string m_ntupleID
int64_t m_treeSize
TTree * m_ntuplePtr
int m_level
short m_det
short m_mod
short m_tow
short m_samp
short m_reg
short m_calc
short m_evt
float m_xPos
float m_yPos
float m_zPos
float m_ener
char m_volume [100]
short m_pid
float m_ekine
float m_xLocal
float m_yLocal
float m_zLocal
float m_phiLocal
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 creates ntuple with calibration hits info.

Definition at line 39 of file TileCalibHitNtuple.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

◆ TileCalibHitNtuple()

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

Constructor.

Definition at line 25 of file TileCalibHitNtuple.cxx.

26 : AthAlgTool(type, name, parent),
27 m_thistSvc("THistSvc", name),
28 m_streamName("AANT"),
29 m_ntupleID("TileCalibHit"),
30 m_treeSize(16000000000LL),
31 m_ntuplePtr(0),
32 m_level(0),
33 m_det(0),
34 m_mod(0),
35 m_tow(0),
36 m_samp(0),
37 m_reg(0),
38 m_calc(0),
39 m_evt(0),
40 m_xPos(0.0),
41 m_yPos(0.0),
42 m_zPos(0.0),
43 m_ener(0.0),
44 m_volume{0},
45 m_pid(0),
46 m_ekine(0.0),
47 m_xLocal(0.0),
48 m_yLocal(0.0),
49 m_zLocal(0.0),
50 m_phiLocal(0.0)
51
52{
53
54 declareInterface<TileCalibHitNtuple>(this);
55
56 declareProperty("THistSvc", m_thistSvc);
57 declareProperty("StreamName", m_streamName);
58 declareProperty("NTupleID", m_ntupleID);
59 declareProperty("TreeSize", m_treeSize);
60 declareProperty("InfoLevel", m_level);
61
62}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< ITHistSvc > m_thistSvc

◆ ~TileCalibHitNtuple()

TileCalibHitNtuple::~TileCalibHitNtuple ( )
virtual

Destructor.

Definition at line 67 of file TileCalibHitNtuple.cxx.

67 {
68}

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 }

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

finalize method

Finalizer.

Definition at line 115 of file TileCalibHitNtuple.cxx.

115 {
116
117 ATH_MSG_INFO("Finalizing");
118
119 return StatusCode::SUCCESS;
120}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode TileCalibHitNtuple::initialize ( )
virtual

intialize method

Initializer.

Definition at line 73 of file TileCalibHitNtuple.cxx.

73 {
74
75 ATH_MSG_INFO("in initialize()");
76
77 CHECK(m_thistSvc.retrieve());
78
79 m_ntuplePtr = new TTree(m_ntupleID.c_str(), "TileCalibHit-Ntuple");
80 m_ntuplePtr->SetMaxTreeSize(m_treeSize);
81
82 m_ntuplePtr->Branch("detector", &m_det, "detector/S");
83 m_ntuplePtr->Branch("module", &m_mod, "module/S");
84 m_ntuplePtr->Branch("tower", &m_tow, "tower/S");
85 m_ntuplePtr->Branch("sample", &m_samp, "sample/S");
86 m_ntuplePtr->Branch("region", &m_reg, "region/S");
87 m_ntuplePtr->Branch("IDcalc", &m_calc, "IDcalc/S");
88 m_ntuplePtr->Branch("event", &m_evt, "event/S");
89 m_ntuplePtr->Branch("xPos", &m_xPos, "xPos/F");
90 m_ntuplePtr->Branch("yPos", &m_yPos, "yPos/F");
91 m_ntuplePtr->Branch("zPos", &m_zPos, "zPos/F");
92 m_ntuplePtr->Branch("energy", &m_ener, "energy/F");
93 if (m_level != 0) {
94 m_ntuplePtr->Branch("volume", &m_volume, "volume/C");
95 m_ntuplePtr->Branch("pid", &m_pid, "pid/S");
96 m_ntuplePtr->Branch("ekine", &m_ekine, "ekine/F");
97 m_ntuplePtr->Branch("xLocal", &m_xLocal, "xLocal/F");
98 m_ntuplePtr->Branch("yLocal", &m_yLocal, "yLocal/F");
99 m_ntuplePtr->Branch("zLocal", &m_zLocal, "zLocal/F");
100 m_ntuplePtr->Branch("phiLocal", &m_phiLocal, "phiLocal/F");
101 }
102
103 StatusCode sc = m_thistSvc->regTree("/" + m_streamName + "/" + m_ntupleID, m_ntuplePtr);
104
105 if (sc.isFailure()) {
106 ATH_MSG_ERROR("Problem registering TileCalibHit Tree");
107 }
108
109 return sc;
110}
#define ATH_MSG_ERROR(x)
#define CHECK(...)
Evaluate an expression and check for errors.
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

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

AlgTool InterfaceID.

Definition at line 18 of file TileCalibHitNtuple.cxx.

18 {
20}
static const InterfaceID IID_ITileCalibHitNtuple("TileCalibHitNtuple", 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 }

◆ storeHit()

void TileCalibHitNtuple::storeHit ( int det,
int mod,
int tow,
int samp,
int reg,
int calc,
int evt,
float x,
float y,
float z,
float e,
const char * volume = 0,
int pid = 0,
float ekine = 0.,
float xLocal = 0.,
float yLocal = 0.,
float zLocal = 0.,
float phiLocal = 0. )

Definition at line 122 of file TileCalibHitNtuple.cxx.

124 {
125 m_det = det;
126 m_mod = mod;
127 m_tow = tow;
128 m_samp = samp;
129 m_reg = reg;
130 m_calc = calc;
131 m_evt = evt;
132 m_xPos = x;
133 m_yPos = y;
134 m_zPos = z;
135 m_ener = e;
136 if (m_level != 0) {
137 if (volume) strncpy(m_volume, volume, 99);
138 else m_volume[0] = 0;
139 m_pid = pid;
140 m_ekine = ekine;
141 m_xLocal = xLocal;
142 m_yLocal = yLocal;
143 m_zLocal = zLocal;
144 m_phiLocal = phiLocal;
145 }
146
147 m_ntuplePtr->Fill();
148}
#define y
#define x
#define z

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

short TileCalibHitNtuple::m_calc
private

Definition at line 76 of file TileCalibHitNtuple.h.

◆ m_det

short TileCalibHitNtuple::m_det
private

Definition at line 71 of file TileCalibHitNtuple.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_ekine

float TileCalibHitNtuple::m_ekine
private

Definition at line 84 of file TileCalibHitNtuple.h.

◆ m_ener

float TileCalibHitNtuple::m_ener
private

Definition at line 81 of file TileCalibHitNtuple.h.

◆ m_evt

short TileCalibHitNtuple::m_evt
private

Definition at line 77 of file TileCalibHitNtuple.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_level

int TileCalibHitNtuple::m_level
private

Definition at line 68 of file TileCalibHitNtuple.h.

◆ m_mod

short TileCalibHitNtuple::m_mod
private

Definition at line 72 of file TileCalibHitNtuple.h.

◆ m_ntupleID

std::string TileCalibHitNtuple::m_ntupleID
private

Definition at line 62 of file TileCalibHitNtuple.h.

◆ m_ntuplePtr

TTree* TileCalibHitNtuple::m_ntuplePtr
private

Definition at line 66 of file TileCalibHitNtuple.h.

◆ m_phiLocal

float TileCalibHitNtuple::m_phiLocal
private

Definition at line 88 of file TileCalibHitNtuple.h.

◆ m_pid

short TileCalibHitNtuple::m_pid
private

Definition at line 83 of file TileCalibHitNtuple.h.

◆ m_reg

short TileCalibHitNtuple::m_reg
private

Definition at line 75 of file TileCalibHitNtuple.h.

◆ m_samp

short TileCalibHitNtuple::m_samp
private

Definition at line 74 of file TileCalibHitNtuple.h.

◆ m_streamName

std::string TileCalibHitNtuple::m_streamName
private

Definition at line 61 of file TileCalibHitNtuple.h.

◆ m_thistSvc

ServiceHandle<ITHistSvc> TileCalibHitNtuple::m_thistSvc
private

Definition at line 58 of file TileCalibHitNtuple.h.

◆ m_tow

short TileCalibHitNtuple::m_tow
private

Definition at line 73 of file TileCalibHitNtuple.h.

◆ m_treeSize

int64_t TileCalibHitNtuple::m_treeSize
private

Definition at line 63 of file TileCalibHitNtuple.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_volume

char TileCalibHitNtuple::m_volume[100]
private

Definition at line 82 of file TileCalibHitNtuple.h.

◆ m_xLocal

float TileCalibHitNtuple::m_xLocal
private

Definition at line 85 of file TileCalibHitNtuple.h.

◆ m_xPos

float TileCalibHitNtuple::m_xPos
private

Definition at line 78 of file TileCalibHitNtuple.h.

◆ m_yLocal

float TileCalibHitNtuple::m_yLocal
private

Definition at line 86 of file TileCalibHitNtuple.h.

◆ m_yPos

float TileCalibHitNtuple::m_yPos
private

Definition at line 79 of file TileCalibHitNtuple.h.

◆ m_zLocal

float TileCalibHitNtuple::m_zLocal
private

Definition at line 87 of file TileCalibHitNtuple.h.

◆ m_zPos

float TileCalibHitNtuple::m_zPos
private

Definition at line 80 of file TileCalibHitNtuple.h.


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