ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CaloConstCellContainer Class Reference

CaloCellContainer that can accept const cell pointers. More...

#include <CaloConstCellContainer.h>

Inheritance diagram for CaloConstCellContainer:
Collaboration diagram for CaloConstCellContainer:

Public Types

typedef DV::size_type size_type
 Basic types, forwarded from the base. More...
 
typedef DV::difference_type difference_type
 
typedef DV::allocator_type allocator_type
 
typedef DV::base_value_type base_value_type
 
typedef DV::BaseContainer BaseContainer
 
typedef DV::DVL_BASE DVL_BASE
 
typedef DV::const_iterator const_iterator
 
typedef DV::const_reverse_iterator const_reverse_iterator
 
typedef DataVector< base_value_typebase_data_vector
 
typedef DV::const_value_type value_type
 These types get modified so that the base's const_value_type becomes our value_type. More...
 
typedef DV::const_value_type const_value_type
 
typedef DV::const_value_type & reference
 
typedef DV::const_value_type constconst_reference
 
typedef DV::const_value_type * pointer
 
typedef DV::const_value_type constconst_pointer
 
typedef std::unique_ptr< const base_value_typeunique_type
 Type of a unique_ptr that can be used to insert elements into this container. More...
 
typedef DataModel_detail::ElementProxy< ConstDataVectorElementProxy
 This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership. More...
 
typedef DataModel_detail::iterator< ConstDataVectoriterator
 The iterator for this type. More...
 
typedef std::reverse_iterator< iteratorreverse_iterator
 Standard reverse_iterator. More...
 
typedef boost::true_type isSequence
 

Public Member Functions

 CaloConstCellContainer (SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
 Constructor. More...
 
::CaloCellContainer::const_iterator beginConstCalo (CaloCell_ID::SUBCALO caloNum) const
 get const begin iterator on cell of just one calo More...
 
::CaloCellContainer::const_iterator endConstCalo (CaloCell_ID::SUBCALO caloNum) const
 get const begin iterator on cell of just one calo More...
 
bool checkOrderedAndComplete () const
 verify one by one the container is complete (i.e. More...
 
void setIsOrderedAndComplete (bool ordered)
 indicate that the container is complete and in order More...
 
bool isOrderedAndComplete () const
 tell wether container is complete and in order More...
 
bool checkOrdered () const
 verify one by one the container is ordered More...
 
void setIsOrdered (bool ordered)
 indicates that the container is ordered More...
 
bool isOrdered () const
 tell wether container is ordered More...
 
bool hasTotalSize () const
 tell wether container has total hash id size More...
 
bool hasCalo (const CaloCell_ID::SUBCALO caloNum) const
 tell whether it has been filled with cells (maybe none) of a given calo More...
 
int indexFirstCellCalo (const CaloCell_ID::SUBCALO caloNum) const
 index of first cell of given calorimeter (-1 if none). More...
 
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. More...
 
int nCellsCalo (const CaloCell_ID::SUBCALO caloNum) const
 get number of cels of given calorimeter More...
 
void setHasCalo (CaloCell_ID::SUBCALO caloNum)
 set which calo has been filled. More...
 
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. More...
 
void updateCaloBeginIterators (int ic, int ind)
 fills calo iterators and the index of first cell for a given subcalo More...
 
void updateCaloEndIterators (int ic, int ind)
 fills calo iterators and the index of last cell for a given subcalo More...
 
const CaloCellfindCell (IdentifierHash theHash) const
 fast find method given identifier hash. More...
 
int findIndex (IdentifierHash theHash) const
 Return index of the cell with a given hash. More...
 
void findCellVector (const std::vector< IdentifierHash > &theVectorHash, ::CaloCellContainer::CellVector &theCellVector) const
 fast find method given vector of identifier hash. More...
 
void order ()
 order container More...
 
void push_back_fast (const CaloCell *cell)
 reimplementation of push_back to gain speed in readin More...
 
void push_back_fast (std::unique_ptr< const CaloCell > cell)
 reimplementation of push_back to gain speed in readin (UP version) More...
 
void resetLookUpTable ()
 reset look up table More...
 
void push_back_fast (CaloCell *)
 reimplementation of push_back to gain speed in readin More...
 
CaloCellfindCell (const IdentifierHash theHash)
 fast find method given identifier hash. More...
 
void findCellVector (const std::vector< IdentifierHash > &theVectorHash, CellVector &theCellVector) const
 fast find method given vector of identifier hash. More...
 
void findCellVector (const std::vector< IdentifierHash > &theVectorHash, MutableCellVector &theCellVector)
 fast find method given vector of identifier hash. More...
 
Constructors, destructors, assignment.
void assign (InputIterator first, InputIterator last)
 Assign from iterators. More...
 
void assign (std::initializer_list< value_type > l)
 Assign from an initializer list. More...
 
void assign (const std::vector< ElementLink< CONTAINER > > &v)
 Assign from a vector of ElementLinks. More...
 
Element access.
ElementProxy operator[] (size_type n)
 Access an element, as an lvalue. More...
 
ElementProxy at (size_type n)
 Access an element, as an lvalue. More...
 
ElementProxy front ()
 Access the first element in the collection as an lvalue. More...
 
ElementProxy back ()
 Access the last element in the collection as an lvalue. More...
 
Iterator creation.
iterator begin () noexcept
 Return an iterator pointing at the beginning of the collection. More...
 
iterator end () noexcept
 Return an iterator pointing past the end of the collection. More...
 
reverse_iterator rbegin () noexcept
 Return a reverse_iterator pointing past the end of the collection. More...
 
reverse_iterator rend () noexcept
 Return a reverse_iterator pointing at the beginning of the collection. More...
 
Insertion operations.
value_type push_back (value_type pElem)
 Add an element to the end of the collection. More...
 
value_type push_back (std::unique_ptr< const base_value_type > pElem)
 Add an element to the end of the collection. More...
 
value_type emplace_back (value_type pElem)
 Add an element to the end of the collection. More...
 
iterator insert (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
void insert (iterator position, InputIterator first, InputIterator last)
 Add a group of new elements to the collection. More...
 
iterator insert (iterator position, std::unique_ptr< const base_value_type > pElem)
 Add a new element to the collection. More...
 
void insert (iterator position, std::initializer_list< value_type > l)
 Add a group of new elements to the collection. More...
 
iterator emplace (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position. More...
 
iterator erase (iterator first, iterator last)
 Remove a range of elements. More...
 
void clear ()
 Erase all the elements in the collection. More...
 
Relational operators.
bool operator< (const ConstDataVector &b) const
 Vector ordering relation. More...
 
bool operator> (const ConstDataVector &b) const
 Based on operator<. More...
 
bool operator<= (const ConstDataVector &b) const
 Based on operator<. More...
 
bool operator>= (const ConstDataVector &b) const
 Based on operator<. More...
 
bool operator== (const ConstDataVector &b) const
 Vector equality comparison. More...
 
bool operator!= (const ConstDataVector &b) const
 Based on operator==. More...
 
Element access.
ElementProxy operator[] (size_type n)
 Access an element, as an lvalue. More...
 
ElementProxy at (size_type n)
 Access an element, as an lvalue. More...
 
ElementProxy front ()
 Access the first element in the collection as an lvalue. More...
 
ElementProxy back ()
 Access the last element in the collection as an lvalue. More...
 
Iterator creation.
iterator begin () noexcept
 Return an iterator pointing at the beginning of the collection. More...
 
iterator end () noexcept
 Return an iterator pointing past the end of the collection. More...
 
reverse_iterator rbegin () noexcept
 Return a reverse_iterator pointing past the end of the collection. More...
 
reverse_iterator rend () noexcept
 Return a reverse_iterator pointing at the beginning of the collection. More...
 
Insertion operations.
value_type push_back (value_type pElem)
 Add an element to the end of the collection. More...
 
value_type push_back (std::unique_ptr< const base_value_type > pElem)
 Add an element to the end of the collection. More...
 
value_type emplace_back (value_type pElem)
 Add an element to the end of the collection. More...
 
iterator insert (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
void insert (iterator position, InputIterator first, InputIterator last)
 Add a group of new elements to the collection. More...
 
iterator insert (iterator position, std::unique_ptr< const base_value_type > pElem)
 Add a new element to the collection. More...
 
void insert (iterator position, std::initializer_list< value_type > l)
 Add a group of new elements to the collection. More...
 
iterator emplace (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position. More...
 
iterator erase (iterator first, iterator last)
 Remove a range of elements. More...
 
void clear ()
 Erase all the elements in the collection. More...
 
Relational operators.
bool operator< (const ConstDataVector &b) const
 Vector ordering relation. More...
 
bool operator> (const ConstDataVector &b) const
 Based on operator<. More...
 
bool operator<= (const ConstDataVector &b) const
 Based on operator<. More...
 
bool operator>= (const ConstDataVector &b) const
 Based on operator<. More...
 
bool operator== (const ConstDataVector &b) const
 Vector equality comparison. More...
 
bool operator!= (const ConstDataVector &b) const
 Based on operator==. More...
 

Static Public Attributes

static const bool has_virtual
 This needs to be forwarded from the base as well. More...
 
static constexpr bool must_own
 If true, then this type must own its contents. More...
 

Private Types

typedef std::vector< const CaloCell * > CellVector
 type to be used for the internal lookup table, and to return list of cells More...
 
typedef std::vector< CaloCell * > MutableCellVector
 Return from non-const findCellVector. More...
 
typedef BASE DataVector_BASE
 
typedef BASE::PtrVector PtrVector
 This is the type of the underlying std::vector (what stdcont returns). More...
 
using Deleter = typename BASE::Deleter
 
typedef DataVector< CaloCell, BASE > self
 A helper typedef. More...
 

Private Member Functions

void setHasTotalSize (bool flag)
 If @ flag is true, then the container size equals the maximum hash. More...
 
::CaloCellContainerbaseContainer ()
 Return a non-const pointer to the base container. More...
 
void push_back (CaloCell *)
 reimplementation of const push_back More...
 
void push_back (std::unique_ptr< CaloCell >)
 reimplementation of const push_back(unique_ptr>) More...
 
CaloCellContainer::iterator beginCalo (CaloCell_ID::SUBCALO caloNum)
 get non const iterators on cell of just one calo More...
 
CaloCellContainer::iterator endCalo (CaloCell_ID::SUBCALO caloNum)
 
void initializeLookUpTable ()
 initialize look up table. More...
 
IMessageSvc * msgSvc () const
 get message service More...
 
void updateCaloIteratorsOrdered (CaloCellContainer::iterator beg, CaloCellContainer::iterator end)
 Recursively find division points between subcalos in the container. More...
 
void orderWhenIncomplete ()
 order when container is incomplete More...
 
void orderWhenComplete ()
 order when container is complete More...
 
const CxxUtils::PackedArraygetLookUpTable () const
 Retrieve an initialized lookup table. More...
 
Size and capacity.
size_type size () const noexcept
 Returns the number of elements in the collection. More...
 
void resize (size_type sz)
 Resizes the collection to the specified number of elements. More...
 
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements. More...
 
Constructors, destructors, assignment.
void assign (std::initializer_list< value_type > l)
 
Element access.

Change the vector capacity to match the current size.

Note: this does not affect auxiliary data.

const CaloCelloperator[] (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy operator[] (size_type n)
 Access an element, as an lvalue. More...
 
const CaloCellat (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy at (size_type n)
 Access an element, as an lvalue. More...
 
const CaloCellget (size_type n) const
 Access an element, as an rvalue. More...
 
Insertion operations.
value_type push_back (value_type pElem)
 Add an element to the end of the collection. More...
 
value_type emplace_back (value_type pElem)
 Add an element to the end of the collection. More...
 
iterator insert (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
iterator insert (iterator position, std::unique_ptr< base_value_type > pElem)
 Add a new element to the collection. More...
 
void insert (iterator position, InputIterator first, InputIterator last)
 Add a group of new elements to the collection. More...
 
void insert (iterator position, std::initializer_list< value_type > l)
 Add a group of new elements to the collection. More...
 
iterator emplace (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
void insertMove (iterator position, DataVector &other)
 Insert the contents of another DataVector, with auxiliary data copied via move semantics. More...
 
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position. More...
 
iterator erase (iterator first, iterator last)
 Remove a range of elements. More...
 
void pop_back ()
 Remove the last element from the collection. More...
 
Size and capacity.
size_type size () const noexcept
 Returns the number of elements in the collection. More...
 
void resize (size_type sz)
 Resizes the collection to the specified number of elements. More...
 
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements. More...
 
Iterator creation.
const_iterator cbegin () const noexcept
 Return a const_iterator pointing at the beginning of the collection. More...
 
const_iterator cend () const noexcept
 Return a const_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection. More...
 
Insertion operations.
value_type push_back (value_type pElem)
 Add an element to the end of the collection. More...
 
value_type emplace_back (value_type pElem)
 Add an element to the end of the collection. More...
 
iterator insert (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
iterator insert (iterator position, std::unique_ptr< base_value_type > pElem)
 Add a new element to the collection. More...
 
void insert (iterator position, InputIterator first, InputIterator last)
 Add a group of new elements to the collection. More...
 
void insert (iterator position, std::initializer_list< value_type > l)
 Add a group of new elements to the collection. More...
 
iterator emplace (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
void insertMove (iterator position, DataVector &other)
 Insert the contents of another DataVector, with auxiliary data copied via move semantics. More...
 
Constructors, destructors, assignment.
void assign (std::initializer_list< value_type > l)
 
Size and capacity.
size_type size () const noexcept
 Returns the number of elements in the collection. More...
 
void resize (size_type sz)
 Resizes the collection to the specified number of elements. More...
 
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements. More...
 
Element access.

Change the vector capacity to match the current size.

Note: this does not affect auxiliary data.

const CaloCelloperator[] (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy operator[] (size_type n)
 Access an element, as an lvalue. More...
 
const CaloCellget (size_type n) const
 Access an element, as an rvalue. More...
 
const CaloCellat (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy at (size_type n)
 Access an element, as an lvalue. More...
 
Iterator creation.
const_iterator cbegin () const noexcept
 Return a const_iterator pointing at the beginning of the collection. More...
 
const_iterator cend () const noexcept
 Return a const_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection. More...
 
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position. More...
 
iterator erase (iterator first, iterator last)
 Remove a range of elements. More...
 
void pop_back ()
 Remove the last element from the collection. More...
 
Size and capacity.
size_type size () const noexcept
 Returns the number of elements in the collection. More...
 
void resize (size_type sz)
 Resizes the collection to the specified number of elements. More...
 
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements. More...
 

Static Private Member Functions

static void print ()
 dump (obsolete) More...
 
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. More...
 

Private Attributes

CxxUtils::CachedValue< CxxUtils::PackedArraym_lookUpTable
 look up table of size HashIdentifiermax. More...
 
bool m_hasTotalSize
 true if size correspond to maximum hash. More...
 
bool m_isOrdered
 true if ordered
More...
 
bool m_isOrderedAndComplete
 true if complete and in right order More...
 
std::vector< bool > m_hasCalo
 true if given cell from given calo has been filled (even if none) More...
 
std::vector< int > m_indexFirstCellCalo
 index of first cell of given calo (-1 if none) More...
 
std::vector< int > m_indexLastCellCalo
 index of first cell of given calo (-2 if none) More...
 
std::vector< CaloCellContainer::const_iteratorm_beginConstCalo
 const iterators for the different calorimeters More...
 
std::vector< CaloCellContainer::const_iteratorm_endConstCalo
 
std::vector< CaloCellContainer::iteratorm_beginCalo
 non const iterators for the different calorimeters More...
 
std::vector< CaloCellContainer::iteratorm_endCalo
 
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_isMostDerived
 Automatically generate dictionary for contained vector. More...
 
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_deleter
 
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_ownPolicy
 We do not want to save this. More...
 

Friends

class CaloCellContainerFinalizerTool
 

Swap and sort.

void swap (ConstDataVector &rhs)
 Swap this collection with another. More...
 
static void iter_swap (iterator a, iterator b)
 Swap the referents of two DataVector iterators. More...
 

Non-standard operations.

void clear (SG::OwnershipPolicy ownPolicy)
 Erase all the elements in the collection, and reset the ownership mode. More...
 
void clear (SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy trackIndices)
 
void swapElement (size_type index, value_type newElem, reference oldElem)
 Swap one element out of the container. More...
 
void swapElement (iterator pos, value_type newElem, reference oldElem)
 Swap one element out of the container. More...
 
void swapElement (size_type index, std::unique_ptr< const base_value_type > newElem, std::unique_ptr< const base_value_type > &oldElem)
 Swap one element out of the container. More...
 
void swapElement (iterator pos, std::unique_ptr< const base_value_type > newElem, std::unique_ptr< const base_value_type > &oldElem)
 Swap one element out of the container. More...
 
const CaloCellContainerasDataVector () const
 Return a pointer to this object, as a const DataVector. More...
 
void resortAux (iterator, iterator)
 Reset indices / reorder aux data after elements have been permuted. More...
 
const SG::AuxVectorBaseauxbase () const
 Convert to AuxVectorBase. More...
 
static const ConstDataVectorfromDataVector (const CaloCellContainer *dv)
 Cast from a DataVector to a ConstDataVector. More...
 

Private helpers.

void assignElement (typename BaseContainer::iterator pos, value_type newElem)
 Handle element assignment. More...
 
void assignElement (typename BaseContainer::iterator pos, std::unique_ptr< const base_value_type > newElem)
 Handle element assignment. More...
 
void assignBaseElement (typename BaseContainer::iterator pos, typename BaseContainer::value_type newElem)
 Handle element assignment from a base pointer. More...
 
iterator to_my_iterator (typename DV::iterator it)
 Convert an iterator of the base DataVector to a ConstDataVector::iterator. More...
 
ElementProxy to_element_proxy (typename BaseContainer::iterator i)
 Convert an iterator of the base vector to an ElementProxy for the ConstDataVector. More...
 
static DV::iterator to_base_iterator (iterator it)
 Convert a ConstDataVector::iterator to an iterator of the base DataVector. More...
 

Swap and sort.

void swap (DataVector &rhs)
 Swap this collection with another. More...
 
void sort ()
 Sort the container. More...
 
void sort (COMPARE comp)
 Sort the container with a user-specified comparison operator. More...
 
static void iter_swap (iterator a, iterator b)
 Swap the referents of two DataVector iterators. More...
 

Non-standard operations.

void clear (std::unique_ptr< Deleter > deleter)
 Erase all the elements in the collection, and change how elements are to be deleted. More...
 
void swapElement (size_type index, value_type newElem, reference oldElem)
 Swap one element out of the container. More...
 
void swapElement (iterator pos, value_type newElem, reference oldElem)
 Swap one element out of the container. More...
 
void swapElement (size_type index, std::unique_ptr< base_value_type > newElem, std::unique_ptr< base_value_type > &oldElem)
 Swap one element out of the container. More...
 
void swapElement (iterator pos, std::unique_ptr< base_value_type > newElem, std::unique_ptr< base_value_type > &oldElem)
 Swap one element out of the container. More...
 
void resize (size_type sz)
 
void pop_back ()
 
virtual const DataModel_detail::DVLInfoBasedvlinfo_v () const
 Return the DV/DL info struct for this class. More...
 
size_type max_size () const noexcept
 Returns the size() of the largest possible collection. More...
 
size_type capacity () const noexcept
 Returns the total number of elements that the collection can hold before needing to allocate more memory. More...
 
bool empty () const noexcept
 Returns true if the collection is empty. More...
 
void shrink_to_fit ()
 
const PtrVectorstdcont () const
 Return the underlying std::vector of the container. More...
 
SG::OwnershipPolicy ownPolicy () const
 Return the ownership policy setting for this container. More...
 
static const DataModel_detail::DVLInfoBasedvlinfo ()
 Return the DV/DL info struct for this class. More...
 
static int baseOffset (const std::type_info &ti)
 Return the offset of a base DataVector class. More...
 

Internal operations.

void resortAux (iterator beg, iterator end)
 Reset indices / reorder aux data after elements have been permuted. More...
 
void testInsert (const char *op)
 Test if we can insert; raise an exception if not. More...
 
void testInsertOol (const char *op)
 Test if we can insert; raise an exception if not. More...
 
void shift (size_t pos, ptrdiff_t offs)
 Shift the auxiliary elements of the container. More...
 
virtual const std::type_info & dv_typeid () const
 Find the most-derived DataVector class in the hierarchy. More...
 
void clearMostDerived ()
 Clear m_isMostDerived for this instance and for all bases. More...
 
virtual void setMostDerived ()
 Set m_isMostDerived for this instance and clear it for all bases. More...
 
static int baseOffset1 (const char *p, const DataVector &dv, const std::type_info &ti)
 Helper for baseOffset. More...
 
static const CaloCelldo_cast (const typename PtrVector::value_type p)
 Helper to shorten calls to DataModel_detail::DVLCast. More...
 
static CaloCelldo_cast_nc (typename PtrVector::value_type p)
 Helper to shorten calls to DataModel_detail::DVLCast. More...
 
typedef ROOT_SELECTION_NS::DataVector< CaloCell, DataVector_BASE >::self self
 
SG::IsMostDerivedFlag m_isMostDerived
 This flag is true if this DV instance is the most-derived one. More...
 

Detailed Description

CaloCellContainer that can accept const cell pointers.

For more details about what's going on here, see AthContainers/ConstDataVector.h.

In brief, CaloCellContainer acts as a container of (non-const) CaloCell*, and thus you can't put a const CaloCell* into it. CaloConstCellContainer derives privately from CaloCellContainer. It overrides all accessor methods so that they only return const CaloCell*, and overrides the insertion methods so that they can take const pointers. There are two ways to convert this to a const CaloCellContainer. The first is by calling asDataVector. The second is by recording it in StoreGate and then retrieving it as a CaloCellContainer. When the object is recorded, it will automatically be locked.

Here, we declare only the methods from CaloCellContainer that we want to make visible. The DataVector methods are overridden in ConstDataVector.

Definition at line 43 of file CaloConstCellContainer.h.

Member Typedef Documentation

◆ allocator_type

typedef DV::allocator_type ConstDataVector< CaloCellContainer >::allocator_type
inherited

Definition at line 81 of file ConstDataVector.h.

◆ base_data_vector

Definition at line 89 of file ConstDataVector.h.

◆ base_value_type

typedef DV::base_value_type ConstDataVector< CaloCellContainer >::base_value_type
inherited

Definition at line 82 of file ConstDataVector.h.

◆ BaseContainer

typedef DV::BaseContainer ConstDataVector< CaloCellContainer >::BaseContainer
inherited

Definition at line 83 of file ConstDataVector.h.

◆ CellVector

typedef std::vector<const CaloCell*> CaloCellContainer::CellVector
inherited

type to be used for the internal lookup table, and to return list of cells

Definition at line 83 of file CaloCellContainer.h.

◆ const_iterator

typedef DV::const_iterator ConstDataVector< CaloCellContainer >::const_iterator
inherited

Definition at line 85 of file ConstDataVector.h.

◆ const_pointer

typedef DV::const_value_type const* ConstDataVector< CaloCellContainer >::const_pointer
inherited

Definition at line 98 of file ConstDataVector.h.

◆ const_reference

typedef DV::const_value_type const& ConstDataVector< CaloCellContainer >::const_reference
inherited

Definition at line 96 of file ConstDataVector.h.

◆ const_reverse_iterator

typedef DV::const_reverse_iterator ConstDataVector< CaloCellContainer >::const_reverse_iterator
inherited

Definition at line 86 of file ConstDataVector.h.

◆ const_value_type

typedef DV::const_value_type ConstDataVector< CaloCellContainer >::const_value_type
inherited

Definition at line 94 of file ConstDataVector.h.

◆ DataVector_BASE

typedef BASE DataVector< CaloCell , BASE >::DataVector_BASE
inherited

Definition at line 796 of file DataVector.h.

◆ Deleter

using DataVector< CaloCell , BASE >::Deleter = typename BASE::Deleter
inherited

Definition at line 856 of file DataVector.h.

◆ difference_type

typedef DV::difference_type ConstDataVector< CaloCellContainer >::difference_type
inherited

Definition at line 80 of file ConstDataVector.h.

◆ DVL_BASE

typedef DV::DVL_BASE ConstDataVector< CaloCellContainer >::DVL_BASE
inherited

Definition at line 84 of file ConstDataVector.h.

◆ ElementProxy

This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership.

Definition at line 110 of file ConstDataVector.h.

◆ isSequence

typedef boost::true_type ConstDataVector< CaloCellContainer >::isSequence
inherited

Definition at line 120 of file ConstDataVector.h.

◆ iterator

The iterator for this type.

Definition at line 113 of file ConstDataVector.h.

◆ MutableCellVector

typedef std::vector<CaloCell*> CaloCellContainer::MutableCellVector
inherited

Return from non-const findCellVector.

Definition at line 86 of file CaloCellContainer.h.

◆ pointer

typedef DV::const_value_type* ConstDataVector< CaloCellContainer >::pointer
inherited

Definition at line 97 of file ConstDataVector.h.

◆ PtrVector

typedef BASE::PtrVector DataVector< CaloCell , BASE >::PtrVector
inherited

This is the type of the underlying std::vector (what stdcont returns).

Definition at line 805 of file DataVector.h.

◆ reference

typedef DV::const_value_type& ConstDataVector< CaloCellContainer >::reference
inherited

Definition at line 95 of file ConstDataVector.h.

◆ reverse_iterator

typedef std::reverse_iterator<iterator> ConstDataVector< CaloCellContainer >::reverse_iterator
inherited

Standard reverse_iterator.

Note that lvalue references here will yield an ElementProxy, not a reference.

Definition at line 118 of file ConstDataVector.h.

◆ self [1/2]

typedef ROOT_SELECTION_NS::DataVector<CaloCell , DataVector_BASE>::self DataVector< CaloCell , BASE >::self
privateinherited

Definition at line 2042 of file DataVector.h.

◆ self [2/2]

typedef DataVector< CaloCell , BASE > DataVector< CaloCell , BASE >::self
inherited

A helper typedef.

Definition at line 3428 of file DataVector.h.

◆ size_type

typedef DV::size_type ConstDataVector< CaloCellContainer >::size_type
inherited

Basic types, forwarded from the base.

Definition at line 79 of file ConstDataVector.h.

◆ unique_type

typedef std::unique_ptr<const base_value_type> ConstDataVector< CaloCellContainer >::unique_type
inherited

Type of a unique_ptr that can be used to insert elements into this container.

Definition at line 106 of file ConstDataVector.h.

◆ value_type

typedef DV::const_value_type ConstDataVector< CaloCellContainer >::value_type
inherited

These types get modified so that the base's const_value_type becomes our value_type.

Definition at line 93 of file ConstDataVector.h.

Constructor & Destructor Documentation

◆ CaloConstCellContainer()

CaloConstCellContainer::CaloConstCellContainer ( SG::OwnershipPolicy  ownPolicy = SG::OWN_ELEMENTS)

Constructor.

Member Function Documentation

◆ asDataVector()

Return a pointer to this object, as a const DataVector.

◆ assign() [1/4]

void ConstDataVector< CaloCellContainer >::assign ( const std::vector< ElementLink< CONTAINER > > &  v)
inherited

Assign from a vector of ElementLinks.

Parameters
vThe vector from which to initialize.

This will change the container to a view container.

◆ assign() [2/4]

void ConstDataVector< CaloCellContainer >::assign ( InputIterator  first,
InputIterator  last 
)
inherited

Assign from iterators.

Parameters
firstThe start of the range to put in the container.
lastThe 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.

◆ assign() [3/4]

void ConstDataVector< CaloCellContainer >::assign ( std::initializer_list< value_type l)
inherited

Assign from an initializer list.

Parameters
lAn initializer list.

Any existing owned elements will be released. The DataVector's ownership policy determines whether it will take ownership of the new elements.

◆ assign() [4/4]

void DataVector< CaloCell , BASE >::assign ( std::initializer_list< value_type l)
inherited
Parameters
lAn initializer list.

Any existing owned elements will be released. The DataVector's ownership policy determines whether it will take ownership of the new elements.

◆ assignBaseElement()

void ConstDataVector< CaloCellContainer >::assignBaseElement ( typename BaseContainer::iterator  pos,
typename BaseContainer::value_type  newElem 
)
privateinherited

Handle element assignment from a base pointer.

Parameters
posPosition in the container to assign.
newElemThe new element to assign.

The old element is freed if this container owns elements. Auxiliary data are copied if appropriate.

◆ assignElement() [1/2]

void ConstDataVector< CaloCellContainer >::assignElement ( typename BaseContainer::iterator  pos,
std::unique_ptr< const base_value_type newElem 
)
privateinherited

Handle element assignment.

Parameters
posPosition in the container to assign.
newElemThe new element to assign.

The container must own its elements. Auxiliary data are copied if appropriate.

◆ assignElement() [2/2]

void ConstDataVector< CaloCellContainer >::assignElement ( typename BaseContainer::iterator  pos,
value_type  newElem 
)
privateinherited

Handle element assignment.

Parameters
posPosition in the container to assign.
newElemThe new element to assign.

The old element is freed if this container owns elements. Auxiliary data are copied if appropriate.

◆ at() [1/3]

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

Will raise std::out_of_range if the index is out-of-bounds. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ at() [2/3]

ElementProxy DataVector< CaloCell , BASE >::at ( size_type  n)
inherited

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

Will raise std::out_of_range if the index is out-of-bounds. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ at() [3/3]

const CaloCell * DataVector< CaloCell , BASE >::at ( size_type  n) const
inherited

Access an element, as an rvalue.

Parameters
nArray index to access.
Returns
The element at n.

Will raise std::out_of_range if the index is out-of-bounds. Note that we return a const T* rather than a reference.

◆ auxbase()

Convert to AuxVectorBase.

Needed to get @x AuxVectorBase from a ConstDataVector. Present in DataVector as well for consistency.

◆ back()

Access the last element in the collection as an lvalue.

Returns
Proxy to the last element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ baseContainer()

::CaloCellContainer* CaloConstCellContainer::baseContainer ( )
private

Return a non-const pointer to the base container.

◆ baseOffset()

static int DataVector< CaloCell , BASE >::baseOffset ( const std::type_info &  ti)
staticinherited

Return the offset of a base DataVector class.

Parameters
tistd::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.

◆ baseOffset1()

static int DataVector< CaloCell , BASE >::baseOffset1 ( const char *  p,
const DataVector< CaloCell > &  dv,
const std::type_info &  ti 
)
staticinherited

Helper for baseOffset.

Parameters
pPointer to the start of the top-level object.
dvReference to the DataVector object.
tistd::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.

◆ begin()

iterator ConstDataVector< CaloCellContainer >::begin
noexceptinherited

Return an iterator pointing at the beginning of the collection.

Returns
An iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ beginCalo()

CaloCellContainer::iterator CaloCellContainer::beginCalo ( CaloCell_ID::SUBCALO  caloNum)
inherited

get non const iterators on cell of just one calo

Definition at line 123 of file CaloCellContainer.cxx.

124 {
125  return m_beginCalo[static_cast<int>(caloNum)];
126 }

◆ beginConstCalo()

::CaloCellContainer::const_iterator CaloConstCellContainer::beginConstCalo ( CaloCell_ID::SUBCALO  caloNum) const

get const begin iterator on cell of just one calo

◆ capacity()

size_type DataVector< CaloCell , BASE >::capacity ( ) const
noexceptinherited

Returns the total number of elements that the collection can hold before needing to allocate more memory.

◆ cbegin()

const_iterator DataVector< CaloCell , BASE >::cbegin ( ) const
noexceptinherited

Return a const_iterator pointing at the beginning of the collection.

Returns
A const_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ cend()

const_iterator DataVector< CaloCell , BASE >::cend ( ) const
noexceptinherited

Return a const_iterator pointing past the end of the collection.

Returns
A const_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ checkOrdered()

bool CaloConstCellContainer::checkOrdered ( ) const

verify one by one the container is ordered

◆ checkOrderedAndComplete()

bool CaloConstCellContainer::checkOrderedAndComplete ( ) const

verify one by one the container is complete (i.e.

size is equal to the maximum of hash identifier) and in order

◆ clear() [1/4]

void ConstDataVector< CaloCellContainer >::clear
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.

Parameters
ownPolicyThe new ownership policy of the container.
trackIndicesThe 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.

◆ clear() [2/4]

void ConstDataVector< CaloCellContainer >::clear ( SG::OwnershipPolicy  ownPolicy)
inherited

Erase all the elements in the collection, and reset the ownership mode.

Parameters
ownPolicyThe new ownership policy of the container.

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.

◆ clear() [3/4]

void ConstDataVector< CaloCellContainer >::clear ( SG::OwnershipPolicy  ownPolicy,
SG::IndexTrackingPolicy  trackIndices 
)
inherited

◆ clear() [4/4]

void DataVector< CaloCell , BASE >::clear ( std::unique_ptr< Deleter deleter)
inherited

Erase all the elements in the collection, and change how elements are to be deleted.

Parameters
deleterObject to be used to delete object. Passing nullptr will change back to the default.

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. After the current elements are deleted, the Deleter object is changed.

◆ clearMostDerived()

void DataVector< CaloCell , BASE >::clearMostDerived ( )
protectedinherited

Clear m_isMostDerived for this instance and for all bases.

Called from the constructor after setting m_isMostDerived.

◆ crbegin()

const_reverse_iterator DataVector< CaloCell , BASE >::crbegin ( ) const
noexceptinherited

Return a const_reverse_iterator pointing past the end of the collection.

Returns
A const_reverse_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ crend()

const_reverse_iterator DataVector< CaloCell , BASE >::crend ( ) const
noexceptinherited

Return a const_reverse_iterator pointing at the beginning of the collection.

Returns
A const_reverse_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ do_cast()

static const CaloCell * DataVector< CaloCell , BASE >::do_cast ( const typename PtrVector::value_type  p)
staticinherited

Helper to shorten calls to DataModel_detail::DVLCast.

Parameters
pThe value to convert.
Returns
The value as a const T*.

The conversion will be done with static_cast if possible, with dynamic_cast otherwise.

◆ do_cast_nc()

static CaloCell * DataVector< CaloCell , BASE >::do_cast_nc ( typename PtrVector::value_type  p)
staticinherited

Helper to shorten calls to DataModel_detail::DVLCast.

Parameters
pThe value to convert.
Returns
The value as a T*.

The conversion will be done with static_cast if possible, with dynamic_cast otherwise.

◆ dv_typeid()

virtual const std::type_info& DataVector< CaloCell , BASE >::dv_typeid ( ) const
privatevirtualinherited

Find the most-derived DataVector class in the hierarchy.

Returns
The 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.

◆ dvlinfo()

static const DataModel_detail::DVLInfoBase& DataVector< CaloCell , BASE >::dvlinfo ( )
staticinherited

Return the DV/DL info struct for this class.

This can be used to make sure that it's instantiated.

◆ dvlinfo_v()

virtual const DataModel_detail::DVLInfoBase& DataVector< CaloCell , BASE >::dvlinfo_v ( ) const
virtualinherited

Return the DV/DL info struct for this class.

This can be used to make sure that it's instantiated.

◆ emplace() [1/2]

iterator ConstDataVector< CaloCellContainer >::emplace ( iterator  position,
value_type  pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

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.

◆ emplace() [2/2]

iterator DataVector< CaloCell , BASE >::emplace ( iterator  position,
value_type  pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

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.

◆ emplace_back() [1/2]

value_type ConstDataVector< CaloCellContainer >::emplace_back ( value_type  pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe 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.

◆ emplace_back() [2/2]

value_type DataVector< CaloCell , BASE >::emplace_back ( value_type  pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe 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.

◆ empty()

bool DataVector< CaloCell , BASE >::empty ( ) const
noexceptinherited

Returns true if the collection is empty.

◆ end()

iterator ConstDataVector< CaloCellContainer >::end
noexceptinherited

Return an iterator pointing past the end of the collection.

Returns
An iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ endCalo()

CaloCellContainer::iterator CaloCellContainer::endCalo ( CaloCell_ID::SUBCALO  caloNum)
inherited

Definition at line 128 of file CaloCellContainer.cxx.

129 {
130  return m_endCalo[static_cast<int>(caloNum)];
131 }

◆ endConstCalo()

::CaloCellContainer::const_iterator CaloConstCellContainer::endConstCalo ( CaloCell_ID::SUBCALO  caloNum) const

get const begin iterator on cell of just one calo

◆ erase() [1/4]

iterator ConstDataVector< CaloCellContainer >::erase ( iterator  first,
iterator  last 
)
inherited

Remove a range of elements.

Parameters
firstIterator pointing to the first element to be removed.
lastIterator pointing one past the last element to be removed.
Returns
An iterator pointing to the element pointed to by last prior to erasing (or end()).

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.

◆ erase() [2/4]

iterator DataVector< CaloCell , BASE >::erase ( iterator  first,
iterator  last 
)
inherited

Remove a range of elements.

Parameters
firstIterator pointing to the first element to be removed.
lastIterator pointing one past the last element to be removed.
Returns
An iterator pointing to the element pointed to by last prior to erasing (or end()).

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.

◆ erase() [3/4]

iterator ConstDataVector< CaloCellContainer >::erase ( iterator  position)
inherited

Remove element at a given position.

Parameters
positionIterator pointing to the element to be removed.
Returns
An iterator pointing to the next element (or end()).

If the container owns its elements, then the pointed-to element will be deleted.

◆ erase() [4/4]

iterator DataVector< CaloCell , BASE >::erase ( iterator  position)
inherited

Remove element at a given position.

Parameters
positionIterator pointing to the element to be removed.
Returns
An iterator pointing to the next element (or end()).

If the container owns its elements, then the pointed-to element will be deleted.

◆ findCell() [1/2]

CaloCell * CaloCellContainer::findCell ( const IdentifierHash  theHash)
inherited

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.

355 {
356  int ndx = findIndex (theHash);
357  if (ndx >= 0)
358  return (*this)[ndx];
359  return nullptr;
360 }

◆ findCell() [2/2]

const CaloCell* CaloConstCellContainer::findCell ( 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

◆ findCellVector() [1/3]

void CaloConstCellContainer::findCellVector ( const std::vector< IdentifierHash > &  theVectorHash,
::CaloCellContainer::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

◆ findCellVector() [2/3]

void CaloCellContainer::findCellVector ( const std::vector< IdentifierHash > &  theVectorHash,
CellVector theCellVector 
) const
inherited

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.

423 {
424  findCellVectorT (*this, theVectorHash, theCellVector);
425 #if 0
426  theCellVector.reserve (theCellVector.size() + theVectorHash.size());
427  if (isOrderedAndComplete()) {
428 
429  for (IdentifierHash hash : theVectorHash) {
430  theCellVector.push_back( (*this)[hash] );
431  }
432  return;
433  }
434 
435  if (this->empty()) return ;
436 
437  const CxxUtils::PackedArray& lookUpTable = getLookUpTable();
438 
439  //look in look up table (do not put empty cells)
440 
441  size_t tbsize = lookUpTable.size();
442  for (IdentifierHash hash : theVectorHash) {
443  // careful that the look up table might be shorter than the maximum hash
444  if (hash>=tbsize) continue ;
445  int ndx = (int)lookUpTable[ hash ] - 1;
446  if (ndx >= 0) {
447  const CaloCell * theCell = (*this)[ndx];
448  if (theCell!=0) {
449  theCellVector.push_back( theCell);
450  }
451  }
452 
453  }
454 #endif
455 }

◆ findCellVector() [3/3]

void CaloCellContainer::findCellVector ( const std::vector< IdentifierHash > &  theVectorHash,
MutableCellVector theCellVector 
)
inherited

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.

458 {
459  findCellVectorT (*this, theVectorHash, theCellVector);
460 }

◆ findCellVectorT()

template<class CONT , class VECT >
void CaloCellContainer::findCellVectorT ( CONT &  cont,
const std::vector< IdentifierHash > &  theVectorHash,
VECT &  theCellVector 
)
staticprivateinherited

Look up a group of cells by IdentifierHash.

This is a templated version that can be instantiated for both const and non-const versions.

Parameters
contThe container from which to fetch cells.
theVectorHashVector of desired IdentifierHash's.
theCellVectorFound cells will be appended to this vector.

Definition at line 389 of file CaloCellContainer.cxx.

390 {
391  theCellVector.reserve (theCellVector.size() + theVectorHash.size());
392  if (cont.isOrderedAndComplete()) {
393 
394  for (IdentifierHash hash : theVectorHash) {
395  theCellVector.push_back( cont[hash] );
396  }
397  return;
398  }
399 
400  if (cont.empty()) return ;
401 
402  const CxxUtils::PackedArray& lookUpTable = cont.getLookUpTable();
403 
404  //look in look up table (do not put empty cells)
405 
406  size_t tbsize = lookUpTable.size();
407  for (IdentifierHash hash : theVectorHash) {
408  // careful that the look up table might be shorter than the maximum hash
409  if (hash>=tbsize) continue ;
410  int ndx = (int)lookUpTable[ hash ] - 1;
411  if (ndx >= 0) {
412  auto theCell = cont[ndx];
413  if (theCell!=nullptr) {
414  theCellVector.push_back( theCell);
415  }
416  }
417 
418  }
419 }

◆ findIndex()

int CaloConstCellContainer::findIndex ( IdentifierHash  theHash) const

Return index of the cell with a given hash.

Returns -1 if the cell isn't found.

◆ fromDataVector()

static const ConstDataVector* ConstDataVector< CaloCellContainer >::fromDataVector ( const CaloCellContainer dv)
staticinherited

Cast from a DataVector to a ConstDataVector.

Parameters
dvPointer to object to cast.

Return DV cast to a ConstDataVector.

◆ front()

Access the first element in the collection as an lvalue.

Returns
Proxy to the first element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ get()

const CaloCell * DataVector< CaloCell , BASE >::get ( size_type  n) const
inherited

Access an element, as an rvalue.

Parameters
nArray index to access.
Returns
The element at n.

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).

◆ getLookUpTable()

const CxxUtils::PackedArray & CaloCellContainer::getLookUpTable ( ) const
privateinherited

Retrieve an initialized lookup table.

Definition at line 586 of file CaloCellContainer.cxx.

587 {
588  // FIXME should have an argument about duplicates
589  // fill the look up table
590  // note that if CaloCellContainer is not completely filled, there
591  // is no guarantee it has the correct size, hence the size should
592  // be checked at every call
593  // (CaloCellContainer has no way to know the maximum size)
594  // Now (30.07.2008) have it always max number of cells (hardcoded) to speed up.
595 
596  if (!m_lookUpTable.isValid()) {
597 
598  unsigned int theSize=0;
599  size_t ncells = size();
600  CxxUtils::PackedArray lookUpTable (std::max (1, ilog2 (ncells + 1)));
601 
602  if (ncells > 0) {
603 
604  // Set the size of the lookup table.
605  // If the cells are sorted, we can look at the last cell to know
606  // the maximum hash we're dealing with. Otherwise, set it to the
607  // maximum cell hash value.
608  if (isOrdered()) {
609  // Set LUT size from the hash of the last cell.
610  theSize = back()->caloDDE()->calo_hash()+1;
611  }
612  else {
613  // Find the maximum hash.
614  const CaloDetDescriptor* desc = front()->caloDDE()->descriptor();
615  IdentifierHash max_hash = desc->get_calo_helper()->calo_cell_hash_max();
616  theSize = max_hash + 1;
617  }
618  lookUpTable.resize (theSize);
619 
620  for (size_t icell = 0; icell < ncells; icell++) {
621 
622  const CaloCell * theCell = (*this)[icell];
623  const IdentifierHash theHash=theCell->caloDDE()->calo_hash();
624 
625  assert (theHash < theSize);
626 
627  if (nWarningsToBePrinted > 0) {
628  // We may actually enter here nWarningsToBePrinted times
629  // if multiple threads race here, but it doesn't matter.
630  int nwarn = nWarningsToBePrinted--;
631  int iold = (int)(lookUpTable[theHash])-1;
632  if (iold >= 0) {
633  if ((size_t)iold == icell) {
634  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
635  << "Repeated cell. hash= " << theHash;
636  }
637  else if ((*this)[iold]->ID()==theCell->ID()) {
638  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
639  << "Duplicated cell. hash="
640  << theHash
641  << " E1=" << (*this)[iold]->e()
642  << " E2=" << theCell->e();
643  // should delete the cell?
644  } else {
645  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
646  << "Should be impossible ! Repeated cell. hash= " << theHash;
647  }
648  if (nwarn==0) {
649  REPORT_MESSAGE_WITH_CONTEXT (MSG::INFO, "CaloCellContainer")
650  << "No more WARNING will be printed";
651  }
652  }
653  } // end of print out
654 
655  lookUpTable[theHash]=icell+1;
656  }
657  }
658  m_lookUpTable.set (std::move (lookUpTable));
659  }
660 
661  return *m_lookUpTable.ptr();
662 }

◆ hasCalo()

bool CaloConstCellContainer::hasCalo ( const CaloCell_ID::SUBCALO  caloNum) const

tell whether it has been filled with cells (maybe none) of a given calo

◆ hasTotalSize()

bool CaloConstCellContainer::hasTotalSize ( ) const

tell wether container has total hash id size

◆ indexFirstCellCalo()

int CaloConstCellContainer::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

◆ indexLastCellCalo()

int CaloConstCellContainer::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.

◆ initializeLookUpTable()

void CaloCellContainer::initializeLookUpTable ( )
inherited

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.

468 {
469  this->resetLookUpTable();
470  getLookUpTable();
471 }

◆ insert() [1/8]

void ConstDataVector< CaloCellContainer >::insert ( iterator  position,
InputIterator  first,
InputIterator  last 
)
inherited

Add a group of new elements to the collection.

Parameters
positionIterator before which the element will be added.
firstThe start of the range to put in the container.
lastThe end of the range to put in the container.

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.

◆ insert() [2/8]

void DataVector< CaloCell , BASE >::insert ( iterator  position,
InputIterator  first,
InputIterator  last 
)
inherited

Add a group of new elements to the collection.

Parameters
positionIterator before which the element will be added.
firstThe start of the range to put in the container.
lastThe end of the range to put in the container.

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.

This overload is for the case where the iterator value type is convertible to T*.

◆ insert() [3/8]

void ConstDataVector< CaloCellContainer >::insert ( iterator  position,
std::initializer_list< value_type l 
)
inherited

Add a group of new elements to the collection.

Parameters
positionIterator before which the element will be added.
lAn initializer list.

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.

◆ insert() [4/8]

void DataVector< CaloCell , BASE >::insert ( iterator  position,
std::initializer_list< value_type l 
)
inherited

Add a group of new elements to the collection.

Parameters
positionIterator before which the element will be added.
lAn initializer list.

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.

◆ insert() [5/8]

iterator DataVector< CaloCell , BASE >::insert ( iterator  position,
std::unique_ptr< base_value_type pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

The container must be an owning container.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ insert() [6/8]

iterator ConstDataVector< CaloCellContainer >::insert ( iterator  position,
std::unique_ptr< const base_value_type pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

The container must be an owning container.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ insert() [7/8]

iterator ConstDataVector< CaloCellContainer >::insert ( iterator  position,
value_type  pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

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.

◆ insert() [8/8]

iterator DataVector< CaloCell , BASE >::insert ( iterator  position,
value_type  pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

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.

◆ insertMove()

void DataVector< CaloCell , BASE >::insertMove ( iterator  position,
DataVector< CaloCell > &  other 
)
inherited

Insert the contents of another DataVector, with auxiliary data copied via move semantics.

Parameters
positionIterator before which the new elements will be added.
otherThe 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.

◆ isOrdered()

bool CaloConstCellContainer::isOrdered ( ) const

tell wether container is ordered

◆ isOrderedAndComplete()

bool CaloConstCellContainer::isOrderedAndComplete ( ) const

tell wether container is complete and in order

◆ iter_swap() [1/2]

static void ConstDataVector< CaloCellContainer >::iter_swap ( iterator  a,
iterator  b 
)
staticinherited

Swap the referents of two DataVector iterators.

Parameters
aThe first iterator for the swap.
bThe second iterator for the swap.

◆ iter_swap() [2/2]

static void DataVector< CaloCell , BASE >::iter_swap ( iterator  a,
iterator  b 
)
staticinherited

Swap the referents of two DataVector iterators.

Parameters
aThe first iterator for the swap.
bThe second iterator for the swap.

◆ max_size()

size_type DataVector< CaloCell , BASE >::max_size ( ) const
noexceptinherited

Returns the size() of the largest possible collection.

◆ msgSvc()

IMessageSvc* CaloCellContainer::msgSvc ( ) const
privateinherited

get message service

◆ nCellsCalo()

int CaloConstCellContainer::nCellsCalo ( const CaloCell_ID::SUBCALO  caloNum) const

get number of cels of given calorimeter

◆ operator!=()

Based on operator==.

◆ operator<()

bool ConstDataVector< CaloCellContainer >::operator< ( const ConstDataVector< CaloCellContainer > &  b) const
inherited

Vector ordering relation.

Parameters
bA ConstDataVector of the same type as *this.
Returns
True iff *this is lexicographically less than b.

This is a total ordering relation. It is linear in the size of the vectors. Comparisons are done on the pointer values of the elements.

See std::lexicographical_compare() for how the determination is made.

◆ operator<=()

bool ConstDataVector< CaloCellContainer >::operator<= ( const ConstDataVector< CaloCellContainer > &  b) const
inherited

Based on operator<.

◆ operator==()

bool ConstDataVector< CaloCellContainer >::operator== ( const ConstDataVector< CaloCellContainer > &  b) const
inherited

Vector equality comparison.

Parameters
bA ConstDataVector of the same type as *this.
Returns
True iff the size and elements of the vectors are equal.

This is an equivalence relation. It is linear in the size of the vectors. Vectors are considered equivalent if their sizes are equal, and if corresponding elements compare equal.

◆ operator>()

bool ConstDataVector< CaloCellContainer >::operator> ( const ConstDataVector< CaloCellContainer > &  b) const
inherited

Based on operator<.

◆ operator>=()

bool ConstDataVector< CaloCellContainer >::operator>= ( const ConstDataVector< CaloCellContainer > &  b) const
inherited

Based on operator<.

◆ operator[]() [1/3]

ElementProxy ConstDataVector< CaloCellContainer >::operator[] ( size_type  n)
inherited

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

No bounds checking is done. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ operator[]() [2/3]

ElementProxy DataVector< CaloCell , BASE >::operator[] ( size_type  n)
inherited

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

No bounds checking is done. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ operator[]() [3/3]

const CaloCell * DataVector< CaloCell , BASE >::operator[] ( size_type  n) const
inherited

Access an element, as an rvalue.

Parameters
nArray index to access.
Returns
The element at n.

No bounds checking is done. Note that we return a const T* rather than a reference.

◆ order()

void CaloConstCellContainer::order ( )

order container

◆ orderWhenComplete()

void CaloCellContainer::orderWhenComplete ( )
privateinherited

order when container is complete

Definition at line 556 of file CaloCellContainer.cxx.

557 {
559  tmp.swap (*this);
560  reserve (tmp.size());
561 
562  DataVector<CaloCell>::iterator tmpend = tmp.end();
563  for (DataVector<CaloCell>::iterator it = tmp.begin(); it != tmpend; ++it) {
564  IdentifierHash hash = (*it)->caloDDE()->calo_hash();
565 
566  if (hash >= size())
567  resize (hash + 1);
568 
569  if ((*this)[hash] != nullptr) {
570  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
571  << "Duplicated cell: hash= " << hash;
572  }
573  else {
574  using std::iter_swap;
575  iter_swap (begin() + hash, it);
576  }
577  }
578 
579  // set the Ordered And Complete flag
580  this->setIsOrderedAndComplete(true);
581 
582  // look up table is not necessary anymore
583  this->resetLookUpTable();
584 }

◆ orderWhenIncomplete()

void CaloCellContainer::orderWhenIncomplete ( )
privateinherited

order when container is incomplete

Definition at line 485 of file CaloCellContainer.cxx.

486 {
487  // If the number of cells is small compared to the maximum number
488  // of cells, best to just use the STL sort and then remove duplicates.
489  // Otherwise, sort by inserting into a table based on the hash code.
490  // Break point chosen pretty much arbitrarily. Could be further
491  // tuned, but it probably doesn't really make much difference.
492  if (size() < 500) {
493  // Small number of cells. Use STL sort.
494  sort (orderWithCaloHash());
495 
496  // Nb. Need to convert to int --- otherwise, 0-1 will wrap around
497  // to maxuint.
498  for (int i = 0; i < static_cast<int>(size())-1; ) {
499  if ((*this)[i]->caloDDE()->calo_hash() ==
500  (*this)[i+1]->caloDDE()->calo_hash())
501  {
502  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
503  << "Duplicated cell: hash= " << (*this)[i]->caloDDE()->calo_hash();
504  erase (begin() + i);
505  }
506  else
507  ++i;
508  }
509  }
510  else {
511  // Sort for large container.
512 
513  // Find the maximum possible hash code.
514  const CaloDetDescriptor* desc = front()->caloDDE()->descriptor();
515  IdentifierHash max_hash = desc->get_calo_helper()->calo_cell_hash_max();
516 
517  // Make a temporary container that can hold all possible cells.
518  DataVector<CaloCell> tmp (max_hash+1, ownPolicy());
519 
520  // Move cells into the temporary container, according to hashes.
522  for (DataVector<CaloCell>::iterator it = begin(); it != itend; ++it) {
523  IdentifierHash hash = (*it)->caloDDE()->calo_hash();
524  assert (hash < tmp.size());
525 
526  if (tmp[hash] != nullptr) {
527  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
528  << "Duplicated cell: hash= " << hash;
529  }
530  else {
531  using std::iter_swap;
532  iter_swap (tmp.begin() + hash, it);
533  }
534  }
535 
536  // Now, move the cells back, eliminating spaces.
537  itend = tmp.end();
539  for (DataVector<CaloCell>::iterator it = tmp.begin(); it != itend; ++it) {
540  if (*it != nullptr) {
541  using std::iter_swap;
542  iter_swap (itout, it);
543  ++itout;
544  }
545  }
546 
547  // May be less, if there were duplicates.
548  // cppcheck-suppress assertWithSideEffect
549  assert (itout <= end());
550  resize (itout - begin());
551  }
553  setIsOrdered(true);
554 }

◆ ownPolicy()

SG::OwnershipPolicy DataVector< CaloCell , BASE >::ownPolicy ( ) const
inherited

Return the ownership policy setting for this container.

◆ pop_back() [1/2]

void DataVector< CaloCell , BASE >::pop_back ( )
inherited

Remove the last element from the collection.

If the container owns its elements, then the removed element will be deleted.

◆ pop_back() [2/2]

void DataVector< CaloCell , BASE >::pop_back ( )
inherited

◆ print()

void CaloCellContainer::print ( )
staticinherited

dump (obsolete)

Definition at line 112 of file CaloCellContainer.cxx.

112  {
113  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
114  << "CaloCellContainer::print not implemented";
115 }

◆ push_back() [1/5]

void CaloCellContainer::push_back ( CaloCell theCell)
inherited

reimplementation of const push_back

Definition at line 74 of file CaloCellContainer.cxx.

75 {
77 
78  // only allow const push_back if view cells
79  // if (ownPolicy()==SG::VIEW_ELEMENTS){
80  // std::cout << "ERROR Should not push_back non const cell in VIEW CaloCellContainer" << std::endl;
81  // }
82 
83 
84  this->setHasCalo(theCell->caloDDE()->getSubCalo()) ;
85 
87 
88 }

◆ push_back() [2/5]

void CaloCellContainer::push_back ( std::unique_ptr< CaloCell theCell)
inherited

reimplementation of const push_back(unique_ptr>)

Definition at line 90 of file CaloCellContainer.cxx.

91 {
93  this->setHasCalo(theCell->caloDDE()->getSubCalo()) ;
94 
95  DataVector<CaloCell>::push_back(std::move(theCell));
96 
97 }

◆ push_back() [3/5]

value_type ConstDataVector< CaloCellContainer >::push_back ( std::unique_ptr< const base_value_type pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe element to add to the collection.

The container must be an owning container.

Note: this method may only be called using the most derived DataVector in the hierarchy.

Returns the pushed pointer.

◆ push_back() [4/5]

value_type ConstDataVector< CaloCellContainer >::push_back ( value_type  pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe 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.

◆ push_back() [5/5]

value_type DataVector< CaloCell , BASE >::push_back ( value_type  pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe 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.

◆ push_back_fast() [1/3]

void CaloCellContainer::push_back_fast ( CaloCell theCell)
inherited

reimplementation of push_back to gain speed in readin

Definition at line 102 of file CaloCellContainer.cxx.

103 {
105 }

◆ push_back_fast() [2/3]

void CaloConstCellContainer::push_back_fast ( const CaloCell cell)

reimplementation of push_back to gain speed in readin

◆ push_back_fast() [3/3]

void CaloConstCellContainer::push_back_fast ( std::unique_ptr< const CaloCell cell)

reimplementation of push_back to gain speed in readin (UP version)

◆ rbegin()

reverse_iterator ConstDataVector< CaloCellContainer >::rbegin
noexceptinherited

Return a reverse_iterator pointing past the end of the collection.

Returns
A reverse_iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ rend()

Return a reverse_iterator pointing at the beginning of the collection.

Returns
A reverse_iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ reserve()

void DataVector< CaloCell , BASE >::reserve ( size_type  n)
inherited

Attempt to preallocate enough memory for a specified number of elements.

Parameters
nNumber of elements required.

◆ resetLookUpTable()

void CaloConstCellContainer::resetLookUpTable ( )

reset look up table

◆ resize() [1/2]

void DataVector< CaloCell , BASE >::resize ( size_type  sz)
inherited

Resizes the collection to the specified number of elements.

Parameters
szThe 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().

◆ resize() [2/2]

void DataVector< CaloCell , BASE >::resize ( size_type  sz)
inherited

◆ resortAux() [1/2]

void DataVector< CaloCell , BASE >::resortAux ( iterator  beg,
iterator  end 
)
inherited

Reset indices / reorder aux data after elements have been permuted.

Parameters
begStart of the range of elements to process.
endEnd 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.

◆ resortAux() [2/2]

void ConstDataVector< CaloCellContainer >::resortAux ( iterator  ,
iterator   
)
inherited

Reset indices / reorder aux data after elements have been permuted.

Parameters
begStart of the range of elements to process.
endEnd of the range of elements to process.

This is a no-op for ConstDataVector.

◆ setHasCalo()

void CaloConstCellContainer::setHasCalo ( CaloCell_ID::SUBCALO  caloNum)

set which calo has been filled.


◆ setHasTotalSize()

void CaloConstCellContainer::setHasTotalSize ( bool  flag)
private

If @ flag is true, then the container size equals the maximum hash.

Only CaloCellContainerFinalizer tool is allowed to set this.

◆ setIsOrdered()

void CaloConstCellContainer::setIsOrdered ( bool  ordered)

indicates that the container is ordered

◆ setIsOrderedAndComplete()

void CaloConstCellContainer::setIsOrderedAndComplete ( bool  ordered)

indicate that the container is complete and in order

◆ setMostDerived()

virtual void DataVector< CaloCell , BASE >::setMostDerived ( )
protectedvirtualinherited

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.

◆ shift()

void DataVector< CaloCell , BASE >::shift ( size_t  pos,
ptrdiff_t  offs 
)
privateinherited

Shift the auxiliary elements of the container.

Parameters
posThe starting index for the shift.
offsThe (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).

◆ shrink_to_fit()

void DataVector< CaloCell , BASE >::shrink_to_fit ( )
inherited

◆ size()

size_type DataVector< CaloCell , BASE >::size ( ) const
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.

◆ sort() [1/2]

void DataVector< CaloCell , BASE >::sort ( )
inherited

Sort the container.

This just sorts by pointer value, so it's probably not very useful.

◆ sort() [2/2]

void DataVector< CaloCell , BASE >::sort ( COMPARE  comp)
inherited

Sort the container with a user-specified comparison operator.

Parameters
compFunctional to compare two values.

◆ stdcont()

const PtrVector & DataVector< CaloCell , BASE >::stdcont ( ) const
inherited

Return the underlying std::vector of the container.

Returns
Reference to the 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.

◆ swap() [1/2]

void ConstDataVector< CaloCellContainer >::swap ( ConstDataVector< CaloCellContainer > &  rhs)
inherited

Swap this collection with another.

Parameters
rhsThe 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.

◆ swap() [2/2]

void DataVector< CaloCell , BASE >::swap ( DataVector< CaloCell > &  rhs)
inherited

Swap this collection with another.

Parameters
rhsThe 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.

◆ swapElement() [1/8]

void DataVector< CaloCell , BASE >::swapElement ( iterator  pos,
std::unique_ptr< base_value_type newElem,
std::unique_ptr< base_value_type > &  oldElem 
)
inherited

Swap one element out of the container.

Parameters
posThe element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem.

The collection must own its elements to use its interface. The collection will take ownership of newElem and will return ownership of oldElem.

Note: this method may only be called using the most derived DataList in the hierarchy.

◆ swapElement() [2/8]

void ConstDataVector< CaloCellContainer >::swapElement ( iterator  pos,
std::unique_ptr< const base_value_type newElem,
std::unique_ptr< const base_value_type > &  oldElem 
)
inherited

Swap one element out of the container.

Parameters
posThe element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem.

The collection must own its elements to use its interface. The collection will take ownership of newElem and will return ownership of oldElem.

Note: this method may only be called using the most derived DataList in the hierarchy.

◆ swapElement() [3/8]

void ConstDataVector< CaloCellContainer >::swapElement ( iterator  pos,
value_type  newElem,
reference  oldElem 
)
inherited

Swap one element out of the container.

Parameters
posThe element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element pos 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 DataList in the hierarchy.

◆ swapElement() [4/8]

void DataVector< CaloCell , BASE >::swapElement ( iterator  pos,
value_type  newElem,
reference  oldElem 
)
inherited

Swap one element out of the container.

Parameters
posThe element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element pos 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 DataList in the hierarchy.

◆ swapElement() [5/8]

void DataVector< CaloCell , BASE >::swapElement ( size_type  index,
std::unique_ptr< base_value_type newElem,
std::unique_ptr< base_value_type > &  oldElem 
)
inherited

Swap one element out of the container.

Parameters
indexIndex of the element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference 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.

The collection must own its elements to use its interface. The collection will take ownership of newElem and will return ownership of oldElem.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ swapElement() [6/8]

void ConstDataVector< CaloCellContainer >::swapElement ( size_type  index,
std::unique_ptr< const base_value_type newElem,
std::unique_ptr< const base_value_type > &  oldElem 
)
inherited

Swap one element out of the container.

Parameters
indexIndex of the element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference 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.

The collection must own its elements to use its interface. The collection will take ownership of newElem and will return ownership of oldElem.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ swapElement() [7/8]

void ConstDataVector< CaloCellContainer >::swapElement ( size_type  index,
value_type  newElem,
reference  oldElem 
)
inherited

Swap one element out of the container.

Parameters
indexIndex of the element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference 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.

◆ swapElement() [8/8]

void DataVector< CaloCell , BASE >::swapElement ( size_type  index,
value_type  newElem,
reference  oldElem 
)
inherited

Swap one element out of the container.

Parameters
indexIndex of the element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference 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.

◆ testInsert()

void DataVector< CaloCell , BASE >::testInsert ( const char *  op)
inherited

Test if we can insert; raise an exception if not.

Parameters
opDescription 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.

◆ testInsertOol()

void DataVector< CaloCell , BASE >::testInsertOol ( const char *  op)
inherited

Test if we can insert; raise an exception if not.

Parameters
opDescription 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.

◆ to_base_iterator()

static DV::iterator ConstDataVector< CaloCellContainer >::to_base_iterator ( iterator  it)
staticprivateinherited

Convert a ConstDataVector::iterator to an iterator of the base DataVector.

Parameters
itThe ConstDataVector::iterator to convert.

◆ to_element_proxy()

ElementProxy ConstDataVector< CaloCellContainer >::to_element_proxy ( typename BaseContainer::iterator  i)
privateinherited

Convert an iterator of the base vector to an ElementProxy for the ConstDataVector.

Parameters
itThe base vector iterator to convert.

◆ to_my_iterator()

iterator ConstDataVector< CaloCellContainer >::to_my_iterator ( typename DV::iterator  it)
privateinherited

Convert an iterator of the base DataVector to a ConstDataVector::iterator.

Parameters
itThe base DataVector iterator to convert.

◆ updateCaloBeginIterators()

void CaloConstCellContainer::updateCaloBeginIterators ( int  ic,
int  ind 
)

fills calo iterators and the index of first cell for a given subcalo

◆ updateCaloEndIterators()

void CaloConstCellContainer::updateCaloEndIterators ( int  ic,
int  ind 
)

fills calo iterators and the index of last cell for a given subcalo

◆ updateCaloIterators()

void CaloConstCellContainer::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.

◆ updateCaloIteratorsOrdered()

void CaloCellContainer::updateCaloIteratorsOrdered ( CaloCellContainer::iterator  beg,
CaloCellContainer::iterator  end 
)
privateinherited

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.

247 {
248  if (beg == end) return;
249  int beg_calo = (*beg)->caloDDE()->getSubCalo();
250  int end_calo = (*(end-1))->caloDDE()->getSubCalo();
251  if (beg_calo == end_calo) {
252  m_beginCalo[beg_calo] = beg;
253  m_endCalo[beg_calo] = end;
254  m_beginConstCalo[beg_calo] = beg;
255  m_endConstCalo[beg_calo] = end;
256  m_indexFirstCellCalo[beg_calo] = beg - this->begin();
257  m_indexLastCellCalo[beg_calo] = end - this->begin() - 1;
258  }
259  else {
261  std::partition_point (beg, end, is_calo (beg_calo));
264  }
265 }

Friends And Related Function Documentation

◆ CaloCellContainerFinalizerTool

friend class CaloCellContainerFinalizerTool
friend

Definition at line 164 of file CaloConstCellContainer.h.

Member Data Documentation

◆ has_virtual

const bool ConstDataVector< CaloCellContainer >::has_virtual
staticinherited

This needs to be forwarded from the base as well.

Definition at line 102 of file ConstDataVector.h.

◆ m_beginCalo

std::vector< CaloCellContainer::iterator > CaloCellContainer::m_beginCalo
privateinherited

non const iterators for the different calorimeters

Definition at line 297 of file CaloCellContainer.h.

◆ m_beginConstCalo

std::vector< CaloCellContainer::const_iterator > CaloCellContainer::m_beginConstCalo
privateinherited

const iterators for the different calorimeters

Definition at line 295 of file CaloCellContainer.h.

◆ m_deleter

ROOT_SELECTION_NS::MemberAttributes< kTransient > DataVector< CaloCell , BASE >::m_deleter
inherited

Definition at line 3436 of file DataVector.h.

◆ m_endCalo

std::vector< CaloCellContainer::iterator > CaloCellContainer::m_endCalo
privateinherited

Definition at line 297 of file CaloCellContainer.h.

◆ m_endConstCalo

std::vector< CaloCellContainer::const_iterator > CaloCellContainer::m_endConstCalo
privateinherited

Definition at line 295 of file CaloCellContainer.h.

◆ m_hasCalo

std::vector<bool> CaloCellContainer::m_hasCalo
privateinherited

true if given cell from given calo has been filled (even if none)

Definition at line 286 of file CaloCellContainer.h.

◆ m_hasTotalSize

bool CaloCellContainer::m_hasTotalSize
privateinherited

true if size correspond to maximum hash.

only CaloCellContainerFinalizer tool is allowed to set this

Definition at line 276 of file CaloCellContainer.h.

◆ m_indexFirstCellCalo

std::vector<int> CaloCellContainer::m_indexFirstCellCalo
privateinherited

index of first cell of given calo (-1 if none)

Definition at line 289 of file CaloCellContainer.h.

◆ m_indexLastCellCalo

std::vector<int> CaloCellContainer::m_indexLastCellCalo
privateinherited

index of first cell of given calo (-2 if none)

Definition at line 292 of file CaloCellContainer.h.

◆ m_isMostDerived [1/2]

SG::IsMostDerivedFlag DataVector< CaloCell , BASE >::m_isMostDerived
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 2038 of file DataVector.h.

◆ m_isMostDerived [2/2]

ROOT_SELECTION_NS::MemberAttributes< kTransient > DataVector< CaloCell , BASE >::m_isMostDerived
inherited

Automatically generate dictionary for contained vector.

Declare the automatically created variable transient

Definition at line 3435 of file DataVector.h.

◆ m_isOrdered

bool CaloCellContainer::m_isOrdered
privateinherited

true if ordered

Definition at line 280 of file CaloCellContainer.h.

◆ m_isOrderedAndComplete

bool CaloCellContainer::m_isOrderedAndComplete
privateinherited

true if complete and in right order

Definition at line 283 of file CaloCellContainer.h.

◆ m_lookUpTable

CxxUtils::CachedValue<CxxUtils::PackedArray> CaloCellContainer::m_lookUpTable
privateinherited

look up table of size HashIdentifiermax.

Definition at line 272 of file CaloCellContainer.h.

◆ m_ownPolicy

ROOT_SELECTION_NS::MemberAttributes< kTransient > DataVector< CaloCell , BASE >::m_ownPolicy
inherited

We do not want to save this.

The P->T converter should decide the ownership mode.

Definition at line 3440 of file DataVector.h.

◆ must_own

constexpr bool ConstDataVector< CaloCellContainer >::must_own
staticconstexprinherited

If true, then this type must own its contents.

Definition at line 124 of file ConstDataVector.h.


The documentation for this class was generated from the following file:
DataVector< CaloCell >::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
CaloCellContainer::m_lookUpTable
CxxUtils::CachedValue< CxxUtils::PackedArray > m_lookUpTable
look up table of size HashIdentifiermax.
Definition: CaloCellContainer.h:272
CaloCellContainer::updateCaloIteratorsOrdered
void updateCaloIteratorsOrdered(CaloCellContainer::iterator beg, CaloCellContainer::iterator end)
Recursively find division points between subcalos in the container.
Definition: CaloCellContainer.cxx:245
CaloCellContainer::initializeLookUpTable
void initializeLookUpTable()
initialize look up table.
Definition: CaloCellContainer.cxx:467
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
max
#define max(a, b)
Definition: cfImp.cxx:41
WriteCellNoiseToCool.icell
icell
Definition: WriteCellNoiseToCool.py:339
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
std::iter_swap
void iter_swap(typename std::reverse_iterator< DataModel_detail::iterator< DV > > a, typename std::reverse_iterator< DataModel_detail::iterator< DV > > b)
Specialization of iter_swap for DataVector/DataList.
Definition: DVL_iter_swap.h:52
CaloCellContainer::m_indexFirstCellCalo
std::vector< int > m_indexFirstCellCalo
index of first cell of given calo (-1 if none)
Definition: CaloCellContainer.h:289
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
CaloCellContainer::setIsOrdered
void setIsOrdered(const bool ordered)
indicates that the container is ordered
Definition: CaloCellContainer.cxx:204
CaloCellContainer::setHasCalo
void setHasCalo(const CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
Definition: CaloCellContainer.cxx:213
skel.it
it
Definition: skel.GENtoEVGEN.py:423
CxxUtils::PackedArray::size
size_type size() const
Returns the number of elements in the collection.
Definition: PackedArray.cxx:209
CaloCellContainer::isOrdered
bool isOrdered() const
tell wether container is ordered
Definition: CaloCellContainer.h:293
CaloCell::e
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition: CaloCell.h:317
CaloDetDescrElement::getSubCalo
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:433
CxxUtils::PackedArray
An array of unsigned values of some bit size, packed tightly.
Definition: PackedArray.h:42
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
CaloCondBlobAlgs_fillNoiseFromASCII.desc
desc
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:54
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
DataVector< CaloCell >::front
const CaloCell * front() const
Access the first element in the collection as an rvalue.
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector< CaloCell >::back
const CaloCell * back() const
Access the last element in the collection as an rvalue.
DataVector< CaloCell >
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
DataVector< CaloCell >::resize
void resize(size_type sz)
Resizes the collection to the specified number of elements.
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
CaloCellContainer::m_beginCalo
std::vector< CaloCellContainer::iterator > m_beginCalo
non const iterators for the different calorimeters
Definition: CaloCellContainer.h:297
CaloCellContainer::getLookUpTable
const CxxUtils::PackedArray & getLookUpTable() const
Retrieve an initialized lookup table.
Definition: CaloCellContainer.cxx:586
CaloCellContainer::m_beginConstCalo
std::vector< CaloCellContainer::const_iterator > m_beginConstCalo
const iterators for the different calorimeters
Definition: CaloCellContainer.h:295
CaloCellContainer::resetLookUpTable
void resetLookUpTable()
reset look up table
Definition: CaloCellContainer.cxx:462
DataVector< CaloCell >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector< CaloCell >::sort
void sort()
Sort the container.
CaloCellContainer::isOrderedAndComplete
bool isOrderedAndComplete() const
tell wether container is complete and in order
Definition: CaloCellContainer.h:298
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloDetDescriptor
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
Definition: CaloDetDescriptor.h:58
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition: CaloCellContainer.cxx:363
CaloDetDescrElement::descriptor
const CaloDetDescriptor * descriptor() const
cell descriptor
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:428
DataVector< CaloCell >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
CaloCellContainer::m_endConstCalo
std::vector< CaloCellContainer::const_iterator > m_endConstCalo
Definition: CaloCellContainer.h:295
DataVector< CaloCell >::iter_swap
static void iter_swap(iterator a, iterator b)
Swap the referents of two DataVector iterators.
CaloCellContainer::m_endCalo
std::vector< CaloCellContainer::iterator > m_endCalo
Definition: CaloCellContainer.h:297
IdentifierHash
Definition: IdentifierHash.h:38
DataVector< CaloCell >::erase
iterator erase(iterator position)
Remove element at a given position.
CaloCellContainer::findCellVectorT
static void findCellVectorT(CONT &cont, const std::vector< IdentifierHash > &theVectorHash, VECT &theCellVector)
Look up a group of cells by IdentifierHash.
Definition: CaloCellContainer.cxx:389
DataVector< CaloCell >::size
size_type size() const noexcept
Returns the number of elements in the collection.
CaloCellContainer::setIsOrderedAndComplete
void setIsOrderedAndComplete(const bool ordered)
indicate that the container is complete and in order
Definition: CaloCellContainer.cxx:165
DataVector< CaloCell >::empty
bool empty() const noexcept
Returns true if the collection is empty.
DataVector< CaloCell >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CaloCellContainer::m_indexLastCellCalo
std::vector< int > m_indexLastCellCalo
index of first cell of given calo (-2 if none)
Definition: CaloCellContainer.h:292