 |
ATLAS Offline Software
|
Go to the documentation of this file.
20 , m_inputCellContainerKey(
"AllCalo")
21 , m_cellThresholdE(std::numeric_limits<
float>::
min())
22 , m_filterCells(false)
49 if(cellToTower.empty()) {
51 return StatusCode::FAILURE;
55 if (!inputCellContainer.
isValid()) {
56 ATH_MSG_ERROR(
"Can't retrieve CaloCellContainer with key " << inputCellContainer.
name() );
57 return StatusCode::FAILURE;
62 if (!caloTowerContainer.
isValid())
63 return StatusCode::FAILURE;
65 const size_t nCell2Tower=cellToTower.size();
66 if (nCell2Tower<inputCellContainer->
size()) {
67 ATH_MSG_ERROR(
"Number of cells larger than size of internal cell2tower cache. nCells="
68 << inputCellContainer->
size() <<
", cell2tower size=" << nCell2Tower );
69 return StatusCode::FAILURE;
78 if (!(
cellHash<cellToTower.size())) {
79 ATH_MSG_ERROR(
"Cell2Tower mapping too small " << cellToTower.size() <<
", expected at least" <<
cellHash );
80 return StatusCode::FAILURE;
82 const auto& c2ts=cellToTower[
cellHash];
85 if (c2t.m_towerIdx > caloTowerContainer->
size()) {
86 ATH_MSG_ERROR(
"Tower container size too small " << caloTowerContainer->
size() <<
", expected at least" << c2t.m_towerIdx );
87 return StatusCode::FAILURE;
89 (*caloTowerContainer)[c2t.m_towerIdx]->addEnergy(
cell->e()*c2t.m_weight);
95 return StatusCode::SUCCESS;
99 {
return StatusCode::SUCCESS; }
CaloTowerxAODFromCells(const std::string &name, ISvcLocator *pSvcLocator)
Default algorithm constructor.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::string & name() const
Return the StoreGate ID for the referenced object.
const CellToTowerVec & getIndexCache(const EventContext &ctx) const
SG::ReadHandleKey< CaloCellContainer > m_inputCellContainerKey
double m_cellThresholdE
Cell energy threshold (only for FilteredCell mode)
std::vector< std::vector< cellToTower_t > > CellToTowerVec
virtual StatusCode execute(const EventContext &ctx) const override
Execute algorithm.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::WriteHandle< xAOD::CaloTowerContainer > makeContainer(const EventContext &ctx) const
Intialize m_cellToTower cache.
CaloPhiRange class declaration.
virtual StatusCode initialize() override
Initialize algorithm.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Data object for each calorimeter readout cell.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode finalize() override
Finalize algorithm.
virtual ~CaloTowerxAODFromCells()
Baseclass destructor.