ATLAS Offline Software
Loading...
Searching...
No Matches
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// =============================================================================
9
10#include <algorithm>
11
12namespace Ringer {
13
14// =============================================================================
16 const std::string& name,
17 const ::IInterface* parent)
18 : CaloRingerInputReader(type, name, parent),
20 //m_selectorAvailable(false)
21{
22
23 // declare interface
24 declareInterface<ICaloRingerPhotonsReader>(this);
25
26}
27
28// =============================================================================
33
34// =============================================================================
36{
37
39
41
42 if ( m_builderAvailable ) {
43 // Initialize our fctor
49 this);
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
PublicToolHandle< ICaloRingsBuilder > m_crBuilder
Tool CaloRingerInputReader props (python configurables):
Gaudi::Property< bool > m_builderAvailable
Tool CaloRingerInputReader props (non configurables):If CaloRings builder is available.
CaloRingerInputReader(const std::string &type, const std::string &name, const ::IInterface *parent)
Default constructor.
virtual StatusCode initialize() override
Tool main methods:
virtual StatusCode execute() override
execute method
SG::ReadHandleKey< xAOD::PhotonContainer > m_inputPhotonContainerKey
photon collection input name
CaloRingerPhotonsReader(const std::string &type, const std::string &name, const ::IInterface *parent)
Default constructor.
virtual StatusCode finalize() override
finalize method
virtual StatusCode initialize() override
Tool main methods:
BuildCaloRingsFctor< xAOD::PhotonContainer > * m_clRingsBuilderPhotonFctor
Tool CaloRingerPhotonsReader props (non configurables):
virtual bool isValid() override final
Can the handle be successfully dereferenced?
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
Namespace dedicated for Ringer utilities.