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

Container class for CaloCell. More...

#include <CaloCellContainer.h>

Inheritance diagram for CaloCellContainer:
Collaboration diagram for CaloCellContainer:

Classes

class  orderWithCaloHash
 functor to order cells according to caloHash More...
 

Public Types

typedef std::vector< const CaloCell * > CellVector
 type to be used for the internal lookup table, and to return list of cells More...
 
typedef std::vector< CaloCell * > MutableCellVector
 Return from non-const findCellVector. More...
 
typedef BASE DataVector_BASE
 
typedef BASE DVL_BASE
 
typedef BASE::PtrVector PtrVector
 This is the type of the underlying std::vector (what stdcont returns). More...
 
typedef BASE::PtrVector BaseContainer
 
typedef CaloCell *& reference
 
typedef CaloCell *constconst_reference
 
typedef BASE::size_type size_type
 
typedef BASE::difference_type difference_type
 
typedef CaloCellvalue_type
 
typedef BASE::allocator_type allocator_type
 
typedef CaloCell ** pointer
 
typedef CaloCell *constconst_pointer
 
typedef const CaloCellconst_value_type
 
typedef CaloCell base_value_type
 The T value used as the template parameter. More...
 
typedef std::unique_ptr< base_value_typeunique_type
 Type of a unique_ptr that can be used to insert elements into this container. More...
 
typedef DataModel_detail::ElementProxy< DataVectorElementProxy
 This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership. More...
 
typedef DataModel_detail::const_iterator< DataVectorconst_iterator
 Standard const_iterator. More...
 
typedef DataModel_detail::iterator< DataVectoriterator
 Standard iterator. More...
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Standard const_reverse_iterator. More...
 
typedef std::reverse_iterator< iteratorreverse_iterator
 Standard reverse_iterator. More...
 
typedef DataVector base_data_vector
 
using Deleter = typename BASE::Deleter
 
typedef DataVector< CaloCell, BASE > self
 A helper typedef. More...
 

Public Member Functions

 CaloCellContainer (SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
 Main constructor. More...
 
 CaloCellContainer (size_t n, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
 Sized constructor. More...
 
virtual ~CaloCellContainer ()
 destructor 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...
 
void push_back_fast (CaloCell *)
 reimplementation of push_back to gain speed in readin More...
 
void push_back_fast (std::unique_ptr< CaloCell > theCell)
 reimplementation of push_back to gain speed in readin (UP version) More...
 
CaloCellContainer::const_iterator beginConstCalo (CaloCell_ID::SUBCALO caloNum) const
 get const iterators on cell of just one calo More...
 
CaloCellContainer::const_iterator endConstCalo (CaloCell_ID::SUBCALO caloNum) const
 
CaloCellContainer::iterator beginCalo (CaloCell_ID::SUBCALO caloNum)
 get non const iterators on cell of just one calo More...
 
CaloCellContainer::iterator endCalo (CaloCell_ID::SUBCALO caloNum)
 
bool checkOrderedAndComplete () const
 verify one by one the container is complete (i.e. More...
 
void setIsOrderedAndComplete (const 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 (const 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 wether 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 (const 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 (const IdentifierHash theHash) const
 fast find method given identifier hash. More...
 
CaloCellfindCell (const IdentifierHash theHash)
 fast find method given identifier hash. More...
 
int findIndex (const IdentifierHash theHash) const
 Return index of the cell with a given 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...
 
void initializeLookUpTable ()
 initialize look up table. More...
 
void resetLookUpTable ()
 reset look up table More...
 
void order ()
 order container More...
 

Static Public Member Functions

static void print ()
 dump (obsolete) More...
 

Public Attributes

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

Static Public Attributes

static const bool has_virtual
 This is true for any DataVector class if we need to use virtual derivation to get to the base DataVector class. More...
 
static constexpr bool must_own
 If true, then this type must own its contents. More...
 

Private Member Functions

IMessageSvc * msgSvc () const
 get message service More...
 
void setHasTotalSize (const bool)
 If @ flag is true, then the container size equals the maximum hash. 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...
 

Static Private Member Functions

template<class CONT , class VECT >
static void findCellVectorT (CONT &cont, const std::vector< IdentifierHash > &theVectorHash, VECT &theCellVector)
 Look up a group of cells by IdentifierHash. 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
 

Friends

class CaloConstCellContainer
 
class CaloCellContainerFinalizerTool
 
class CaloCompactCellTool
 
class FullCaloCellContMaker
 
class EmptyCellBuilderTool
 
class CaloCellContCopyTool
 

Constructors, destructors, assignment.

void assign (InputIterator first, InputIterator last)
 Assign from iterators. More...
 
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 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...
 
const CaloCellfront () const
 Access the first element in the collection as an rvalue. More...
 
ElementProxy front ()
 Access the first element in the collection as an lvalue. More...
 
const CaloCellback () const
 Access the last element in the collection as an rvalue. More...
 
ElementProxy back ()
 Access the last element in the collection as an lvalue. More...
 

Iterator creation.

const_iterator begin () const noexcept
 Return a const_iterator pointing at the beginning of the collection. More...
 
iterator begin () noexcept
 Return an iterator pointing at the beginning of the collection. More...
 
const_iterator end () const noexcept
 Return a const_iterator pointing past the end of the collection. More...
 
iterator end () noexcept
 Return an iterator pointing past the end of the collection. More...
 
const_reverse_iterator rbegin () const noexcept
 Return a const_reverse_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...
 
const_reverse_iterator rend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection. More...
 
reverse_iterator rend () noexcept
 Return a reverse_iterator pointing at the beginning of the collection. More...
 
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, 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...
 
void clear ()
 Erase all the elements in the collection. 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 resize (size_type sz)
 
void pop_back ()
 
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 clear (std::unique_ptr< Deleter > deleter)
 Erase all the elements in the collection, and change how elements are to be deleted. More...
 
void clear ()
 
void clear (SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
 
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...
 
virtual const DataModel_detail::DVLInfoBasedvlinfo_v () const
 Return the DV/DL info struct for this class. More...
 
const SG::AuxVectorBaseauxbase () const
 Convert to AuxVectorBase. 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.

SG::IsMostDerivedFlag m_isMostDerived
 This flag is true if this DV instance is the most-derived one. More...
 
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...
 
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...
 
void assignElement (typename BaseContainer::iterator pos, value_type newElem)
 Handle element assignment. More...
 
void assignElement (typename BaseContainer::iterator pos, std::unique_ptr< 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...
 
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...
 
typedef ROOT_SELECTION_NS::DataVector< CaloCell, DataVector_BASE >::self self
 
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...
 

Detailed Description

Container class for CaloCell.

CaloCellContainer is a container of all LAr and Tile cells. It derives from DataVector<CaloCell>. Cells from a given calorimeter (LAr e.m., LArHEC, LArFCAl, Tile) can also be accessed individually. It has additional methods to allow fast access to any cell, given its hash identifier. CaloCellContainer is normally built by CaloRec/CaloCellMaker.cxx, and finalized by CaloRec/CaloCellContainerFinalizerTool.cxx. CaloCellContainer is NOT meant to be used for private list of cells, a simple std::vector<const CaloCell*> is best used.

Author
Srini Rajagopalan
David Rousseau

Definition at line 54 of file CaloCellContainer.h.

Member Typedef Documentation

◆ allocator_type

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

Definition at line 816 of file DataVector.h.

◆ base_data_vector

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

Definition at line 853 of file DataVector.h.

◆ base_value_type

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

The T value used as the template parameter.

Note that this is different from value_type (that's T*).

Definition at line 824 of file DataVector.h.

◆ BaseContainer

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

Definition at line 806 of file DataVector.h.

◆ CellVector

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

Standard const_iterator.

Definition at line 837 of file DataVector.h.

◆ const_pointer

typedef CaloCell * const* DataVector< CaloCell , BASE >::const_pointer
inherited

Definition at line 818 of file DataVector.h.

◆ const_reference

typedef CaloCell * const& DataVector< CaloCell , BASE >::const_reference
inherited

Definition at line 812 of file DataVector.h.

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> DataVector< CaloCell , BASE >::const_reverse_iterator
inherited

Standard const_reverse_iterator.

Definition at line 846 of file DataVector.h.

◆ const_value_type

typedef const CaloCell * DataVector< CaloCell , BASE >::const_value_type
inherited

Definition at line 820 of file DataVector.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 BASE::difference_type DataVector< CaloCell , BASE >::difference_type
inherited

Definition at line 814 of file DataVector.h.

◆ DVL_BASE

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

Definition at line 797 of file DataVector.h.

◆ ElementProxy

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

Definition at line 832 of file DataVector.h.

◆ iterator

Standard iterator.

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

Definition at line 841 of file DataVector.h.

◆ MutableCellVector

Return from non-const findCellVector.

Definition at line 86 of file CaloCellContainer.h.

◆ pointer

typedef CaloCell ** DataVector< CaloCell , BASE >::pointer
inherited

Definition at line 817 of file DataVector.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 CaloCell *& DataVector< CaloCell , BASE >::reference
inherited

Definition at line 811 of file DataVector.h.

◆ reverse_iterator

typedef std::reverse_iterator<iterator> DataVector< CaloCell , BASE >::reverse_iterator
inherited

Standard reverse_iterator.

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

Definition at line 851 of file DataVector.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 BASE::size_type DataVector< CaloCell , BASE >::size_type
inherited

Definition at line 813 of file DataVector.h.

◆ unique_type

typedef std::unique_ptr<base_value_type> DataVector< CaloCell , BASE >::unique_type
inherited

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

Definition at line 828 of file DataVector.h.

◆ value_type

typedef CaloCell * DataVector< CaloCell , BASE >::value_type
inherited

Definition at line 815 of file DataVector.h.

Constructor & Destructor Documentation

◆ CaloCellContainer() [1/2]

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

Main constructor.

Definition at line 48 of file CaloCellContainer.cxx.

48  :
50  m_hasTotalSize(false),
51  m_isOrdered(false),
53 {
54  //initialise with empty iterators
55  for (int iCalo=0; iCalo< static_cast<int>(CaloCell_ID::NSUBCALO); ++iCalo){
56  m_hasCalo.push_back(false);
57  m_indexFirstCellCalo.push_back(-1);
58  m_indexLastCellCalo.push_back(-2);
59  m_beginConstCalo.push_back(this->begin());
60  m_endConstCalo.push_back(this->begin());
61  m_beginCalo.push_back(this->begin());
62  m_endCalo.push_back(this->begin());
63  }
64 }

◆ CaloCellContainer() [2/2]

CaloCellContainer::CaloCellContainer ( size_t  n,
SG::OwnershipPolicy  ownPolicy = SG::OWN_ELEMENTS 
)

Sized constructor.

Definition at line 67 of file CaloCellContainer.cxx.

69 {
70  resize(n);
71 }

◆ ~CaloCellContainer()

virtual CaloCellContainer::~CaloCellContainer ( )
inlinevirtual

destructor

Definition at line 97 of file CaloCellContainer.h.

Member Function Documentation

◆ assign() [1/2]

void DataVector< CaloCell , BASE >::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() [2/2]

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 DataVector< CaloCell , BASE >::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 DataVector< CaloCell , BASE >::assignElement ( typename BaseContainer::iterator  pos,
std::unique_ptr< 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 DataVector< CaloCell , BASE >::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/2]

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() [2/2]

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

const SG::AuxVectorBase& DataVector< CaloCell , BASE >::auxbase
inherited

Convert to AuxVectorBase.

Needed to get AuxVectorBase from a ConstDataVector. Present in DataVector as well for consistency. We only really need it in the base class; however, root6 fails constructing a TMethodCall for this if there is virtual derivation. A workaround is to redeclare this in the derived classes too.

◆ back() [1/2]

ElementProxy DataVector< CaloCell , BASE >::back
inherited

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.

◆ back() [2/2]

const CaloCell * DataVector< CaloCell , BASE >::back
inherited

Access the last element in the collection as an rvalue.

Returns
The last element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a const T* rather than a reference.

◆ 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() [1/2]

const_iterator DataVector< CaloCell , BASE >::begin
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.

◆ begin() [2/2]

iterator DataVector< CaloCell , BASE >::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)

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 CaloCellContainer::beginConstCalo ( CaloCell_ID::SUBCALO  caloNum) const

get const iterators on cell of just one calo

Definition at line 119 of file CaloCellContainer.cxx.

119  {
120  return m_beginConstCalo[static_cast<int>(caloNum)];
121 }

◆ capacity()

size_type DataVector< CaloCell , BASE >::capacity
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
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
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 CaloCellContainer::checkOrdered ( ) const

verify one by one the container is ordered

Definition at line 173 of file CaloCellContainer.cxx.

173  {
174  CaloCellContainer::const_iterator itr=this->begin(),itrEnd=this->end();
175  unsigned int hashPrev=0;
176 
177  for (;itr!=itrEnd;++itr){
178 
179  const CaloCell * theCell=*itr;
180 
181  const CaloDetDescrElement * theDDE = nullptr;
182 
183  if (theCell==nullptr){
184  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
185  << MSG::WARNING << "CaloCellContainer NULL CELL ";
186  } else {
187  theDDE=theCell->caloDDE();
188  if (theDDE==nullptr){
189  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
190  << MSG::WARNING << "CaloCellContainer WARNING NULL DDE ";
191  }
192  else{
193  unsigned int hash=theDDE->calo_hash();
194  if ( hash < hashPrev) return false ;
195  hashPrev=hash;
196  }
197 
198  }
199  }
200 
201  return true;
202 }

◆ checkOrderedAndComplete()

bool CaloCellContainer::checkOrderedAndComplete ( ) const

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

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

Definition at line 150 of file CaloCellContainer.cxx.

150  {
151  //should have maximum hash size in any case
152  if (!this->hasTotalSize()) return false;
153 
154  CaloCellContainer::const_iterator itr=this->begin(),itrEnd=this->end();
155  unsigned int index=0;
156  for (;itr!=itrEnd;++itr){
157  if ( ((*itr)->caloDDE())->calo_hash()!=index) {
158  return false;
159  }
160  ++index;
161  }
162  return true;
163 }

◆ clear() [1/6]

void DataVector< CaloCell , BASE >::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/6]

void DataVector< CaloCell , BASE >::clear
inherited

◆ clear() [3/6]

void DataVector< CaloCell , BASE >::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() [4/6]

void DataVector< CaloCell , BASE >::clear ( SG::OwnershipPolicy  ownPolicy,
SG::IndexTrackingPolicy  trackIndices 
)
inherited

◆ clear() [5/6]

void DataVector< CaloCell , BASE >::clear ( SG::OwnershipPolicy  ownPolicy,
SG::IndexTrackingPolicy  trackIndices = SG::DEFAULT_TRACK_INDICES 
)
inherited

◆ clear() [6/6]

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
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
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
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
virtualinherited

Return the DV/DL info struct for this class.

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

◆ emplace()

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

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
noexceptinherited

Returns true if the collection is empty.

◆ end() [1/2]

const_iterator DataVector< CaloCell , BASE >::end
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.

◆ end() [2/2]

iterator DataVector< CaloCell , BASE >::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)

Definition at line 128 of file CaloCellContainer.cxx.

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

◆ endConstCalo()

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

Definition at line 133 of file CaloCellContainer.cxx.

133  {
134  return m_endConstCalo[static_cast<int>(caloNum)];
135 }

◆ erase() [1/2]

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() [2/2]

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)

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 * CaloCellContainer::findCell ( const IdentifierHash  theHash) const

fast find method given identifier hash.

If the container is not ordered and complete a look up map is used, which is build the first time this method of findCellVector is used

Definition at line 345 of file CaloCellContainer.cxx.

346 {
347  int ndx = findIndex (theHash);
348  if (ndx >= 0)
349  return (*this)[ndx];
350  return nullptr;
351 }

◆ findCellVector() [1/2]

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

fast find method given vector of identifier hash.

Be careful that the order of cell return may not match the order of the inputs, and that some cells may be missing

Definition at line 422 of file CaloCellContainer.cxx.

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() [2/2]

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

fast find method given vector of identifier hash.

Be careful that the order of cell return may not match the order of the inputs, and that some cells may be missing

Definition at line 457 of file CaloCellContainer.cxx.

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

Look up a group of cells by IdentifierHash.

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

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 CaloCellContainer::findIndex ( const IdentifierHash  theHash) const

Return index of the cell with a given hash.

Returns -1 if the cell isn't found.

Definition at line 363 of file CaloCellContainer.cxx.

364 {
365  //cache Identifierhash->unsigned int conversion (maybe too much)
366  const unsigned int theIndex = theHash ;
367 
368  // if container is complete and in order use directly the container
369  if (isOrderedAndComplete()) return theIndex;
370 
371  if (this->empty()) return -1;
372 
373  const CxxUtils::PackedArray& lookUpTable = getLookUpTable();
374  if (theIndex < lookUpTable.size() )
375  return (int)lookUpTable[theIndex] - 1;
376  return -1;
377 }

◆ front() [1/2]

ElementProxy DataVector< CaloCell , BASE >::front
inherited

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.

◆ front() [2/2]

const CaloCell * DataVector< CaloCell , BASE >::front
inherited

Access the first element in the collection as an rvalue.

Returns
The first element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a const T* rather than a reference.

◆ 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
private

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 CaloCellContainer::hasCalo ( const CaloCell_ID::SUBCALO  caloNum) const

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

Definition at line 209 of file CaloCellContainer.cxx.

209  {
210  return m_hasCalo[static_cast<int>(caloNum)];
211 }

◆ hasTotalSize()

bool CaloCellContainer::hasTotalSize ( ) const
inline

tell wether container has total hash id size

Definition at line 289 of file CaloCellContainer.h.

289  {
290  return m_hasTotalSize ;
291 }

◆ indexFirstCellCalo()

int CaloCellContainer::indexFirstCellCalo ( const CaloCell_ID::SUBCALO  caloNum) const

index of first cell of given calorimeter (-1 if none).

Note that it is normally more efficient to use iterators

Definition at line 137 of file CaloCellContainer.cxx.

137  {
138  return m_indexFirstCellCalo[static_cast<int>(caloNum)];
139 }

◆ indexLastCellCalo()

int CaloCellContainer::indexLastCellCalo ( const CaloCell_ID::SUBCALO  caloNum) const

index of last cell of given calorimeter (-2 if none) Note that it is normally more efficient to use iterators.

Definition at line 141 of file CaloCellContainer.cxx.

141  {
142  return m_indexLastCellCalo[static_cast<int>(caloNum)];
143 }

◆ initializeLookUpTable()

void CaloCellContainer::initializeLookUpTable ( )

initialize look up table.

Note that the look up table is initialized the first time findcell is called. If new cells are added afterwards (should not be the case) the lookuptable need be reinitialized by hand

Definition at line 467 of file CaloCellContainer.cxx.

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

◆ insert() [1/5]

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() [2/5]

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 unique_ptr<T>.

◆ insert() [3/5]

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() [4/5]

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() [5/5]

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 CaloCellContainer::isOrdered ( ) const
inline

tell wether container is ordered

Definition at line 293 of file CaloCellContainer.h.

293  {
294  return m_isOrdered ;
295 }

◆ isOrderedAndComplete()

bool CaloCellContainer::isOrderedAndComplete ( ) const
inline

tell wether container is complete and in order

Definition at line 298 of file CaloCellContainer.h.

298  {
299  return m_isOrderedAndComplete ;
300 }

◆ iter_swap()

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
noexceptinherited

Returns the size() of the largest possible collection.

◆ msgSvc()

IMessageSvc* CaloCellContainer::msgSvc ( ) const
private

get message service

◆ nCellsCalo()

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

get number of cels of given calorimeter

Definition at line 145 of file CaloCellContainer.cxx.

145  {
146  return this->indexLastCellCalo(caloNum)-this->indexFirstCellCalo(caloNum)+1;
147 }

◆ operator[]() [1/2]

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[]() [2/2]

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 CaloCellContainer::order ( )

order container

Definition at line 474 of file CaloCellContainer.cxx.

475 {
476  if (this->hasTotalSize()){
477  this->orderWhenComplete();
478  }
479  else{
480  this->orderWhenIncomplete();
481  }
482 
483 }

◆ orderWhenComplete()

void CaloCellContainer::orderWhenComplete ( )
private

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 ( )
private

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
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 ( )
static

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/3]

void CaloCellContainer::push_back ( CaloCell theCell)

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/3]

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

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/3]

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/2]

void CaloCellContainer::push_back_fast ( CaloCell theCell)

reimplementation of push_back to gain speed in readin

Definition at line 102 of file CaloCellContainer.cxx.

103 {
105 }

◆ push_back_fast() [2/2]

void CaloCellContainer::push_back_fast ( std::unique_ptr< CaloCell theCell)

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

Definition at line 107 of file CaloCellContainer.cxx.

108 {
109  DataVector<CaloCell>::push_back(std::move(theCell));
110 }

◆ rbegin() [1/2]

const_reverse_iterator DataVector< CaloCell , BASE >::rbegin
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.

◆ rbegin() [2/2]

reverse_iterator DataVector< CaloCell , BASE >::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() [1/2]

const_reverse_iterator DataVector< CaloCell , BASE >::rend
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.

◆ rend() [2/2]

reverse_iterator DataVector< CaloCell , BASE >::rend
noexceptinherited

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 CaloCellContainer::resetLookUpTable ( )

reset look up table

Definition at line 462 of file CaloCellContainer.cxx.

463  {
465  }

◆ 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()

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.

◆ setHasCalo()

void CaloCellContainer::setHasCalo ( const CaloCell_ID::SUBCALO  caloNum)

set which calo has been filled.


Definition at line 213 of file CaloCellContainer.cxx.

213  {
214 
215  const int iCalo=static_cast<int>(caloNum);
216 
217  m_hasCalo[iCalo] = true;
218 }

◆ setHasTotalSize()

void CaloCellContainer::setHasTotalSize ( const bool  hasTotalSize)
private

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

Only CaloCellContainerFinalizer tool is allowed to set this. Now, set this in EmptyCellBuilderTool as it is always true.

Definition at line 169 of file CaloCellContainer.cxx.

169  {
171 }

◆ setIsOrdered()

void CaloCellContainer::setIsOrdered ( const bool  ordered)

indicates that the container is ordered

Definition at line 204 of file CaloCellContainer.cxx.

204  {
205  m_isOrdered = ordered;
206 }

◆ setIsOrderedAndComplete()

void CaloCellContainer::setIsOrderedAndComplete ( const bool  ordered)

indicate that the container is complete and in order

Definition at line 165 of file CaloCellContainer.cxx.

165  {
166  m_isOrderedAndComplete = orderedAndComplete ;
167 }

◆ 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
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
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()

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/4]

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/4]

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() [3/4]

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() [4/4]

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.

◆ updateCaloBeginIterators()

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

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

Definition at line 326 of file CaloCellContainer.cxx.

326  {
327  if (ic==0) {
328  m_beginConstCalo[ic]=this->begin();
329  m_beginCalo[ic]=this->begin();
331  }else{
332  m_beginConstCalo[ic]=this->end();
333  m_beginCalo[ic]=this->end();
335  }
336 }

◆ updateCaloEndIterators()

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

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

Definition at line 338 of file CaloCellContainer.cxx.

338  {
339  m_endConstCalo[ic]=this->end();
340  m_endCalo[ic]=this->end();
342 }

◆ updateCaloIterators()

void CaloCellContainer::updateCaloIterators ( )

fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO CALL THIS METHOD ONCE THE FILLING IS FINISHED Please use CaloCellContainerFinalizerTool to make sure the container is properly finalised.

Definition at line 268 of file CaloCellContainer.cxx.

269 {
270 
271  //initialise
272  for (int iCalo=0; iCalo< static_cast<int>(CaloCell_ID::NSUBCALO); ++iCalo){
273  m_indexFirstCellCalo[iCalo]=-1;
274  m_indexLastCellCalo[iCalo]=-2;
275  m_beginConstCalo[iCalo]=this->begin();
276  m_endConstCalo[iCalo]=this->begin();
277  m_beginCalo[iCalo]=this->begin();
278  m_endCalo[iCalo]=this->begin();
279  }
280 
283  return;
284  }
285 
286  CaloCellContainer::const_iterator itr=this->begin(),itrEnd=this->end();
287  CaloCellContainer::iterator itrNonConst=this->begin();
288  int previousCellCalo=-1;
289  int index=0;
290  for (;itr!=itrEnd;++itr){
291  const int iCalo= static_cast<int>( (*itr)->caloDDE()->getSubCalo());
292  if (iCalo!=previousCellCalo){
293 
294  // new calo domain
295  if (m_indexFirstCellCalo[iCalo]>=0){
296  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
297  << " Specific calo cells are split."
298  << " Specific calo iterators will be wrong ";
299  }
301  m_beginConstCalo[iCalo]=itr;
302  m_beginCalo[iCalo]=itrNonConst;
303 
304  if (previousCellCalo>=0){
305  m_indexLastCellCalo[previousCellCalo]=index-1;
306  m_endConstCalo[previousCellCalo]=itr;
307  m_endCalo[previousCellCalo]=itrNonConst;
308 
309  }
310  }
311  previousCellCalo=iCalo;
312  ++itrNonConst;
313  ++index;
314  }
315 
316  //case the calo is the last filled
317  if (previousCellCalo>=0){
318  m_indexLastCellCalo[previousCellCalo]=index-1;
319  m_endConstCalo[previousCellCalo]=itr;
320  m_endCalo[previousCellCalo]=itrNonConst;
321  }
322 
323 }

◆ updateCaloIteratorsOrdered()

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

Recursively find division points between subcalos in the container.

Should run in ~ m log n time, where n is the number of cells and m is the number of subcalos.

The cells need to be sorted for this to work.

Definition at line 245 of file CaloCellContainer.cxx.

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 74 of file CaloCellContainer.h.

◆ CaloCellContCopyTool

friend class CaloCellContCopyTool
friend

Definition at line 78 of file CaloCellContainer.h.

◆ CaloCompactCellTool

friend class CaloCompactCellTool
friend

Definition at line 75 of file CaloCellContainer.h.

◆ CaloConstCellContainer

friend class CaloConstCellContainer
friend

Definition at line 73 of file CaloCellContainer.h.

◆ EmptyCellBuilderTool

friend class EmptyCellBuilderTool
friend

Definition at line 77 of file CaloCellContainer.h.

◆ FullCaloCellContMaker

friend class FullCaloCellContMaker
friend

Definition at line 76 of file CaloCellContainer.h.

Member Data Documentation

◆ has_virtual

const bool DataVector< CaloCell , BASE >::has_virtual
staticinherited

This is true for any DataVector class if we need to use virtual derivation to get to the base DataVector class.

Definition at line 801 of file DataVector.h.

◆ m_beginCalo

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

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
private

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
private

Definition at line 297 of file CaloCellContainer.h.

◆ m_endConstCalo

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

Definition at line 295 of file CaloCellContainer.h.

◆ m_hasCalo

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

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
private

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
private

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
private

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
private

true if ordered

Definition at line 280 of file CaloCellContainer.h.

◆ m_isOrderedAndComplete

bool CaloCellContainer::m_isOrderedAndComplete
private

true if complete and in right order

Definition at line 283 of file CaloCellContainer.h.

◆ m_lookUpTable

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

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 DataVector< CaloCell , BASE >::must_own
staticconstexprinherited

If true, then this type must own its contents.

Definition at line 859 of file DataVector.h.


The documentation for this class was generated from the following files:
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::indexLastCellCalo
int indexLastCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of last cell of given calorimeter (-2 if none) Note that it is normally more efficient to use i...
Definition: CaloCellContainer.cxx:141
CxxUtils::CachedValue::reset
void reset()
Reset the value to invalid.
CaloCellContainer::initializeLookUpTable
void initializeLookUpTable()
initialize look up table.
Definition: CaloCellContainer.cxx:467
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
CaloCellContainer::hasTotalSize
bool hasTotalSize() const
tell wether container has total hash id size
Definition: CaloCellContainer.h:289
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
index
Definition: index.py:1
CaloCellContainer::m_indexFirstCellCalo
std::vector< int > m_indexFirstCellCalo
index of first cell of given calo (-1 if none)
Definition: CaloCellContainer.h:289
CaloCellContainer::m_isOrderedAndComplete
bool m_isOrderedAndComplete
true if complete and in right order
Definition: CaloCellContainer.h:283
CaloCellContainer::m_hasTotalSize
bool m_hasTotalSize
true if size correspond to maximum hash.
Definition: CaloCellContainer.h:276
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
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCellContainer::m_isOrdered
bool m_isOrdered
true if ordered
Definition: CaloCellContainer.h:280
skel.it
it
Definition: skel.GENtoEVGEN.py:396
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
CaloCellContainer::indexFirstCellCalo
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
Definition: CaloCellContainer.cxx:137
CaloCellContainer::orderWhenComplete
void orderWhenComplete()
order when container is complete
Definition: CaloCellContainer.cxx:556
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
CaloCellContainer::CaloCellContainer
CaloCellContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
Definition: CaloCellContainer.cxx:48
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
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 >
grepfile.ic
int ic
Definition: grepfile.py:33
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.
DeMoScan.index
string index
Definition: DeMoScan.py:364
CaloCellContainer::m_hasCalo
std::vector< bool > m_hasCalo
true if given cell from given calo has been filled (even if none)
Definition: CaloCellContainer.h:286
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
CaloCellContainer::orderWhenIncomplete
void orderWhenIncomplete()
order when container is incomplete
Definition: CaloCellContainer.cxx:485
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.
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
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
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
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.
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
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