ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloUtils
src
CaloTowerBuilderToolBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "GaudiKernel/Service.h"
6
#include "GaudiKernel/ServiceHandle.h"
7
#include "GaudiKernel/IIncidentSvc.h"
8
#include "GaudiKernel/TypeNameString.h"
9
10
#include "
AthenaKernel/errorcheck.h
"
11
12
#include "
CaloUtils/CaloTowerBuilderToolBase.h
"
13
14
CaloTowerBuilderToolBase::CaloTowerBuilderToolBase
(
const
std::string& name,
15
const
std::string&
type
,
const
IInterface* parent)
16
:
AthAlgTool
(name,
type
, parent)
17
,
m_cellContainerName
(
"AllCalo"
)
18
{
19
20
// common properties
21
declareProperty
(
"CellContainerName"
,
m_cellContainerName
);
22
declareInterface<ICaloTowerBuilderToolBase>(
this
);
23
}
24
25
CaloTowerBuilderToolBase::~CaloTowerBuilderToolBase
()
26
=
default
;
27
28
StatusCode CaloTowerBuilderToolBase::initialize
ATLAS_NOT_THREAD_SAFE
() {
29
if
(!m_cellContainerName.key().empty()) {
30
ATH_CHECK
( m_cellContainerName.initialize() );
31
}
32
ATH_CHECK
(m_caloMgrKey.initialize());
33
// invoke internal initialization
34
return
this->initializeTool();
35
}
36
37
void
CaloTowerBuilderToolBase::setTowerSeg
(
const
CaloTowerSeg
& theTowerSeg) {
38
39
ATH_MSG_DEBUG
(
" in CaloTowerBuilderToolBase::setTowerSeg "
);
40
m_theTowerSeg
= theTowerSeg;
41
ATH_MSG_DEBUG
(
" neta,nphi,etamin,etamax "
<< theTowerSeg.
neta
()
42
<<
" "
<< theTowerSeg.
nphi
() <<
" "
<< theTowerSeg.
etamin
()
43
<<
" "
<< theTowerSeg.
etamax
());
44
}
45
46
50
const
CaloTowerSeg
&
CaloTowerBuilderToolBase::towerSeg
()
const
51
{
52
return
m_theTowerSeg
;
53
}
54
55
59
const
CaloCellContainer
*
CaloTowerBuilderToolBase::getCells
()
const
60
{
61
const
CaloCellContainer
* cells =
nullptr
;
62
if
(!
m_cellContainerName
.key().empty()) {
63
cells =
SG::get
(
m_cellContainerName
);
64
if
(!cells) {
65
ATH_MSG_WARNING
(
"no CaloCellContainer with key <"
66
<<
m_cellContainerName
.key() <<
"> found, skip tool!"
);
67
68
}
69
}
70
return
cells;
71
}
72
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ATLAS_NOT_THREAD_SAFE
StatusCode CaloTowerBuilderToolBase::initialize ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
Definition
CaloTowerBuilderToolBase.cxx:28
CaloTowerBuilderToolBase.h
errorcheck.h
Helpers for checking error return status codes and reporting errors.
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloTowerBuilderToolBase::~CaloTowerBuilderToolBase
virtual ~CaloTowerBuilderToolBase()
CaloTowerBuilderToolBase::m_theTowerSeg
CaloTowerSeg m_theTowerSeg
Definition
CaloTowerBuilderToolBase.h:99
CaloTowerBuilderToolBase::towerSeg
const CaloTowerSeg & towerSeg() const
Return the tower segmentation.
Definition
CaloTowerBuilderToolBase.cxx:50
CaloTowerBuilderToolBase::setTowerSeg
virtual void setTowerSeg(const CaloTowerSeg &theTowerSeg) override
Definition
CaloTowerBuilderToolBase.cxx:37
CaloTowerBuilderToolBase::CaloTowerBuilderToolBase
CaloTowerBuilderToolBase(const std::string &name, const std::string &type, const IInterface *parent)
AlgTool constructor.
Definition
CaloTowerBuilderToolBase.cxx:14
CaloTowerBuilderToolBase::m_cellContainerName
SG::ReadHandleKey< CaloCellContainer > m_cellContainerName
Definition
CaloTowerBuilderToolBase.h:92
CaloTowerBuilderToolBase::getCells
const CaloCellContainer * getCells() const
Retrieve cells from StoreGate.
Definition
CaloTowerBuilderToolBase.cxx:59
CaloTowerSeg
Data object stores CaloTower segmentation.
Definition
CaloTowerSeg.h:37
CaloTowerSeg::nphi
index_t nphi() const
Retrieve number of bins.
Definition
CaloTowerSeg.h:428
CaloTowerSeg::neta
index_t neta() const
Retrieve number of bins.
Definition
CaloTowerSeg.h:423
CaloTowerSeg::etamin
double etamin() const
Retrieve lower boundary value range.
Definition
CaloTowerSeg.h:443
CaloTowerSeg::etamax
double etamax() const
Retrieve upper boundary value range.
Definition
CaloTowerSeg.h:448
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition
ReadCondHandle.h:282
type
Generated on
for ATLAS Offline Software by
1.17.0