ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
13
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
26= default;
27
28StatusCode 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
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
54
55
60{
61 const CaloCellContainer* cells = nullptr;
62 if (!m_cellContainerName.key().empty()) {
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
StatusCode CaloTowerBuilderToolBase::initialize ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
Helpers for checking error return status codes and reporting errors.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Container class for CaloCell.
virtual ~CaloTowerBuilderToolBase()
const CaloTowerSeg & towerSeg() const
Return the tower segmentation.
virtual void setTowerSeg(const CaloTowerSeg &theTowerSeg) override
CaloTowerBuilderToolBase(const std::string &name, const std::string &type, const IInterface *parent)
AlgTool constructor.
SG::ReadHandleKey< CaloCellContainer > m_cellContainerName
const CaloCellContainer * getCells() const
Retrieve cells from StoreGate.
Data object stores CaloTower segmentation.
index_t nphi() const
Retrieve number of bins.
index_t neta() const
Retrieve number of bins.
double etamin() const
Retrieve lower boundary value range.
double etamax() const
Retrieve upper boundary value range.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.