ATLAS Offline Software
Loading...
Searching...
No Matches
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:
30
31// Forward declarations:
33class IMessageSvc;
34
35namespace Ringer {
36
42
43 protected:
49 ToolHandle<ICaloRingsBuilder> &builder,
50 IMessageSvc* msgSvc,
51 const std::string& name):
52 AthMessaging(msgSvc, name),
53 m_builder(builder),
55 m_part_size(0),
56 m_crContH(nullptr),
57 m_rsContH(nullptr)
58 {;}
59
60
64 ToolHandle<ICaloRingsBuilder> &m_builder;
70
73
76 StatusCode prepareToLoopFor( std::size_t nParticles );
77
82
86 void checkRelease();
87
90
91 private:
99
100};
101
106template< typename container_t >
108{
109 public:
111 typedef typename container_t::base_value_type particle_t;
115
116 private:
118 // Import base template properties:
119 using base_t::m_builder;
122
124
129
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
166 void operator() (const particle_t *part);
167
171 StatusCode initialize();
172
176 StatusCode prepareToLoopFor( std::size_t nParticles );
177
183};
184
185} // namespace Ringer
186
187#endif // CALORINGERTOOLS_CALORINGERREADERUTILS_H
188
189#ifndef INCLUDE_HEADER_ONLY // Use to avoid circular includes:
191#endif // INCLUDE_HEADER_ONLY
192
An STL vector of pointers that by default owns its pointed-to elements.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Container class for CaloCell.
ToolHandle< ICaloRingsBuilder > & m_builder
Protected Properties.
void checkRelease()
Release the handles when finished looping.
size_t m_part_counter
Hold number of particles already procesed for this event:
StatusCode prepareToLoopFor(std::size_t nParticles)
Methods.
size_t m_part_size
Hold number of particles to be processed:
SG::WriteHandle< xAOD::CaloRingsContainer > * m_crContH
Private Properties.
SG::WriteHandle< xAOD::RingSetContainer > * m_rsContH
Keep RingSetContainer handle in scope until finished looping.
void incrementCounter()
Increment particle looping counter.
BuildCaloRingsFctorBase(ToolHandle< ICaloRingsBuilder > &builder, IMessageSvc *msgSvc, const std::string &name)
Main ctor Initialize values.
void operator()(const particle_t *part)
Methods.
SG::WriteDecorHandle< container_t, xAOD::CaloRingsLinks > decor_t
CaloRings links decorator handle type.
StatusCode initialize()
Initialize the decorator keys.
container_t::base_value_type particle_t
Particle type that the functor will decorate the CaloRingsLinks.
StatusCode prepareToLoopFor(std::size_t nParticles)
Prepare to loop for nParticles.
static constexpr const char * m_particle_name
Holds particle name:
void displayLoopingMessage() const
Shows current looping status.
void checkRelease()
Release the handles when finished looping.
SG::WriteDecorHandleKey< container_t > m_decorKey
Decorator key.
BuildCaloRingsFctor(const std::string &decoContName, ToolHandle< ICaloRingsBuilder > &builder, IMessageSvc *msgSvc, IDataHandleHolder *owningAlg)
Main ctor, repass information for interface.
static constexpr bool m_particle_has_cluster
Holds if particle has cluster access:
decor_t * m_decor
Write decorator handle.
Namespace dedicated for Ringer utilities.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
template to get particle_t name and if it has cluster access.