ATLAS Offline Software
CaloRingerPhotonsReader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // =============================================================================
8 #include "StoreGate/ReadHandle.h"
9 
10 #include <algorithm>
11 
12 namespace Ringer {
13 
14 // =============================================================================
16  const std::string& name,
17  const ::IInterface* parent)
19  m_clRingsBuilderPhotonFctor(nullptr)
20  //m_selectorAvailable(false)
21 {
22 
23  // declare interface
24  declareInterface<ICaloRingerPhotonsReader>(this);
25 
26 }
27 
28 // =============================================================================
30 {
32 }
33 
34 // =============================================================================
36 {
37 
39 
41 
42  if ( m_builderAvailable ) {
43  // Initialize our fctor
49  this);
50  ATH_CHECK( m_clRingsBuilderPhotonFctor->initialize() );
51  }
52 
53  return StatusCode::SUCCESS;
54 }
55 
56 // =============================================================================
58 {
59  return StatusCode::SUCCESS;
60 }
61 
62 // =============================================================================
64 {
65 
66  ATH_MSG_DEBUG("Entering " << name() << " execute.");
67 
68  // Retrieve photons
70  // check is only used for serial running; remove when MT scheduler used
71  if(!photons.isValid()) {
72  ATH_MSG_FATAL("Failed to retrieve "<< m_inputPhotonContainerKey.key());
73  return StatusCode::FAILURE;
74  }
75 
76  if ( m_builderAvailable ) {
77  ATH_CHECK( m_clRingsBuilderPhotonFctor->prepareToLoopFor(photons->size()) );
78 
79  // loop over our particles:
80  for ( const auto *const photon : *photons ){
81  m_clRingsBuilderPhotonFctor->operator()( photon );
82  }
83 
84  }
85 
86 
87  return StatusCode::SUCCESS;
88 
89 }
90 
91 } // namespace Ringer
92 
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::CaloRingerPhotonsReader::m_inputPhotonContainerKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_inputPhotonContainerKey
photon collection input name
Definition: CaloRingerPhotonsReader.h:86
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::CaloRingerInputReader::m_crBuilder
PublicToolHandle< ICaloRingsBuilder > m_crBuilder
Tool CaloRingerInputReader props (python configurables):
Definition: CaloRingerInputReader.h:68
Ringer::CaloRingerInputReader
Definition: CaloRingerInputReader.h:24
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
Ringer::CaloRingerPhotonsReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition: CaloRingerPhotonsReader.cxx:35
Ringer::CaloRingerPhotonsReader::finalize
virtual StatusCode finalize() override
finalize method
Definition: CaloRingerPhotonsReader.cxx:57
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Ringer::CaloRingerPhotonsReader::execute
virtual StatusCode execute() override
execute method
Definition: CaloRingerPhotonsReader.cxx:63
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Ringer::CaloRingerPhotonsReader::~CaloRingerPhotonsReader
~CaloRingerPhotonsReader()
Destructor.
Definition: CaloRingerPhotonsReader.cxx:29
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Ringer::CaloRingerPhotonsReader::CaloRingerPhotonsReader
CaloRingerPhotonsReader(const std::string &type, const std::string &name, const ::IInterface *parent)
Default constructor.
Definition: CaloRingerPhotonsReader.cxx:15
ReadHandle.h
Handle class for reading from StoreGate.
Ringer::CaloRingerInputReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition: CaloRingerInputReader.cxx:30
CaloRingerPhotonsReader.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Ringer::CaloRingerPhotonsReader::m_clRingsBuilderPhotonFctor
BuildCaloRingsFctor< xAOD::PhotonContainer > * m_clRingsBuilderPhotonFctor
Tool CaloRingerPhotonsReader props (non configurables):
Definition: CaloRingerPhotonsReader.h:97
Ringer
Namespace dedicated for Ringer utilities.
Definition: CaloRingsDefs.h:9