ATLAS Offline Software
HLTCaloCellSumMaker.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #include "HLTCaloCellSumMaker.h"
6 
7 
11  return StatusCode::SUCCESS;
12 }
13 
14 
15 StatusCode HLTCaloCellSumMaker::execute( const EventContext& context ) const {
16 
17  if ( m_roiMode ) {
18  auto roiCollection = SG::makeHandle( m_cellContainerKey, context );
19  if ( !roiCollection.isValid() ){
20  ATH_MSG_INFO( "empty container");
21  return StatusCode::SUCCESS;
22  }
23  float sum=0.;
24  for(auto c : *roiCollection ) {sum+=c->et();}
25  ATH_MSG_DEBUG ( "REGTEST: Executing " << name() << "... size : " << roiCollection->size() << "; Energy Et Sum : " << sum );
26 
27  } else {
28  auto roiCollection= SG::makeHandle( m_cellContainerVKey, context );
29  for(const CaloCellContainer* roiDescriptor : *roiCollection ) {
30  if ( !roiDescriptor->empty() ) {
31  float sum=0.;
32  for(auto c : *roiDescriptor ) {sum+=c->et();}
33  ATH_MSG_DEBUG("REGTEST: Executing " << name() << "; size : " << roiDescriptor->size() << "; Energy ET Sum : " << sum );
34  } else { ATH_MSG_INFO( "empty container"); }
35  }
36  }
37  return StatusCode::SUCCESS;
38 }
HLTCaloCellSumMaker.h
HLTCaloCellSumMaker::m_cellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
Definition: HLTCaloCellSumMaker.h:31
HLTCaloCellSumMaker::execute
virtual StatusCode execute(const EventContext &context) const override
Definition: HLTCaloCellSumMaker.cxx:15
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
HLTCaloCellSumMaker::m_roiMode
Gaudi::Property< bool > m_roiMode
Definition: HLTCaloCellSumMaker.h:34
HLTCaloCellSumMaker::m_cellContainerVKey
SG::ReadHandleKey< ConstDataVector< CaloCellContainerVector > > m_cellContainerVKey
Definition: HLTCaloCellSumMaker.h:28
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
HLTCaloCellSumMaker::initialize
virtual StatusCode initialize() override
Definition: HLTCaloCellSumMaker.cxx:8
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
python.compressB64.c
def c
Definition: compressB64.py:93