ATLAS Offline Software
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 */
13 #ifndef CALOEVENT_CALOCONSTCELLCONTAINER_H
14 #define CALOEVENT_CALOCONSTCELLCONTAINER_H
15 
16 
19 
21 
22 
44  : public ConstDataVector<CaloCellContainer>
45 {
46 public:
49 
50 
54 
55 
59 
60 
63  bool checkOrderedAndComplete() const ;
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 
123 
124 
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 
163 private:
165 
169  void setHasTotalSize (bool flag);
170 
173 };
174 
175 
180 template <>
182  : public ClassID_traits<ConstDataVector<CaloCellContainer> >
183 {
184 };
185 
186 
187 namespace SG {
188 
189 
190 // Also need to specialize these for CaloConstCellContainer.
191 
192 
193 template <class U>
195  : public DataBucketTrait<ConstDataVector<CaloCellContainer> >
196 {
197 };
198 
199 
200 template <>
202  : public BaseInfo<ConstDataVector<CaloCellContainer> >
203 {
204 };
205 
206 
207 // Specialize this for CaloConstCellContainer.
208 template <>
209 inline
210 bool
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
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloConstCellContainer::isOrderedAndComplete
bool isOrderedAndComplete() const
tell wether container is complete and in order
CaloConstCellContainer::checkOrderedAndComplete
bool checkOrderedAndComplete() const
verify one by one the container is complete (i.e.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
CaloConstCellContainer::checkOrdered
bool checkOrdered() const
verify one by one the container is ordered
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
index
Definition: index.py:1
CaloCellContainerFinalizerTool
Definition: CaloCellContainerFinalizerTool.h:20
CaloConstCellContainer::resetLookUpTable
void resetLookUpTable()
reset look up table
CaloConstCellContainer.icc
CaloConstCellContainer::push_back_fast
void push_back_fast(std::unique_ptr< const CaloCell > cell)
reimplementation of push_back to gain speed in readin (UP version)
CaloConstCellContainer::findCellVector
void findCellVector(const std::vector< IdentifierHash > &theVectorHash, ::CaloCellContainer::CellVector &theCellVector) const
fast find method given vector of identifier hash.
CaloConstCellContainer::order
void order()
order container
CaloConstCellContainer::isOrdered
bool isOrdered() const
tell wether container is ordered
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
CaloConstCellContainer::setIsOrdered
void setIsOrdered(bool ordered)
indicates that the container is ordered
CaloConstCellContainer::findIndex
int findIndex(IdentifierHash theHash) const
Return index of the cell with a given hash.
CaloConstCellContainer::updateCaloIterators
void updateCaloIterators()
fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO ...
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
CaloConstCellContainer::updateCaloBeginIterators
void updateCaloBeginIterators(int ic, int ind)
fills calo iterators and the index of first cell for a given subcalo
CaloConstCellContainer::setIsOrderedAndComplete
void setIsOrderedAndComplete(bool ordered)
indicate that the container is complete and in order
CaloConstCellContainer::findCell
const CaloCell * findCell(IdentifierHash theHash) const
fast find method given identifier hash.
CaloConstCellContainer::push_back_fast
void push_back_fast(const CaloCell *cell)
reimplementation of push_back to gain speed in readin
CaloConstCellContainer::hasTotalSize
bool hasTotalSize() const
tell wether container has total hash id size
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
master.flag
bool flag
Definition: master.py:29
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
SG::BaseInfo
Provide an interface for finding inheritance information at run time.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:751
ConstDataVector< CaloCellContainer >::size_type
DV::size_type size_type
Basic types, forwarded from the base.
Definition: ConstDataVector.h:79
grepfile.ic
int ic
Definition: grepfile.py:33
CaloConstCellContainer::hasCalo
bool hasCalo(const CaloCell_ID::SUBCALO caloNum) const
tell whether it has been filled with cells (maybe none) of a given calo
CaloConstCellContainer::baseContainer
::CaloCellContainer * baseContainer()
Return a non-const pointer to the base container.
CaloConstCellContainer::indexFirstCellCalo
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
SG::findInContainer
bool findInContainer(const CaloCellContainer &data, CaloCell const *const &element, CaloCellContainer::size_type &index)
Definition: CaloCellContainer.cxx:676
CaloConstCellContainer::setHasTotalSize
void setHasTotalSize(bool flag)
If @ flag is true, then the container size equals the maximum hash.
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloConstCellContainer
CaloCellContainer that can accept const cell pointers.
Definition: CaloConstCellContainer.h:45
CaloConstCellContainer::setHasCalo
void setHasCalo(CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
CaloConstCellContainer::indexLastCellCalo
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...
DataVector< CaloCell >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
CaloConstCellContainer::beginConstCalo
::CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const begin iterator on cell of just one calo
IdentifierHash
Definition: IdentifierHash.h:38
CaloConstCellContainer::endConstCalo
::CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const begin iterator on cell of just one calo
CaloConstCellContainer::nCellsCalo
int nCellsCalo(const CaloCell_ID::SUBCALO caloNum) const
get number of cels of given calorimeter
checker_macros.h
Define macros for attributes used to control the static checker.
SG::DataBucketTrait
Metafunction to find the proper DataBucket class for T.
Definition: DataBucketTraitFwd.h:30
CaloConstCellContainer::updateCaloEndIterators
void updateCaloEndIterators(int ic, int ind)
fills calo iterators and the index of last cell for a given subcalo
CaloCellContainer::CellVector
std::vector< const CaloCell * > CellVector
type to be used for the internal lookup table, and to return list of cells
Definition: CaloCellContainer.h:83
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
CaloConstCellContainer::CaloConstCellContainer
CaloConstCellContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Constructor.