ATLAS Offline Software
TileMutableDataContainer.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4 */
15 #ifndef TILEEVENT_TILEMUTABLEDATACONTAINER_H
16 #define TILEEVENT_TILEMUTABLEDATACONTAINER_H
17 
18 
23 #include "SGCore/ILockable.h"
24 #include "GaudiKernel/StatusCode.h"
25 #include <vector>
26 #include <memory>
27 
28 
47 template <class BASE_T>
49  : public BASE_T, public ILockable
50 {
51 public:
52  typedef BASE_T BASE;
53  typedef typename BASE::TYPE TYPE;
54  typedef typename BASE::UNIT UNIT;
55  typedef typename BASE::IDENTIFIABLE Collection;
56  typedef typename BASE::TElement Element;
57 
58 
68  TileMutableDataContainer (bool createColl = false,
72 
73 
82 
83 
86 
87 
95  StatusCode addCollection (std::unique_ptr<Collection> coll,
97 
98 
99  // Const version is inherited.
100  using BASE::addCollection;
101 
102 
111  StatusCode push_back (std::unique_ptr<Element> rch);
112 
113 
123 
124 
129  //coverity[BAD_OVERRIDE]
131 
132 
133  // Const version is inherited.
134  using BASE::indexFindPtr;
135 
136 
141 
142 
149  virtual void lock() override;
150 
151 
152 protected:
160  void recycle();
161 
162 
163 private:
165  std::vector<Collection*> m_mutableCollections;
166 
168  bool m_locked;
169 
172 
175 
178 };
179 
180 
182 
183 
184 #endif // not TILEEVENT_TILEMUTABLEDATACONTAINER_H
TileRawDataContainer< TileBeamElemCollection >::TElement
TCOLLECTION::TElement TElement
Definition: TileRawDataContainer.h:37
TileMutableDataContainer.icc
TileMutableDataContainer::m_locked
bool m_locked
Is the container locked?
Definition: TileMutableDataContainer.h:168
TileMutableDataContainer::m_defaultType
TYPE m_defaultType
Default type; reset to this on recycle.
Definition: TileMutableDataContainer.h:174
TileMutableDataContainer::status
StatusCode status() const
Return the error status from the constructors.
TileFragHash::TYPE
TYPE
initialize
Definition: TileFragHash.h:33
ILockable.h
IdentifiableContainerMT::IDENTIFIABLE
T IDENTIFIABLE
Definition: IdentifiableContainerMT.h:67
TileFragHash.h
TileMutableDataContainer::recycle
void recycle()
Recycle this object for use in another event.
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
TileMutableDataContainer::TileMutableDataContainer
TileMutableDataContainer(const BASE &other)
Copy constructor.
TileMutableDataContainer::Collection
BASE::IDENTIFIABLE Collection
Definition: TileMutableDataContainer.h:55
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
TileMutableDataContainer::m_sc
StatusCode m_sc
StatusCode from constructors.
Definition: TileMutableDataContainer.h:171
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TileMutableDataContainer
Helper for holding non-const raw data prior to recording in SG.
Definition: TileMutableDataContainer.h:50
TileMutableDataContainer::Element
BASE::TElement Element
Definition: TileMutableDataContainer.h:56
TileBeamElemContainer
Definition: TileBeamElemContainer.h:13
TileRawChannelUnit::UNIT
UNIT
Definition: TileRawChannelUnit.h:16
TileMutableDataContainer::indexFindPtr
Collection * indexFindPtr(IdentifierHash hash)
Look up a (non-const) collection via hash.
TileMutableDataContainer::push_back
StatusCode push_back(std::unique_ptr< Element > rch)
Add a new channel.
IdentifierHash.h
Muon::IDC_Helper::addCollection
IDC::IDENTIFIABLE * addCollection(const Identifier collId, IDC *idc, const IDHELPER &idHelper, MsgStream &log)
TileMutableDataContainer::addCollection
StatusCode addCollection(std::unique_ptr< Collection > coll, IdentifierHash hash)
Add a collection to the container.
TileRawChannelUnit.h
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TileMutableDataContainer::TileMutableDataContainer
TileMutableDataContainer(bool createColl=false, TYPE type=TileFragHash::Default, UNIT unit=TileRawChannelUnit::ADCcounts, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Constructor.
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
TileMutableDataContainer::lock
virtual void lock() override
Lock this object.
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21
TileMutableDataContainer::TYPE
BASE::TYPE TYPE
Definition: TileMutableDataContainer.h:53
ILockable
Interface to allow an object to lock itself when made const in SG.
Definition: ILockable.h:32
TileMutableDataContainer::operator=
TileMutableDataContainer & operator=(const TileMutableDataContainer &)=delete
TileMutableDataContainer::UNIT
BASE::UNIT UNIT
Definition: TileMutableDataContainer.h:54
TileMutableDataContainer::TileMutableDataContainer
TileMutableDataContainer(const TileMutableDataContainer &)=delete
TileMutableDataContainer::BASE
BASE_T BASE
Definition: TileMutableDataContainer.h:52
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
TileMutableDataContainer::m_defaultUnit
UNIT m_defaultUnit
Default unit; reset to this on recycle.
Definition: TileMutableDataContainer.h:177
TileFragHash::Default
@ Default
Definition: TileFragHash.h:33
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17
TileMutableDataContainer::push_back
StatusCode push_back(Element *rch)
Add a new channel.
TileMutableDataContainer::m_mutableCollections
std::vector< Collection * > m_mutableCollections
Non-const references to collections, indexed by hash value.
Definition: TileMutableDataContainer.h:165