32 ISvcLocator* pSvcLocator)
60 ATH_MSG_ERROR(
"Could not access CaloCell_SuperCell_ID helper");
61 return StatusCode::FAILURE;
63 ATH_MSG_DEBUG(
"Successfully accessed CaloCell_SuperCell_ID helper");
66 return StatusCode::SUCCESS;
82 return StatusCode::FAILURE;
88 return StatusCode::FAILURE;
95 dd_mgr = *caloSuperCellMgrHandle;
100 dd_mgr = *caloMgrHandle;
105 std::vector< std::pair<float,float> > energy_time;
109 energy_time.assign(
max,std::pair<float,float>(0.0,0.0));
110 for( ; it!=it_end;++it) {
113 const std::vector<std::pair<float,float> >& timeE = hitlist.
getData();
114 if (timeE.empty() )
continue;
119 if ( scHash.
value() == 999999 )
continue;
125 float time = (*first).second;;
126 float energy = (*first).first;
127 if ( (std::abs(time) < 13) ) {
128 energy_time[hash].first+=energy;
129 energy_time[hash].second+=(energy*time);
135 auto outputContainerCellPtr = std::make_unique<CaloCellContainer>();
139 outputContainerCellPtr->reserve(
max );
140 for(
int i=0;i<
max;i++) {
141 float energy = energy_time[i].first;
143 float time = energy_time[i].second / energy;
149 hw = cabling->createSignalChannelID(scId);
153 hw = cabling->createSignalChannelID(cellId);
158 if ( fracS->FSAMPL(hw) < 0.00001 )
continue;
159 ss->setEnergy(energy/fracS->FSAMPL(hw));
163 uint16_t prov = 0x2000;
164 ss->setProvenance(prov);
166 ss->setQuality((uint16_t)1);
168 outputContainerCellPtr->push_back(
ss);
172 ATH_CHECK(outputContainer.
record(std::move(outputContainerCellPtr) ) );
174 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helper class for offline supercell identifiers.
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
Data object for each calorimeter readout cell.
This class groups all DetDescr information related to a CaloCell.
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
a typed memory pool that saves time spent allocation small object.
void reserve(unsigned int size)
Set the desired capacity.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
unsigned int allocated()
return size already allocated OK
This is a "hash" representation of an Identifier.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Gaudi::Property< bool > m_isSC
if is SuperCell
LArHITtoCell(const std::string &name, ISvcLocator *pSvcLocator)
Standard Gaudi algorithm constructor.
const CaloIdManager * m_calo_id_manager
Entry point for calorimeter ID helpers.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::WriteHandleKey< CaloCellContainer > m_cellKey
Property Output Container.
ToolHandle< ICaloSuperCellIDTool > m_scidtool
Property: Offline / supercell mapping tool.
const CaloCell_SuperCell_ID * m_scHelper
pointer to the offline TT helper
SG::ReadCondHandleKey< ILArfSampl > m_fracSKey
Property: Fraction of Energy Sampled (conditions input).
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
SG::ReadHandleKey< LArHitEMap > m_hitMapKey
hit map
const T * retrieve(const EventContext &context, const SG::ReadCondHandleKey< T > &handleKey) const
const CaloCell_ID * m_OflHelper
pointer to the offline id helper
StatusCode initialize()
Standard Gaudi initialize method.
StatusCode execute(const EventContext &context) const
Algorithm execute method.
size_t GetNbCells(void) const
const LArHitList & GetCell(const unsigned int index) const
const LARLIST & getData() const
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.