ATLAS Offline Software
CaloRingerReaderUtils.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 /*
3  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 */
5 #ifndef CALORINGERTOOLS_CALORINGERREADERUTILS_H
6 #define CALORINGERTOOLS_CALORINGERREADERUTILS_H
7 
8 // STL includes:
9 #include <string>
10 #include <memory>
11 #include <vector>
12 
13 // Athena framework include:
14 #include "GaudiKernel/ToolHandle.h"
15 #include "GaudiKernel/IDataHandleHolder.h"
21 
22 // xAOD include:
24 
25 // Interface includes:
27 
28 // Local includes:
29 #include "RingerKnownParticles.h"
30 
31 // Forward declarations:
32 class CaloCellContainer;
33 class IMessageSvc;
34 
35 namespace Ringer {
36 
42 
43  protected:
49  ToolHandle<ICaloRingsBuilder> &builder,
50  IMessageSvc* msgSvc,
51  const std::string& name):
54  m_part_counter(0),
55  m_part_size(0),
56  m_crContH(nullptr),
57  m_rsContH(nullptr)
58  {;}
59 
60 
64  ToolHandle<ICaloRingsBuilder> &m_builder;
68  size_t m_part_size;
70 
73 
76  StatusCode prepareToLoopFor( std::size_t nParticles );
77 
82 
86  void checkRelease();
87 
90 
91  private:
99 
100 };
101 
106 template< typename container_t >
108 {
109  public:
111  typedef typename container_t::base_value_type particle_t;
115 
116  private:
118  // Import base template properties:
122 
123  using base_t::checkRelease;
124 
129 
133  void displayLoopingMessage() const;
134 
139 
143  decor_t* m_decor{nullptr};
144 
145  public:
150  const std::string &decoContName,
151  ToolHandle<ICaloRingsBuilder> &builder,
152  IMessageSvc* msgSvc,
153  IDataHandleHolder* owningAlg)
155  builder,
156  msgSvc,
157  owningAlg->name()),
158  m_decorKey( decoContName + "." + xAOD::caloRingsLinksDecorKey() )
159  { m_decorKey.setOwner(owningAlg);}
160 
163 
167 
172 
176  StatusCode prepareToLoopFor( std::size_t nParticles );
177 
181  void checkRelease();
183 };
184 
185 } // namespace Ringer
186 
187 #endif // CALORINGERTOOLS_CALORINGERREADERUTILS_H
188 
189 #ifndef INCLUDE_HEADER_ONLY // Use to avoid circular includes:
190 #include "CaloRingerReaderUtils.icc"
191 #endif // INCLUDE_HEADER_ONLY
192 
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
Ringer::BuildCaloRingsFctorBase::m_builder
ToolHandle< ICaloRingsBuilder > & m_builder
Protected Properties.
Definition: CaloRingerReaderUtils.h:64
SG::WriteDecorHandleKey< container_t >
ICaloRingsBuilder.h
Ringer::BuildCaloRingsFctor::m_decor
decor_t * m_decor
Write decorator handle.
Definition: CaloRingerReaderUtils.h:143
Ringer::BuildCaloRingsFctor::m_decorKey
SG::WriteDecorHandleKey< container_t > m_decorKey
Decorator key.
Definition: CaloRingerReaderUtils.h:138
Ringer::BuildCaloRingsFctor
Definition: CaloRingerReaderUtils.h:108
AthCheckMacros.h
Ringer::BuildCaloRingsFctor::operator()
void operator()(const particle_t *part)
Methods.
Ringer::BuildCaloRingsFctor::checkRelease
void checkRelease()
Release the handles when finished looping.
CaloRingerReaderUtils.icc
Ringer::BuildCaloRingsFctor::particle_t
container_t::base_value_type particle_t
Particle type that the functor will decorate the CaloRingsLinks.
Definition: CaloRingerReaderUtils.h:111
Ringer::BuildCaloRingsFctor::base_t
BuildCaloRingsFctorBase base_t
Definition: CaloRingerReaderUtils.h:117
Ringer::BuildCaloRingsFctorBase::prepareToLoopFor
StatusCode prepareToLoopFor(std::size_t nParticles)
Methods.
Definition: CaloRingerReaderUtils.cxx:23
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
Ringer::BuildCaloRingsFctorBase::m_crContH
SG::WriteHandle< xAOD::CaloRingsContainer > * m_crContH
Private Properties.
Definition: CaloRingerReaderUtils.h:95
Ringer::BuildCaloRingsFctor::prepareToLoopFor
StatusCode prepareToLoopFor(std::size_t nParticles)
Prepare to loop for nParticles.
xAOD::caloRingsLinksDecorKey
std::string caloRingsLinksDecorKey()
Definition: getCaloRingsDecorator.h:17
Ringer::BuildCaloRingsFctor::initialize
StatusCode initialize()
Initialize the decorator keys.
RingerKnownParticles.h
getCaloRingsDecorator.h
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
Ringer::BuildCaloRingsFctor::decor_t
SG::WriteDecorHandle< container_t, xAOD::CaloRingsLinks > decor_t
CaloRings links decorator handle type.
Definition: CaloRingerReaderUtils.h:114
Ringer::BuildCaloRingsFctorBase::BuildCaloRingsFctorBase
BuildCaloRingsFctorBase(ToolHandle< ICaloRingsBuilder > &builder, IMessageSvc *msgSvc, const std::string &name)
Main ctor Initialize values.
Definition: CaloRingerReaderUtils.h:48
createSimpleDistributions.builder
builder
Definition: createSimpleDistributions.py:52
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
Ringer::BuildCaloRingsFctorBase::m_part_counter
size_t m_part_counter
Hold number of particles already procesed for this event:
Definition: CaloRingerReaderUtils.h:66
WriteDecorHandle.h
Handle class for adding a decoration to an object.
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
Ringer::BuildCaloRingsFctorBase
Interface for CaloRings builder functor.
Definition: CaloRingerReaderUtils.h:41
Ringer::BuildCaloRingsFctorBase::checkRelease
void checkRelease()
Release the handles when finished looping.
Definition: CaloRingerReaderUtils.cxx:43
Ringer::BuildCaloRingsFctorBase::m_rsContH
SG::WriteHandle< xAOD::RingSetContainer > * m_rsContH
Keep RingSetContainer handle in scope until finished looping.
Definition: CaloRingerReaderUtils.h:97
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Ringer::BuildCaloRingsFctor::displayLoopingMessage
void displayLoopingMessage() const
Shows current looping status.
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
Ringer::GetParticleProp
template to get particle_t name and if it has cluster access.
Definition: RingerKnownParticles.h:33
Ringer::BuildCaloRingsFctor::m_particle_has_cluster
static constexpr bool m_particle_has_cluster
Holds if particle has cluster access:
Definition: CaloRingerReaderUtils.h:128
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Ringer::BuildCaloRingsFctorBase::incrementCounter
void incrementCounter()
Increment particle looping counter.
Definition: CaloRingerReaderUtils.h:81
AthMessaging.h
Ringer::BuildCaloRingsFctor::m_particle_name
static constexpr const char * m_particle_name
Holds particle name:
Definition: CaloRingerReaderUtils.h:126
Ringer::BuildCaloRingsFctorBase::m_part_size
size_t m_part_size
Hold number of particles to be processed:
Definition: CaloRingerReaderUtils.h:68
Ringer::BuildCaloRingsFctor::BuildCaloRingsFctor
BuildCaloRingsFctor(const std::string &decoContName, ToolHandle< ICaloRingsBuilder > &builder, IMessageSvc *msgSvc, IDataHandleHolder *owningAlg)
Main ctor, repass information for interface.
Definition: CaloRingerReaderUtils.h:149
Ringer::BuildCaloRingsFctorBase::~BuildCaloRingsFctorBase
virtual ~BuildCaloRingsFctorBase()
Definition: CaloRingerReaderUtils.h:89
Ringer
Namespace dedicated for Ringer utilities.
Definition: CaloRingsDefs.h:9