33 return StatusCode::SUCCESS;
44 if ( not caloLumiBCIDHandle.
isValid() ) {
45 ATH_MSG_DEBUG(
"Found invalid read handle for CaloBCIDAverage");
46 return StatusCode::FAILURE;
51 if ( not cellsHandle.isValid() ) {
53 return StatusCode::FAILURE;
58 ATH_MSG_DEBUG(
"Got a CaloCellContainer input with size : "<<scells_from_sg->
size());
61 auto new_scell_cont = std::make_unique<CaloCellContainer> ();
63 new_scell_cont->reserve(scells_from_sg->
size());
65 for(
const auto *
sc : *scells_from_sg){
67 std::unique_ptr<CaloCell> cell =
sc->clone();
70 float correction(0.0);
73 correction=caloLumiBCID->
average((
size_t)hash_id);
74 cell->setEnergy(
sc->energy() - correction );
75 new_scell_cont->push_back( std::move(cell) );
79 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
float average(const Identifier &id) const
Container class for CaloCell.
size_type size() const noexcept
Returns the number of elements in the collection.
This is a "hash" representation of an Identifier.
StatusCode execute(const EventContext &context) const
SG::WriteHandleKey< CaloCellContainer > m_sCellContainerOutKey
Property: SG key for the output supercell LAr channel container.
LArSuperCellBCIDAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Property SG Key for the OnOffMapping.
SG::ReadHandleKey< CaloBCIDAverage > m_bcidAvgKey
Property SG Key for the CaloLumiBCID.
SG::ReadHandleKey< CaloCellContainer > m_sCellContainerInKey
Property: SG key for the input calorimeter cell container.
const LArOnline_SuperCellID * m_laronline_id
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.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())