ATLAS Offline Software
Loading...
Searching...
No Matches
CaloRingerReaderJetUtils.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// =====================================================================================
7
8
9// Kernel includes:
10#include "GaudiKernel/StatusCode.h"
11#include "GaudiKernel/ToolHandle.h"
12
13// xAOD includes:
19
20namespace Ringer {
21
22// =====================================================================================
23StatusCode BuildCaloRingsJetFctorBase::prepareJetToLoopFor( std::size_t nParticles ) {
24 ATH_MSG_DEBUG(" ---------- Preparing to loop for " << nParticles << " particles");
25 // Reset counters, set number of particles to nParticles:
26 m_part_size = nParticles;
28
29 // Make and set the CaloRings and RingSets container
31 ATH_CHECK(m_crContH->record(std::make_unique<xAOD::CaloRingsContainer>(),
32 std::make_unique<xAOD::CaloRingsAuxContainer>()));
34 ATH_CHECK(m_rsContH->record(std::make_unique<xAOD::RingSetContainer>(),
35 std::make_unique<xAOD::RingSetAuxContainer>()));
36
37 // Set containers which will hold the build CaloRings and reserve one slot per
38 // particle as initial guess:
39 return m_builder->preExecute( m_crContH->ptr(), m_rsContH->ptr(), nParticles );
40}
41
42// =====================================================================================
44 if ( m_part_counter == m_part_size ) {
45 delete m_crContH; m_crContH = nullptr;
46 delete m_rsContH; m_rsContH = nullptr;
47 }
48}
49
50} // namespace Ringer
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
size_t m_part_counter
Hold number of particles already procesed for this event:
size_t m_part_size
Hold number of particles to be processed:
SG::WriteHandle< xAOD::RingSetContainer > * m_rsContH
Keep RingSetContainer handle in scope until finished looping.
SG::WriteHandle< xAOD::CaloRingsContainer > * m_crContH
Private Properties.
StatusCode prepareJetToLoopFor(std::size_t nParticles)
Methods.
ToolHandle< ICaloRingsBuilder > & m_builder
Protected Properties.
void checkJetRelease()
Release the handles when finished looping.
Namespace dedicated for Ringer utilities.