ATLAS Offline Software
CaloRingerElectronsReader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // =============================================================================
7 
8 #include <algorithm>
9 
11 #include "PATCore/AcceptData.h"
12 #include "StoreGate/ReadHandle.h"
13 
14 namespace Ringer {
15 
16 // =============================================================================
18  const std::string& name,
19  const ::IInterface* parent) :
21  m_clRingsBuilderElectronFctor(nullptr)
22 {
23 
24  // declare interface
25  declareInterface<ICaloRingerElectronsReader>(this);
26 
27 }
28 
29 // =============================================================================
31 {
33 }
34 
35 // =============================================================================
37 {
38 
40 
42 
43  if ( m_builderAvailable ) {
44  // Initialize our fctor
50  this
51  );
53  }
54 
55  return StatusCode::SUCCESS;
56 
57 }
58 
59 // =============================================================================
61 {
62  return StatusCode::SUCCESS;
63 }
64 
65 // =============================================================================
67 {
68 
69  ATH_MSG_DEBUG("Entering " << name() << " execute, m_builderAvailable = " << m_builderAvailable);
70 
71  // Retrieve electrons
73  // check is only used for serial running; remove when MT scheduler used
74  if(!electrons.isValid()) {
75  ATH_MSG_FATAL("Failed to retrieve "<< m_inputElectronContainerKey.key());
76  return StatusCode::FAILURE;
77  }
78 
79  // Check if requested to run CaloRings Builder:
80  if ( m_builderAvailable ) {
81  ATH_CHECK( m_clRingsBuilderElectronFctor->prepareToLoopFor(electrons->size()) );
82 
83  // loop over our particles:
84  for ( const auto *const electron : *electrons ){
86  }
87 
88  m_clRingsBuilderElectronFctor->checkRelease();
89  }
90 
91  return StatusCode::SUCCESS;
92 }
93 
94 } // namespace Ringer
95 
96 
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Ringer::BuildCaloRingsFctor
Definition: CaloRingerReaderUtils.h:108
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Ringer::CaloRingerInputReader::m_builderAvailable
Gaudi::Property< bool > m_builderAvailable
Tool CaloRingerInputReader props (non configurables):If CaloRings builder is available.
Definition: CaloRingerInputReader.h:75
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Ringer::CaloRingerElectronsReader::finalize
virtual StatusCode finalize() override
finalize method
Definition: CaloRingerElectronsReader.cxx:60
Ringer::CaloRingerElectronsReader::~CaloRingerElectronsReader
~CaloRingerElectronsReader()
Destructor.
Definition: CaloRingerElectronsReader.cxx:30
Ringer::CaloRingerInputReader::m_crBuilder
PublicToolHandle< ICaloRingsBuilder > m_crBuilder
Tool CaloRingerInputReader props (python configurables):
Definition: CaloRingerInputReader.h:68
Ringer::CaloRingerInputReader
Definition: CaloRingerInputReader.h:24
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
CaloRingerElectronsReader.h
Ringer::CaloRingerElectronsReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition: CaloRingerElectronsReader.cxx:36
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
Ringer::CaloRingerElectronsReader::m_clRingsBuilderElectronFctor
BuildCaloRingsFctor< xAOD::ElectronContainer > * m_clRingsBuilderElectronFctor
The CaloRings Builder functor:
Definition: CaloRingerElectronsReader.h:105
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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
AcceptData.h
Ringer::CaloRingerElectronsReader::execute
virtual StatusCode execute() override
execute method
Definition: CaloRingerElectronsReader.cxx:66
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Ringer::CaloRingerElectronsReader::m_inputElectronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_inputElectronContainerKey
Tool CaloRingerElectronsReader props (python configurables):
Definition: CaloRingerElectronsReader.h:84
Ringer::CaloRingerElectronsReader::CaloRingerElectronsReader
CaloRingerElectronsReader(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: CaloRingerElectronsReader.cxx:17
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
ReadHandle.h
Handle class for reading from StoreGate.
Ringer::CaloRingerInputReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition: CaloRingerInputReader.cxx:30
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
Ringer
Namespace dedicated for Ringer utilities.
Definition: CaloRingsDefs.h:9