ATLAS Offline Software
Loading...
Searching...
No Matches
CaloConstCellContainer.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-2020 CERN for the benefit of the ATLAS collaboration
4*/
11
12
13#ifndef CALOEVENT_CALOCONSTCELLCONTAINER_H
14#define CALOEVENT_CALOCONSTCELLCONTAINER_H
15
16
19
21
22
44 : public ConstDataVector<CaloCellContainer>
45{
46public:
49
50
54
55
59
60
64
65
67 void setIsOrderedAndComplete (bool ordered);
68
69
71 bool isOrderedAndComplete() const ;
72
73
75 bool checkOrdered() const ;
76
77
79 void setIsOrdered (bool ordered);
80
81
83 bool isOrdered() const;
84
85
87 bool hasTotalSize() const;
88
89
91 bool hasCalo(const CaloCell_ID::SUBCALO caloNum) const;
92
93
96 int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const ;
97
98
101 int indexLastCellCalo(const CaloCell_ID::SUBCALO caloNum) const ;
102
103
105 int nCellsCalo(const CaloCell_ID::SUBCALO caloNum) const ;
106
107
110
111
118
119
122 void updateCaloBeginIterators(int ic, int ind);
123
124
127 void updateCaloEndIterators(int ic,int ind);
128
129
133 const CaloCell * findCell (IdentifierHash theHash) const;
134
135
138 int findIndex (IdentifierHash theHash) const;
139
140
144 void findCellVector(const std::vector<IdentifierHash> & theVectorHash,
145 ::CaloCellContainer::CellVector & theCellVector) const;
146
147
149 void order();
150
151
153 void push_back_fast (const CaloCell* cell);
154
156 void push_back_fast (std::unique_ptr<const CaloCell> cell);
157
158
161
162
163private:
165
169 void setHasTotalSize (bool flag);
170
173};
174
175
180template <>
182 : public ClassID_traits<ConstDataVector<CaloCellContainer> >
183{
184};
185
186
187namespace SG {
188
189
190// Also need to specialize these for CaloConstCellContainer.
191
192
193template <class U>
195 : public DataBucketTrait<ConstDataVector<CaloCellContainer> >
196{
197};
198
199
200template <>
202 : public BaseInfo<ConstDataVector<CaloCellContainer> >
203{
204};
205
206
207// Specialize this for CaloConstCellContainer.
208template <>
209inline
210bool
212 CaloCell const * const & element,
214{
215 return SG::findInContainer (*data.asDataVector(), element, index);
216}
217
218
219} // namespace SG
220
221
223
224
225#endif // not CALOEVENT_CALOCONSTCELLCONTAINER_H
DataVector adapter that acts like it holds const pointers.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Define macros for attributes used to control the static checker.
std::vector< const CaloCell * > CellVector
type to be used for the internal lookup table, and to return list of cells
CaloCellContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
CaloCellContainer that can accept const cell pointers.
::CaloCellContainer * baseContainer()
Return a non-const pointer to the base container.
void order()
order container
int findIndex(IdentifierHash theHash) const
Return index of the cell with a given hash.
void updateCaloIterators()
fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO ...
bool checkOrdered() const
verify one by one the container is ordered
void setIsOrderedAndComplete(bool ordered)
indicate that the container is complete and in order
bool checkOrderedAndComplete() const
verify one by one the container is complete (i.e.
void setHasTotalSize(bool flag)
If @ flag is true, then the container size equals the maximum hash.
::CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const begin iterator on cell of just one calo
bool isOrdered() const
tell wether container is ordered
bool hasTotalSize() const
tell wether container has total hash id size
CaloConstCellContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Constructor.
const CaloCell * findCell(IdentifierHash theHash) const
fast find method given identifier hash.
void updateCaloBeginIterators(int ic, int ind)
fills calo iterators and the index of first cell for a given subcalo
void setHasCalo(CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
::CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const begin iterator on cell of just one calo
void setIsOrdered(bool ordered)
indicates that the container is ordered
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
void findCellVector(const std::vector< IdentifierHash > &theVectorHash, ::CaloCellContainer::CellVector &theCellVector) const
fast find method given vector of identifier hash.
void updateCaloEndIterators(int ic, int ind)
fills calo iterators and the index of last cell for a given subcalo
void push_back_fast(const CaloCell *cell)
reimplementation of push_back to gain speed in readin
bool isOrderedAndComplete() const
tell wether container is complete and in order
int indexLastCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of last cell of given calorimeter (-2 if none) Note that it is normally more efficient to use i...
int nCellsCalo(const CaloCell_ID::SUBCALO caloNum) const
get number of cels of given calorimeter
bool hasCalo(const CaloCell_ID::SUBCALO caloNum) const
tell whether it has been filled with cells (maybe none) of a given calo
void resetLookUpTable()
reset look up table
void push_back_fast(std::unique_ptr< const CaloCell > cell)
reimplementation of push_back to gain speed in readin (UP version)
CaloCellContainer::size_type size_type
ConstDataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
SG::OwnershipPolicy ownPolicy() const
This is a "hash" representation of an Identifier.
Provide an interface for finding inheritance information at run time.
Forward declaration.
OwnershipPolicy
@ OWN_ELEMENTS
this data object owns its elements
bool findInContainer(const CaloCellContainer &data, CaloCell const *const &element, CaloCellContainer::size_type &index)
Definition index.py:1
Default, invalid implementation of ClassID_traits.
Metafunction to find the proper DataBucket class for T.