ATLAS Offline Software
CaloRingerJetsReader.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 // =============================================================================
6 #include "CaloRingerJetsReader.h"
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_clRingsBuilderJetFctor(nullptr)
22 {
23 
24  // declare interface
25  declareInterface<ICaloRingerJetsReader>(this);
26 
27 }
28 
29 // =============================================================================
31 {
33 }
34 
35 // =============================================================================
37 {
38 
40 
42 
43  if ( m_builderAvailable ) {
44  // Initialize our fctor
50  this
51  );
52  ATH_CHECK( m_clRingsBuilderJetFctor->initialize() );
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 jets
73  // check is only used for serial running; remove when MT scheduler used
74  if(!jets.isValid()) {
75  ATH_MSG_FATAL("Failed to retrieve "<< m_inputJetContainerKey);
76  return StatusCode::FAILURE;
77  }
78 
79  // Check if requested to run CaloRings Builder:
80  if ( m_builderAvailable ) {
81  ATH_CHECK( m_clRingsBuilderJetFctor->prepareJetToLoopFor(jets->size()) );
82 
83  // loop over our particles:
84  for ( const auto *const jet : *jets ){
85  m_clRingsBuilderJetFctor->operator()( jet );
86  }
87 
88  m_clRingsBuilderJetFctor->checkJetRelease();
89  }
90 
91  return StatusCode::SUCCESS;
92 }
93 
94 } // namespace Ringer
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
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:67
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
Ringer::BuildCaloRingsJetFctor
Definition: CaloRingerReaderJetUtils.h:108
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
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
Ringer::CaloRingerJetsReader::m_inputJetContainerKey
SG::ReadHandleKey< xAOD::JetContainer > m_inputJetContainerKey
Tool CaloRingerJetsReader props (python configurables):
Definition: CaloRingerJetsReader.h:80
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
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
Ringer::CaloRingerJetsReader::~CaloRingerJetsReader
~CaloRingerJetsReader()
Destructor.
Definition: CaloRingerJetsReader.cxx:30
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
CaloRingerJetsReader.h
Ringer::CaloRingerJetsReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition: CaloRingerJetsReader.cxx:36
Ringer::CaloRingerJetsReader::finalize
virtual StatusCode finalize() override
finalize method
Definition: CaloRingerJetsReader.cxx:60
Ringer::CaloRingerJetsReader::CaloRingerJetsReader
CaloRingerJetsReader(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: CaloRingerJetsReader.cxx:17
ReadHandle.h
Handle class for reading from StoreGate.
Ringer::CaloRingerInputReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition: CaloRingerInputReader.cxx:30
Ringer::CaloRingerJetsReader::m_clRingsBuilderJetFctor
BuildCaloRingsJetFctor< xAOD::JetContainer > * m_clRingsBuilderJetFctor
The CaloRings Builder functor:
Definition: CaloRingerJetsReader.h:89
Ringer::CaloRingerJetsReader::execute
virtual StatusCode execute() override
execute method
Definition: CaloRingerJetsReader.cxx:66
Ringer
Namespace dedicated for Ringer utilities.
Definition: CaloRingsDefs.h:9