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-2018 CERN for the benefit of the ATLAS collaboration
4 */
5 /*
6  */
17 #ifndef TILEEVENT_TILEMUTABLEDATACONTAINER_H
18 #define TILEEVENT_TILEMUTABLEDATACONTAINER_H
19 
20 
25 #include "AthenaKernel/ILockable.h"
26 #include "GaudiKernel/StatusCode.h"
27 #include <vector>
28 #include <memory>
29 
30 
49 template <class BASE_T>
51  : public BASE_T, public ILockable
52 {
53 public:
54  typedef BASE_T BASE;
55  typedef typename BASE::TYPE TYPE;
56  typedef typename BASE::UNIT UNIT;
57  typedef typename BASE::IDENTIFIABLE Collection;
58  typedef typename BASE::TElement Element;
59 
60 
70  TileMutableDataContainer (bool createColl = false,
74 
75 
84 
85 
88 
89 
97  StatusCode addCollection (std::unique_ptr<Collection> coll,
99 
100 
101  // Const version is inherited.
102  using BASE::addCollection;
103 
104 
113  StatusCode push_back (std::unique_ptr<Element> rch);
114 
115 
125 
126 
132 
133 
134  // Const version is inherited.
135  using BASE::indexFindPtr;
136 
137 
142 
143 
150  virtual void lock() override;
151 
152 
153 protected:
161  void recycle();
162 
163 
164 private:
166  std::vector<Collection*> m_mutableCollections;
167 
169  bool m_locked;
170 
173 
176 
179 };
180 
181 
183 
184 
185 #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:169
TileMutableDataContainer::m_defaultType
TYPE m_defaultType
Default type; reset to this on recycle.
Definition: TileMutableDataContainer.h:175
TileMutableDataContainer::status
StatusCode status() const
Return the error status from the constructors.
TileFragHash::TYPE
TYPE
initialize
Definition: TileFragHash.h:33
ILockable.h
Interface to allow an object to lock itself when made const in SG.
IdentifiableContainerMT::IDENTIFIABLE
T IDENTIFIABLE
Definition: IdentifiableContainerMT.h:69
TileFragHash.h
TileMutableDataContainer::recycle
void recycle()
Recycle this object for use in another event.
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:57
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:172
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:52
TileMutableDataContainer::Element
BASE::TElement Element
Definition: TileMutableDataContainer.h:58
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:109
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TileMutableDataContainer::TYPE
BASE::TYPE TYPE
Definition: TileMutableDataContainer.h:55
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:56
TileMutableDataContainer::TileMutableDataContainer
TileMutableDataContainer(const TileMutableDataContainer &)=delete
TileMutableDataContainer::BASE
BASE_T BASE
Definition: TileMutableDataContainer.h:54
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:178
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:166