27#include "CaloDetDescr/CaloDetDescrElement.h"
65 ATH_MSG_INFO(
"TileHitToCell initialisation completed" );
67 return StatusCode::SUCCESS;
89 double eCellTot = 0.0;
92 unsigned int nCellMax =
m_tileMgr->tile_cell_size();
93 std::vector<double> enePmt1;
94 std::vector<double> enePmt2;
95 enePmt1.resize(nCellMax);
96 enePmt2.resize(nCellMax);
99 SelectAllObject<TileHitContainer>::const_iterator hitItr = selAll.
begin();
100 SelectAllObject<TileHitContainer>::const_iterator lastHit = selAll.
end();
105 for (; hitItr != lastHit; ++hitItr) {
119 m_tileID->get_hash(cell_id, cellHash_id, &cellContext);
122 double eHit = (*hitItr)->energy();
123 double fact = samplingFraction->getSamplingFraction(drawerIdx, channel);
124 double eCell = eHit * fact;
134 enePmt1[cellHash_id] = eCell;
137 enePmt2[cellHash_id] = eCell;
141 <<
" nChan=" << nChan
142 <<
" pmt_id=" <<
m_tileID->to_string(pmt_id, -1)
144 <<
" nCell=" << nCell
145 <<
" cell_id=" <<
m_tileID->to_string(cell_id, -2)
146 <<
" eCell=" << eCell );
152 ATH_CHECK( cellContainer.
record(std::make_unique<CaloCellContainer>()) );
155 for (
unsigned int i = 0; i < nCellMax; ++i) {
157 TileCell* pCell =
new TileCell(caloDDE, enePmt1[i], enePmt2[i], 0.0, 0.0, 0, 0
160 cellContainer->push_back(pCell);
165 msg(MSG::DEBUG) <<
"TileHitToCell execution completed." <<
endmsg;
166 msg(MSG::DEBUG) <<
" nChan=" << nChan
167 <<
" eHitTot=" << eHitTot
168 <<
" nCell=" << nCell
170 <<
" eneTot=" << eCellTot <<
endmsg;
175 return StatusCode::SUCCESS;
182 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
SelectAllObjectMT< DCC, OBJECT > SelectAllObject
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
This class groups all DetDescr information related to a CaloCell.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
This is a "hash" representation of an Identifier.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
const TileHWID * m_tileHWID
Pointer to TileHWID helper.
SG::WriteHandleKey< CaloCellContainer > m_cellContainerKey
virtual ~TileHitToCell()
Destructor.
virtual StatusCode finalize() override
finalize method
virtual StatusCode execute() override
execute method
virtual StatusCode initialize() override
initialize method
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
const TileID * m_tileID
Pointer to TileID helper.
TileHitToCell(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
const TileDetDescrManager * m_tileMgr
Pointer to TileDetDescrManager.