31 return StatusCode::SUCCESS;
40 if ( not caloLumiBCIDHandle.
isValid() ) {
41 ATH_MSG_DEBUG(
"Found invalid read handle for CaloBCIDAverage");
42 return StatusCode::FAILURE;
47 if ( not cellsHandle.isValid() ) {
49 return StatusCode::FAILURE;
53 ATH_MSG_DEBUG(
"Got a CaloCellContainer input with size : "<<scells_from_sg->
size());
56 auto new_scell_cont = std::make_unique<CaloCellContainer> ();
58 new_scell_cont->reserve(scells_from_sg->
size());
60 for(
const auto *
sc : *scells_from_sg){
62 std::unique_ptr<CaloCell> cell =
sc->clone();
65 float correction(0.0);
66 std::vector<Identifier> ids =
m_scidtool->superCellToOfflineID(
sc->ID() );
67 for (
auto id : ids ) correction+=caloLumiBCID->
average(
id); ;
68 cell->setEnergy(
sc->energy() - correction );
69 new_scell_cont->push_back( std::move(cell) );
73 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
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.
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.
StatusCode execute(const EventContext &context) const
LArSuperCellBCIDEmAlg(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< ICaloSuperCellIDTool > m_scidtool
Property: Offline / supercell mapping tool.
SG::WriteHandleKey< CaloCellContainer > m_sCellContainerOutKey
Property: SG key for the output supercell LAr channel container.
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())