ATLAS Offline Software
Loading...
Searching...
No Matches
TileCellIDCToCell.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5//*****************************************************************************
6// Filename : TileCellIDCToCell.cxx
7// Author : Alexandre Solodkov
8// Created : Jan, 2003
9//
10// DESCRIPTION:
11// Implementation comments only. Class level comments go in .h file.
12//
13// HISTORY:
14//
15// BUGS:
16//
17//*****************************************************************************
18
19
20#include "TileCellIDCToCell.h"
21
22
23// access all Cells inside container
26
27// Calo includes
30
31// Tile includes
35#include "TileEvent/TileCell.h"
36
37
38//
39// Constructor
40//
41TileCellIDCToCell::TileCellIDCToCell(const std::string& name, ISvcLocator* pSvcLocator)
42 : AthAlgorithm(name, pSvcLocator)
43{
44}
45
48
49//****************************************************************************
50//* Initialization
51//****************************************************************************
52
54{
55
56 // retrieve Tile detector manager, TileID helper and TileIfno from det store
57 CHECK( detStore()->retrieve(m_tileMgr) );
58 CHECK( detStore()->retrieve(m_tileID) );
59 CHECK( detStore()->retrieve(m_tileInfo, m_infoName.value()) );
60
61 ATH_MSG_INFO( "TileCellIDCToCell initialization completed" );
62
63 return StatusCode::SUCCESS;
64}
65
66
67//****************************************************************************
68//* Execution
69//****************************************************************************
70
71StatusCode TileCellIDCToCell::execute(const EventContext& /*ctx*/)
72{
73
74 /* zero all counters and sums */
75 int nCell = 0;
76 float eCellTot = 0.0;
77
79
80 //**
81 //* Get TileCells from TileIDC
82 //**
83 const TileCellIDC* inputCells;
84
85 if (evtStore()->retrieve(inputCells, m_cellIDC.value()).isFailure() ) {
86
87 ATH_MSG_WARNING( " Could not find container " << m_cellIDC.value() );
88 ATH_MSG_WARNING( " creating empty cell container " );
89
90 } else {
91
92 SelectAllObject<TileCellIDC> selAll(inputCells);
93 SelectAllObject<TileCellIDC>::const_iterator inpItr=selAll.begin();
94 SelectAllObject<TileCellIDC>::const_iterator end=selAll.end();
95
96 TileCell * c;
97 const TileCell * cinp;
98
99 //**
100 //* Iterate over cells, creating new TileCells
101 //* Add each TileCell to the CaloCellContainer.
102 //**
103
104 for( ; inpItr != end; ++inpItr) {
105
106 cinp = (*inpItr);
107
108 ++nCell;
109 eCellTot += cinp->energy();
110
111 c = new TileCell( cinp );
112 cells->push_back( c );
113
114 ATH_MSG_VERBOSE( "TileCellIDCToCell: cell_id="
115 << m_tileID->to_string(cinp->subcalo_hash(),-2)
116 << " nCell=" << nCell << " energy=" << cinp->energy());
117 }
118 }
119
120 /* Register the set of TileCells to the event store. */
121
122 CHECK( evtStore()->record(cells, m_cellContainer.value(), false ) );
123
124 // Execution completed.
125 ATH_MSG_DEBUG( "TileCellIDCToCell execution completed." );
126 ATH_MSG_DEBUG( " nCell=" << nCell << " eneTot=" << eCellTot );
127
128 ATH_MSG_VERBOSE( "TileCell container registered to the TES with name"
129 << m_cellContainer.value() );
130
131 return StatusCode::SUCCESS;
132}
133
134//************************************************************************
135
136
137//****************************************************************************
138//* Finalize
139//****************************************************************************
140
142{
143
144 ATH_MSG_INFO( "TileCellIDCToCell::finalize() end" );
145
146 return StatusCode::SUCCESS;
147}
148
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
SelectAllObjectMT< DCC, OBJECT > SelectAllObject
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
Container class for CaloCell.
double energy() const
get energy (data member)
Definition CaloCell.h:327
const_iterator end()
const_iterator begin()
const TileID * m_tileID
const TileDetDescrManager * m_tileMgr
Gaudi::Property< std::string > m_infoName
Gaudi::Property< std::string > m_cellIDC
const TileInfo * m_tileInfo
TileCellIDCToCell(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< std::string > m_cellContainer
StatusCode execute(const EventContext &ctx)
Execute method.
IdentifierHash subcalo_hash(void) const
get subcalo hash for TileCal cells
Definition TileCell.h:222