![]() |
ATLAS Offline Software
|
Container class for CaloCell. More...
#include <CaloCellContainer.h>
Classes | |
| class | orderWithCaloHash |
| functor to order cells according to caloHash More... | |
Public Types | |
| typedef std::vector< const CaloCell * > | CellVector |
| type to be used for the internal lookup table, and to return list of cells | |
| typedef std::vector< CaloCell * > | MutableCellVector |
| Return from non-const findCellVector. | |
| typedef typename DataVectorBase< CaloCell >::Base | DataVector_BASE |
| typedef typename DataVectorBase< CaloCell >::Base | DVL_BASE |
| typedef typename DataVectorBase< CaloCell >::Base::PtrVector | PtrVector |
This is the type of the underlying std::vector (what stdcont returns). | |
| typedef typename DataVectorBase< CaloCell >::Base::PtrVector | BaseContainer |
| typedef CaloCell *& | reference |
| typedef CaloCell *const & | const_reference |
| typedef typename DataVectorBase< CaloCell >::Base::size_type | size_type |
| typedef typename DataVectorBase< CaloCell >::Base::difference_type | difference_type |
| typedef CaloCell * | value_type |
| typedef typename DataVectorBase< CaloCell >::Base::allocator_type | allocator_type |
| typedef CaloCell ** | pointer |
| typedef CaloCell *const * | const_pointer |
| typedef const CaloCell * | const_value_type |
| typedef CaloCell | base_value_type |
The T value used as the template parameter. | |
| typedef std::unique_ptr< base_value_type > | unique_type |
| Type of a unique_ptr that can be used to insert elements into this container. | |
| typedef DataModel_detail::ElementProxy< DataVector > | ElementProxy |
This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership. | |
| typedef DataModel_detail::const_iterator< DataVector > | const_iterator |
Standard const_iterator. | |
| typedef DataModel_detail::iterator< DataVector > | iterator |
Standard iterator. | |
| typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Standard const_reverse_iterator. | |
| typedef std::reverse_iterator< iterator > | reverse_iterator |
Standard reverse_iterator. | |
| typedef DataVector | base_data_vector |
| using | Deleter |
Public Member Functions | |
| CaloCellContainer (SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS) | |
| Main constructor. | |
| CaloCellContainer (size_t n, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS) | |
| Sized constructor. | |
| virtual | ~CaloCellContainer () |
| destructor | |
| void | push_back (CaloCell *) |
| reimplementation of const push_back | |
| void | push_back (std::unique_ptr< CaloCell >) |
| reimplementation of const push_back(unique_ptr>) | |
| void | push_back_fast (CaloCell *) |
| reimplementation of push_back to gain speed in readin | |
| void | push_back_fast (std::unique_ptr< CaloCell > theCell) |
| reimplementation of push_back to gain speed in readin (UP version) | |
| CaloCellContainer::const_iterator | beginConstCalo (CaloCell_ID::SUBCALO caloNum) const |
| get const iterators on cell of just one calo | |
| CaloCellContainer::const_iterator | endConstCalo (CaloCell_ID::SUBCALO caloNum) const |
| CaloCellContainer::iterator | beginCalo (CaloCell_ID::SUBCALO caloNum) |
| get non const iterators on cell of just one calo | |
| CaloCellContainer::iterator | endCalo (CaloCell_ID::SUBCALO caloNum) |
| bool | checkOrderedAndComplete () const |
| verify one by one the container is complete (i.e. | |
| void | setIsOrderedAndComplete (const bool ordered) |
| indicate that the container is complete and in order | |
| bool | isOrderedAndComplete () const |
| tell wether container is complete and in order | |
| bool | checkOrdered () const |
| verify one by one the container is ordered | |
| void | setIsOrdered (const bool ordered) |
| indicates that the container is ordered | |
| bool | isOrdered () const |
| tell wether container is ordered | |
| bool | hasTotalSize () const |
| tell wether container has total hash id size | |
| bool | hasCalo (const CaloCell_ID::SUBCALO caloNum) const |
| tell wether it has been filled with cells (maybe none) of a given calo | |
| int | indexFirstCellCalo (const CaloCell_ID::SUBCALO caloNum) const |
| index of first cell of given calorimeter (-1 if none). | |
| 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 iterators. | |
| int | nCellsCalo (const CaloCell_ID::SUBCALO caloNum) const |
| get number of cels of given calorimeter | |
| void | setHasCalo (const CaloCell_ID::SUBCALO caloNum) |
| set which calo has been filled. | |
| void | updateCaloIterators () |
| fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO CALL THIS METHOD ONCE THE FILLING IS FINISHED Please use CaloCellContainerFinalizerTool to make sure the container is properly finalised. | |
| void | updateCaloBeginIterators (int ic, int ind) |
| fills calo iterators and the index of first cell for a given subcalo | |
| void | updateCaloEndIterators (int ic, int ind) |
| fills calo iterators and the index of last cell for a given subcalo | |
| const CaloCell * | findCell (const IdentifierHash theHash) const |
| fast find method given identifier hash. | |
| CaloCell * | findCell (const IdentifierHash theHash) |
| fast find method given identifier hash. | |
| int | findIndex (const IdentifierHash theHash) const |
| Return index of the cell with a given hash. | |
| void | findCellVector (const std::vector< IdentifierHash > &theVectorHash, CellVector &theCellVector) const |
| fast find method given vector of identifier hash. | |
| void | findCellVector (const std::vector< IdentifierHash > &theVectorHash, MutableCellVector &theCellVector) |
| fast find method given vector of identifier hash. | |
| void | initializeLookUpTable () |
| initialize look up table. | |
| void | resetLookUpTable () |
| reset look up table | |
| void | order () |
| order container | |
Constructors, destructors, assignment. | |
| void | assign (InputIterator first, InputIterator last) |
| Assign from iterators. | |
Size and capacity. | |
| size_type | size () const noexcept |
| Returns the number of elements in the collection. | |
| void | resize (size_type sz) |
| Resizes the collection to the specified number of elements. | |
| void | reserve (size_type n) |
| Attempt to preallocate enough memory for a specified number of elements. | |
Element access. | |
Change the vector capacity to match the current size. Note: this does not affect auxiliary data. | |
| const CaloCell * | operator[] (size_type n) const |
| Access an element, as an rvalue. | |
| const CaloCell * | get (size_type n) const |
| Access an element, as an rvalue. | |
| const CaloCell * | at (size_type n) const |
| Access an element, as an rvalue. | |
| const CaloCell * | front () const |
| Access the first element in the collection as an rvalue. | |
| const CaloCell * | back () const |
| Access the last element in the collection as an rvalue. | |
Iterator creation. | |
| const_iterator | begin () const noexcept |
Return a const_iterator pointing at the beginning of the collection. | |
| const_iterator | end () const noexcept |
Return a const_iterator pointing past the end of the collection. | |
| const_reverse_iterator | rbegin () const noexcept |
Return a const_reverse_iterator pointing past the end of the collection. | |
| const_reverse_iterator | rend () const noexcept |
Return a const_reverse_iterator pointing at the beginning of the collection. | |
| const_iterator | cbegin () const noexcept |
Return a const_iterator pointing at the beginning of the collection. | |
| const_iterator | cend () const noexcept |
Return a const_iterator pointing past the end of the collection. | |
| const_reverse_iterator | crbegin () const noexcept |
Return a const_reverse_iterator pointing past the end of the collection. | |
| const_reverse_iterator | crend () const noexcept |
Return a const_reverse_iterator pointing at the beginning of the collection. | |
Insertion operations. | |
| value_type | push_back (value_type pElem) |
| Add an element to the end of the collection. | |
| size_type | push_new (size_type n, F alloc) |
| Create and add a number of new elements to the end of the container. | |
| value_type | emplace_back (value_type pElem) |
| Add an element to the end of the collection. | |
| iterator | insert (iterator position, value_type pElem) |
| Add a new element to the collection. | |
| iterator | emplace (iterator position, value_type pElem) |
| Add a new element to the collection. | |
| void | insertMove (iterator position, DataVector &other) |
Insert the contents of another DataVector, with auxiliary data copied via move semantics. | |
Erasure operations. | |
| iterator | erase (iterator position) |
| Remove element at a given position. | |
| void | pop_back () |
| Remove the last element from the collection. | |
| void | clear () |
| Erase all the elements in the collection. | |
Static Public Member Functions | |
| static void | print () |
| dump (obsolete) | |
Static Public Attributes | |
| static const bool | has_virtual |
This is true for any DataVector class if we need to use virtual derivation to get to the base DataVector class. | |
| static constexpr bool | must_own |
| If true, then this type must own its contents. | |
Private Member Functions | |
| IMessageSvc * | msgSvc () const |
| get message service | |
| void | setHasTotalSize (const bool) |
| If @ flag is true, then the container size equals the maximum hash. | |
| void | updateCaloIteratorsOrdered (CaloCellContainer::iterator beg, CaloCellContainer::iterator end) |
| Recursively find division points between subcalos in the container. | |
| void | orderWhenIncomplete () |
| order when container is incomplete | |
| void | orderWhenComplete () |
| order when container is complete | |
| const CxxUtils::PackedArray & | getLookUpTable () const |
| Retrieve an initialized lookup table. | |
Static Private Member Functions | |
| template<class CONT, class VECT> | |
| static void | findCellVectorT (CONT &cont, const std::vector< IdentifierHash > &theVectorHash, VECT &theCellVector) |
| Look up a group of cells by IdentifierHash. | |
Private Attributes | |
| CxxUtils::CachedValue< CxxUtils::PackedArray > | m_lookUpTable |
| look up table of size HashIdentifiermax. | |
| bool | m_hasTotalSize |
| true if size correspond to maximum hash. | |
| bool | m_isOrdered |
| true if ordered | |
| bool | m_isOrderedAndComplete |
| true if complete and in right order | |
| std::vector< bool > | m_hasCalo |
| true if given cell from given calo has been filled (even if none) | |
| std::vector< int > | m_indexFirstCellCalo |
| index of first cell of given calo (-1 if none) | |
| std::vector< int > | m_indexLastCellCalo |
| index of first cell of given calo (-2 if none) | |
| std::vector< CaloCellContainer::const_iterator > | m_beginConstCalo |
| const iterators for the different calorimeters | |
| std::vector< CaloCellContainer::const_iterator > | m_endConstCalo |
| std::vector< CaloCellContainer::iterator > | m_beginCalo |
| non const iterators for the different calorimeters | |
| std::vector< CaloCellContainer::iterator > | m_endCalo |
Friends | |
| class | CaloConstCellContainer |
| class | CaloCellContainerFinalizerTool |
| class | CaloCompactCellTool |
| class | FullCaloCellContMaker |
| class | EmptyCellBuilderTool |
| class | CaloCellContCopyTool |
Internal operations. | |
| SG::IsMostDerivedFlag | m_isMostDerived |
| This flag is true if this DV instance is the most-derived one. | |
| void | resortAux (iterator beg, iterator end) |
| Reset indices / reorder aux data after elements have been permuted. | |
| void | testInsert (const char *op) |
| Test if we can insert; raise an exception if not. | |
| void | testInsertOol (const char *op) |
| Test if we can insert; raise an exception if not. | |
| static int | baseOffset1 (const char *p, const DataVector &dv, const std::type_info &ti) |
Helper for baseOffset. | |
| static const CaloCell * | do_cast (const typename PtrVector::value_type p) |
Helper to shorten calls to DataModel_detail::DVLCast. | |
| static CaloCell * | do_cast_nc (typename PtrVector::value_type p) |
Helper to shorten calls to DataModel_detail::DVLCast. | |
| void | assignElement (typename BaseContainer::iterator pos, value_type newElem) |
| Handle element assignment. | |
| void | assignBaseElement (typename BaseContainer::iterator pos, typename BaseContainer::value_type newElem) |
| Handle element assignment from a base pointer. | |
| void | shift (size_t pos, ptrdiff_t offs) |
| Shift the auxiliary elements of the container. | |
| virtual const std::type_info & | dv_typeid () const override |
Find the most-derived DataVector class in the hierarchy. | |
| typedef ROOT::Meta::Selection::DataVector< CaloCell, DataVector_BASE >::self | self |
| void | clearMostDerived () |
Clear m_isMostDerived for this instance and for all bases. | |
| virtual void | setMostDerived () override |
Set m_isMostDerived for this instance and clear it for all bases. | |
Swap and sort. | |
| void | swap (DataVector &rhs) |
| Swap this collection with another. | |
| void | sort () |
| Sort the container. | |
| static void | iter_swap (iterator a, iterator b) |
Swap the referents of two DataVector iterators. | |
Non-standard operations. | |
| void | swapElement (size_type index, value_type newElem, reference oldElem) |
| Swap one element out of the container. | |
| virtual const DataModel_detail::DVLInfoBase & | dvlinfo_v () const override |
| Return the DV/DL info struct for this class. | |
| const SG::AuxVectorBase & | auxbase () const |
Convert to AuxVectorBase. | |
| size_type | max_size () const noexcept |
Returns the size() of the largest possible collection. | |
| size_type | capacity () const noexcept |
| Returns the total number of elements that the collection can hold before needing to allocate more memory. | |
| bool | empty () const noexcept |
Returns true if the collection is empty. | |
| void | shrink_to_fit () |
| const PtrVector & | stdcont () const |
Return the underlying std::vector of the container. | |
| SG::OwnershipPolicy | ownPolicy () const |
| Return the ownership policy setting for this container. | |
| static const DataModel_detail::DVLInfoBase & | dvlinfo () |
| Return the DV/DL info struct for this class. | |
| static int | baseOffset (const std::type_info &ti) |
Return the offset of a base DataVector class. | |
CaloCellContainer is a container of all LAr and Tile cells. It derives from DataVector<CaloCell>. Cells from a given calorimeter (LAr e.m., LArHEC, LArFCAl, Tile) can also be accessed individually. It has additional methods to allow fast access to any cell, given its hash identifier. CaloCellContainer is normally built by CaloRec/CaloCellMaker.cxx, and finalized by CaloRec/CaloCellContainerFinalizerTool.cxx. CaloCellContainer is NOT meant to be used for private list of cells, a simple std::vector<const CaloCell*> is best used.
Definition at line 54 of file CaloCellContainer.h.
|
inherited |
Definition at line 817 of file DataVector.h.
|
inherited |
Definition at line 854 of file DataVector.h.
|
inherited |
The T value used as the template parameter.
Note that this is different from value_type (that's T*).
Definition at line 825 of file DataVector.h.
|
inherited |
Definition at line 807 of file DataVector.h.
| typedef std::vector<const CaloCell*> CaloCellContainer::CellVector |
type to be used for the internal lookup table, and to return list of cells
Definition at line 72 of file CaloCellContainer.h.
|
inherited |
Standard const_iterator.
Definition at line 838 of file DataVector.h.
|
inherited |
Definition at line 819 of file DataVector.h.
|
inherited |
Definition at line 813 of file DataVector.h.
|
inherited |
Standard const_reverse_iterator.
Definition at line 847 of file DataVector.h.
|
inherited |
Definition at line 821 of file DataVector.h.
|
inherited |
Definition at line 797 of file DataVector.h.
|
inherited |
Definition at line 857 of file DataVector.h.
|
inherited |
Definition at line 815 of file DataVector.h.
|
inherited |
Definition at line 798 of file DataVector.h.
|
inherited |
This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership.
Definition at line 833 of file DataVector.h.
|
inherited |
Standard iterator.
Note that lvalue references here will yield an ElementProxy, not a reference.
Definition at line 842 of file DataVector.h.
| typedef std::vector<CaloCell*> CaloCellContainer::MutableCellVector |
Return from non-const findCellVector.
Definition at line 75 of file CaloCellContainer.h.
|
inherited |
Definition at line 818 of file DataVector.h.
|
inherited |
This is the type of the underlying std::vector (what stdcont returns).
Definition at line 806 of file DataVector.h.
|
inherited |
Definition at line 812 of file DataVector.h.
|
inherited |
Standard reverse_iterator.
Note that lvalue references here will yield an ElementProxy, not a reference.
Definition at line 852 of file DataVector.h.
|
privateinherited |
Definition at line 2063 of file DataVector.h.
|
inherited |
Definition at line 814 of file DataVector.h.
|
inherited |
Type of a unique_ptr that can be used to insert elements into this container.
Definition at line 829 of file DataVector.h.
|
inherited |
Definition at line 816 of file DataVector.h.
| CaloCellContainer::CaloCellContainer | ( | SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS | ) |
Main constructor.
Definition at line 48 of file CaloCellContainer.cxx.
| CaloCellContainer::CaloCellContainer | ( | size_t | n, |
| SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS ) |
Sized constructor.
Definition at line 67 of file CaloCellContainer.cxx.
|
inlinevirtual |
|
inherited |
Assign from iterators.
| first | The start of the range to put in the container. |
| last | The end of the range to put in the container. |
Any existing owned elements will be released. The DataVector's ownership policy determines whether it will take ownership of the new elements.
|
privateinherited |
Handle element assignment from a base pointer.
| pos | Position in the container to assign. |
| newElem | The new element to assign. |
The old element is freed if this container owns elements. Auxiliary data are copied if appropriate.
|
privateinherited |
Handle element assignment.
| pos | Position in the container to assign. |
| newElem | The new element to assign. |
The old element is freed if this container owns elements. Auxiliary data are copied if appropriate.
|
inherited |
Access an element, as an rvalue.
| n | Array index to access. |
Will raise std::out_of_range if the index is out-of-bounds. Note that we return a const T* rather than a reference.
|
inherited |
Convert to AuxVectorBase.
Needed to get AuxVectorBase from a ConstDataVector. Present in DataVector as well for consistency. We only really need it in the base class; however, root6 fails constructing a TMethodCall for this if there is virtual derivation. A workaround is to redeclare this in the derived classes too.
|
inherited |
Access the last element in the collection as an rvalue.
No checking is done to ensure that the container is not empty. Note that we return a const T* rather than a reference.
|
staticinherited |
Return the offset of a base DataVector class.
| ti | std::type_info of the desired class. |
If ti represents a DataVector base class of this one, then return the offset of that base class. Otherwise, return -1.
This function is here due to limitations of root 6, which can't calculate these offsets correctly from the dictionary if virtual derivation is used.
|
staticinherited |
Helper for baseOffset.
| p | Pointer to the start of the top-level object. |
| dv | Reference to the DataVector object. |
| ti | std::type_info of the desired class. |
If ti represents a DataVector base class of this one, then return the offset of that base class. Otherwise, return -1.
|
noexceptinherited |
Return a const_iterator pointing at the beginning of the collection.
const_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
| CaloCellContainer::iterator CaloCellContainer::beginCalo | ( | CaloCell_ID::SUBCALO | caloNum | ) |
get non const iterators on cell of just one calo
Definition at line 123 of file CaloCellContainer.cxx.
| CaloCellContainer::const_iterator CaloCellContainer::beginConstCalo | ( | CaloCell_ID::SUBCALO | caloNum | ) | const |
get const iterators on cell of just one calo
Definition at line 119 of file CaloCellContainer.cxx.
|
noexceptinherited |
Returns the total number of elements that the collection can hold before needing to allocate more memory.
|
noexceptinherited |
Return a const_iterator pointing at the beginning of the collection.
const_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
|
noexceptinherited |
Return a const_iterator pointing past the end of the collection.
const_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
| bool CaloCellContainer::checkOrdered | ( | ) | const |
verify one by one the container is ordered
Definition at line 173 of file CaloCellContainer.cxx.
| bool CaloCellContainer::checkOrderedAndComplete | ( | ) | const |
verify one by one the container is complete (i.e.
size is equal to the maximum of hash identifier) and in order
Definition at line 150 of file CaloCellContainer.cxx.
|
inherited |
Erase all the elements in the collection.
Erase all the elements in the collection, and reset the ownership mode.
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
| ownPolicy | The new ownership policy of the container. |
| trackIndices | The index tracking policy. |
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
|
protectedinherited |
Clear m_isMostDerived for this instance and for all bases.
Called from the constructor after setting m_isMostDerived.
|
noexceptinherited |
Return a const_reverse_iterator pointing past the end of the collection.
const_reverse_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
|
noexceptinherited |
Return a const_reverse_iterator pointing at the beginning of the collection.
const_reverse_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
|
staticinherited |
Helper to shorten calls to DataModel_detail::DVLCast.
| p | The value to convert. |
const T*.The conversion will be done with static_cast if possible, with dynamic_cast otherwise.
|
staticinherited |
Helper to shorten calls to DataModel_detail::DVLCast.
| p | The value to convert. |
T*.The conversion will be done with static_cast if possible, with dynamic_cast otherwise.
|
overrideprivatevirtualinherited |
Find the most-derived DataVector class in the hierarchy.
type_info for the class for which this method gets run.This is used to generate a nice error message when the most-derived check for insertions fails. Every DataVector defines this virtual method, so when it's called, the one corresponding to the most-derived DataVector gets run.
|
staticinherited |
Return the DV/DL info struct for this class.
This can be used to make sure that it's instantiated.
|
overridevirtualinherited |
Return the DV/DL info struct for this class.
This can be used to make sure that it's instantiated.
|
inherited |
Add a new element to the collection.
| position | Iterator before which the element will be added. |
| pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector in the hierarchy.
For DataVector, this is just the same as insert. It's included just for interface compatibility with std::vector.
|
inherited |
Add an element to the end of the collection.
| pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector in the hierarchy.
For DataVector, this is like the same as push_back, and it returns the pushed element. It's included just for interface compatibility with std::vector.
|
nodiscardnoexceptinherited |
Returns true if the collection is empty.
|
noexceptinherited |
Return a const_iterator pointing past the end of the collection.
const_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
| CaloCellContainer::iterator CaloCellContainer::endCalo | ( | CaloCell_ID::SUBCALO | caloNum | ) |
Definition at line 128 of file CaloCellContainer.cxx.
| CaloCellContainer::const_iterator CaloCellContainer::endConstCalo | ( | CaloCell_ID::SUBCALO | caloNum | ) | const |
Definition at line 133 of file CaloCellContainer.cxx.
|
inherited |
| CaloCell * CaloCellContainer::findCell | ( | const IdentifierHash | theHash | ) |
fast find method given identifier hash.
If the container is not ordered and complete a look up map is used, which is build the first time this method of findCellVector is used
Definition at line 354 of file CaloCellContainer.cxx.
| const CaloCell * CaloCellContainer::findCell | ( | const IdentifierHash | theHash | ) | const |
fast find method given identifier hash.
If the container is not ordered and complete a look up map is used, which is build the first time this method of findCellVector is used
Definition at line 345 of file CaloCellContainer.cxx.
| void CaloCellContainer::findCellVector | ( | const std::vector< IdentifierHash > & | theVectorHash, |
| CellVector & | theCellVector ) const |
fast find method given vector of identifier hash.
Be careful that the order of cell return may not match the order of the inputs, and that some cells may be missing
Definition at line 422 of file CaloCellContainer.cxx.
| void CaloCellContainer::findCellVector | ( | const std::vector< IdentifierHash > & | theVectorHash, |
| MutableCellVector & | theCellVector ) |
fast find method given vector of identifier hash.
Be careful that the order of cell return may not match the order of the inputs, and that some cells may be missing
Definition at line 457 of file CaloCellContainer.cxx.
|
staticprivate |
Look up a group of cells by IdentifierHash.
This is a templated version that can be instantiated for both const and non-const versions.
| cont | The container from which to fetch cells. |
| theVectorHash | Vector of desired IdentifierHash's. |
| theCellVector | Found cells will be appended to this vector. |
Definition at line 389 of file CaloCellContainer.cxx.
| int CaloCellContainer::findIndex | ( | const IdentifierHash | theHash | ) | const |
Return index of the cell with a given hash.
Returns -1 if the cell isn't found.
Definition at line 363 of file CaloCellContainer.cxx.
|
inherited |
Access the first element in the collection as an rvalue.
No checking is done to ensure that the container is not empty. Note that we return a const T* rather than a reference.
|
inherited |
Access an element, as an rvalue.
| n | Array index to access. |
This is a synonym for operator[] const, to be used when calling from root (where we can't readily call just the const version of a method).
|
private |
Retrieve an initialized lookup table.
Definition at line 586 of file CaloCellContainer.cxx.
| bool CaloCellContainer::hasCalo | ( | const CaloCell_ID::SUBCALO | caloNum | ) | const |
tell wether it has been filled with cells (maybe none) of a given calo
Definition at line 209 of file CaloCellContainer.cxx.
|
inline |
tell wether container has total hash id size
Definition at line 289 of file CaloCellContainer.h.
| int CaloCellContainer::indexFirstCellCalo | ( | const CaloCell_ID::SUBCALO | caloNum | ) | const |
index of first cell of given calorimeter (-1 if none).
Note that it is normally more efficient to use iterators
Definition at line 137 of file CaloCellContainer.cxx.
| int CaloCellContainer::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 iterators.
Definition at line 141 of file CaloCellContainer.cxx.
| void CaloCellContainer::initializeLookUpTable | ( | ) |
initialize look up table.
Note that the look up table is initialized the first time findcell is called. If new cells are added afterwards (should not be the case) the lookuptable need be reinitialized by hand
Definition at line 467 of file CaloCellContainer.cxx.
|
inherited |
Add a new element to the collection.
| position | Iterator before which the element will be added. |
| pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector in the hierarchy.
|
inherited |
Insert the contents of another DataVector, with auxiliary data copied via move semantics.
| position | Iterator before which the new elements will be added. |
| other | The vector to add. |
The ownership mode of this vector must be the same as other; otherwise, an exception will be thrown.
If both vectors are view vectors, then this is the same as insert (position, other.begin(), other.end()) .
Otherwise, the elements from other will be inserted into this vector. This vector will take ownership of the elements, and the ownership mode of other will be changed to VIEW_ELEMENTS. Auxiliary data for these elements will be transferred, using move semantics if possible. (Thus, the auxiliary store for other may be modified and must not be locked.) Finally, the auxiliary store pointer for other will be cleared (but the store itself will not be deleted since it's not owned by the vector).
Note: this method may only be called using the most derived DataVector in the hierarchy.
|
inline |
tell wether container is ordered
Definition at line 293 of file CaloCellContainer.h.
|
inline |
tell wether container is complete and in order
Definition at line 298 of file CaloCellContainer.h.
|
staticinherited |
Swap the referents of two DataVector iterators.
| a | The first iterator for the swap. |
| b | The second iterator for the swap. |
|
noexceptinherited |
Returns the size() of the largest possible collection.
|
private |
get message service
| int CaloCellContainer::nCellsCalo | ( | const CaloCell_ID::SUBCALO | caloNum | ) | const |
get number of cels of given calorimeter
Definition at line 145 of file CaloCellContainer.cxx.
|
inherited |
Access an element, as an rvalue.
| n | Array index to access. |
No bounds checking is done. Note that we return a const T* rather than a reference.
| void CaloCellContainer::order | ( | ) |
order container
Definition at line 474 of file CaloCellContainer.cxx.
|
private |
order when container is complete
Definition at line 556 of file CaloCellContainer.cxx.
|
private |
order when container is incomplete
Definition at line 485 of file CaloCellContainer.cxx.
|
inherited |
Return the ownership policy setting for this container.
|
inherited |
Remove the last element from the collection.
If the container owns its elements, then the removed element will be deleted.
|
static |
dump (obsolete)
Definition at line 112 of file CaloCellContainer.cxx.
| void CaloCellContainer::push_back | ( | CaloCell * | theCell | ) |
reimplementation of const push_back
Definition at line 74 of file CaloCellContainer.cxx.
| void CaloCellContainer::push_back | ( | std::unique_ptr< CaloCell > | theCell | ) |
reimplementation of const push_back(unique_ptr>)
Definition at line 90 of file CaloCellContainer.cxx.
|
inherited |
Add an element to the end of the collection.
| pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector in the hierarchy.
Returns the pushed pointer.
| void CaloCellContainer::push_back_fast | ( | CaloCell * | theCell | ) |
reimplementation of push_back to gain speed in readin
Definition at line 102 of file CaloCellContainer.cxx.
| void CaloCellContainer::push_back_fast | ( | std::unique_ptr< CaloCell > | theCell | ) |
reimplementation of push_back to gain speed in readin (UP version)
Definition at line 107 of file CaloCellContainer.cxx.
|
inherited |
Create and add a number of new elements to the end of the container.
| n | The number of new elements to add. |
| alloc | Functional to call to allocate a new element to push. Should be callable like T* = alloc(); For example: Definition FooBar.h:9 DataPool. |
Note: this method may only be called using the most derived DataVector in the hierarchy.
Returns the original size of the vector.
|
noexceptinherited |
Return a const_reverse_iterator pointing past the end of the collection.
const_reverse_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
|
noexceptinherited |
Return a const_reverse_iterator pointing at the beginning of the collection.
const_reverse_iterator.Note that dereferencing the iterator will yield a const T* rather than a reference.
|
inherited |
Attempt to preallocate enough memory for a specified number of elements.
| n | Number of elements required. |
| void CaloCellContainer::resetLookUpTable | ( | ) |
reset look up table
Definition at line 462 of file CaloCellContainer.cxx.
|
inherited |
Resizes the collection to the specified number of elements.
| sz | The new size of the collection. |
Note that this function differs from the standard in that it does not allow specifying the value of any inserted elements. They will always be 0.
If the container is shrunk, elements will be deleted as with erase().
|
inherited |
Reset indices / reorder aux data after elements have been permuted.
| beg | Start of the range of elements to process. |
| end | End of the range of elements to process. |
Call this after some operation that has permuted the elements in the container (such as sort). The index information in the elements will be used to permute all auxiliary data in the same way. Finally, all the indices will be reset in the correct order.
| void CaloCellContainer::setHasCalo | ( | const CaloCell_ID::SUBCALO | caloNum | ) |
set which calo has been filled.
Definition at line 213 of file CaloCellContainer.cxx.
|
private |
If @ flag is true, then the container size equals the maximum hash.
Only CaloCellContainerFinalizer tool is allowed to set this. Now, set this in EmptyCellBuilderTool as it is always true.
Definition at line 169 of file CaloCellContainer.cxx.
| void CaloCellContainer::setIsOrdered | ( | const bool | ordered | ) |
indicates that the container is ordered
Definition at line 204 of file CaloCellContainer.cxx.
| void CaloCellContainer::setIsOrderedAndComplete | ( | const bool | ordered | ) |
indicate that the container is complete and in order
Definition at line 165 of file CaloCellContainer.cxx.
|
overrideprotectedvirtualinherited |
Set m_isMostDerived for this instance and clear it for all bases.
Called from testInsert if the test fails. The flag may not have been set if this container was made via copy construction, so set it appropriately now so we can test again.
|
privateinherited |
Shift the auxiliary elements of the container.
| pos | The starting index for the shift. |
| offs | The (signed) amount of the shift. |
The elements in the container should have already been shifted; this operation will then adjust the element indices and also shift the elements in the vectors for all aux data items. offs may be either positive or negative.
If offs is positive, then the container is growing. The container size should be increased by offs, the element at pos moved to pos + offs, and similarly for following elements. The elements between pos and pos + offs should be default-initialized.
If offs is negative, then the container is shrinking. The element at pos should be moved to pos + offs, and similarly for following elements. The container should then be shrunk by -offs elements (running destructors as appropriate).
|
inherited |
|
noexceptinherited |
Returns the number of elements in the collection.
Could in principle be inherited from the base class, but redeclared in the derived class to avoid root6 bugs.
|
inherited |
Sort the container.
This just sorts by pointer value, so it's probably not very useful.
|
inherited |
Return the underlying std::vector of the container.
std::vector actually holding the collection.Note that DataVector<T>::stdcont does not necessarily return a std::vector<T*> if DataVector inheritance is being used.
|
inherited |
Swap this collection with another.
| rhs | The collection with which to swap. |
Ownership is swapped along with the collection content.
Note: this method may only be called using the most-derived DataVector in the hierarchy. The rhs must also be referenced using the most-derived DataVector.
|
inherited |
Swap one element out of the container.
| index | Index of the element in the container to swap. |
| newElem | New element to put in the container. May be 0. |
| oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.
Note: this method may only be called using the most derived DataVector in the hierarchy.
|
inherited |
Test if we can insert; raise an exception if not.
| op | Description of the attempted operation. |
In order to maintain type-safety, we can only allow insertions using the most-derived instance of DataVector. This checks this by testing the m_isMostDerived, which is set by the constructors to true only for the most-derived instance. If the test fails, we call to potentially out-of-line code to continue.
|
inherited |
Test if we can insert; raise an exception if not.
| op | Description of the attempted operation. |
This continues the test of testInsert. There is one case where m_isMostDerived may not be set correctly. If this container was made via copy construction, then all the m_isMostDerived flags will be false. So we call setMostDerived to set the flags correctly and test again. If the test fails again, then we raise an exception.
| void CaloCellContainer::updateCaloBeginIterators | ( | int | ic, |
| int | ind ) |
fills calo iterators and the index of first cell for a given subcalo
Definition at line 326 of file CaloCellContainer.cxx.
| void CaloCellContainer::updateCaloEndIterators | ( | int | ic, |
| int | ind ) |
fills calo iterators and the index of last cell for a given subcalo
Definition at line 338 of file CaloCellContainer.cxx.
| void CaloCellContainer::updateCaloIterators | ( | ) |
fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO CALL THIS METHOD ONCE THE FILLING IS FINISHED Please use CaloCellContainerFinalizerTool to make sure the container is properly finalised.
Definition at line 268 of file CaloCellContainer.cxx.
|
private |
Recursively find division points between subcalos in the container.
Should run in ~ m log n time, where n is the number of cells and m is the number of subcalos.
The cells need to be sorted for this to work.
Definition at line 245 of file CaloCellContainer.cxx.
|
friend |
Definition at line 63 of file CaloCellContainer.h.
|
friend |
Definition at line 67 of file CaloCellContainer.h.
|
friend |
Definition at line 64 of file CaloCellContainer.h.
|
friend |
Definition at line 62 of file CaloCellContainer.h.
|
friend |
Definition at line 66 of file CaloCellContainer.h.
|
friend |
Definition at line 65 of file CaloCellContainer.h.
|
staticinherited |
This is true for any DataVector class if we need to use virtual derivation to get to the base DataVector class.
Definition at line 802 of file DataVector.h.
|
private |
non const iterators for the different calorimeters
Definition at line 286 of file CaloCellContainer.h.
|
private |
const iterators for the different calorimeters
Definition at line 284 of file CaloCellContainer.h.
|
private |
Definition at line 286 of file CaloCellContainer.h.
|
private |
Definition at line 284 of file CaloCellContainer.h.
|
private |
true if given cell from given calo has been filled (even if none)
Definition at line 275 of file CaloCellContainer.h.
|
private |
true if size correspond to maximum hash.
only CaloCellContainerFinalizer tool is allowed to set this
Definition at line 265 of file CaloCellContainer.h.
|
private |
index of first cell of given calo (-1 if none)
Definition at line 278 of file CaloCellContainer.h.
|
private |
index of first cell of given calo (-2 if none)
Definition at line 281 of file CaloCellContainer.h.
|
privateinherited |
This flag is true if this DV instance is the most-derived one.
We set this to true in the top-level constructor; the constructor then calls clearMostDerived on the base classes.
Definition at line 2059 of file DataVector.h.
|
private |
true if ordered
Definition at line 269 of file CaloCellContainer.h.
|
private |
true if complete and in right order
Definition at line 272 of file CaloCellContainer.h.
|
private |
look up table of size HashIdentifiermax.
Definition at line 261 of file CaloCellContainer.h.
|
staticconstexprinherited |
If true, then this type must own its contents.
Definition at line 860 of file DataVector.h.