ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTowerContainer Class Reference

Storable container class for CaloTower. More...

#include <CaloTowerContainer.h>

Inheritance diagram for CaloTowerContainer:
Collaboration diagram for CaloTowerContainer:

Classes

class  iterator
 Iterator class for which the reference type is not an lvalue. More...

Public Types

typedef DataVector< CaloTowerBase
typedef size_t index_t
 Tower map index type.
typedef std::reverse_iterator< iteratorreverse_iterator
typedef typename DataVectorBase< CaloTower >::Base DataVector_BASE
typedef typename DataVectorBase< CaloTower >::Base DVL_BASE
typedef typename DataVectorBase< CaloTower >::Base::PtrVector PtrVector
 This is the type of the underlying std::vector (what stdcont returns).
typedef typename DataVectorBase< CaloTower >::Base::PtrVector BaseContainer
typedef CaloTower *& reference
typedef CaloTower *const & const_reference
typedef typename DataVectorBase< CaloTower >::Base::size_type size_type
typedef typename DataVectorBase< CaloTower >::Base::difference_type difference_type
typedef CaloTowervalue_type
typedef typename DataVectorBase< CaloTower >::Base::allocator_type allocator_type
typedef CaloTower ** pointer
typedef CaloTower *const * const_pointer
typedef const CaloTowerconst_value_type
typedef CaloTower base_value_type
 The T value used as the template parameter.
typedef std::unique_ptr< base_value_typeunique_type
 Type of a unique_ptr that can be used to insert elements into this container.
typedef DataModel_detail::ElementProxy< DataVectorElementProxy
 This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership.
typedef DataModel_detail::const_iterator< DataVectorconst_iterator
 Standard const_iterator.
typedef DataModel_detail::iterator< DataVectoriterator
 Standard iterator.
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Standard const_reverse_iterator.
typedef DataVector base_data_vector
using Deleter

Public Member Functions

 CaloTowerContainer ()
 Default constructor.
 CaloTowerContainer (const CaloTowerSeg &tseg, bool noTowers=false)
 Useable Constructor.
 CaloTowerContainer (const CaloTowerContainer &other)
 Copy constructor.
CaloTowerContaineroperator= (const CaloTowerContainer &other)
 Assignment.
void swap (CaloTowerContainer &other)
 Swap.
virtual ~CaloTowerContainer ()
 Destructor.
void init ()
 Initializes the CaloTowerContainer.
void setCalo (const CaloCell_ID::SUBCALO &nCalo)
 Adds a calorimeter index to the tower.
size_t getCalos (std::vector< CaloCell_ID::SUBCALO > &theCalos) const
 Retrieve the list of used calorimeters.
size_t getNumberOfCalos () const
 Returns the number of included calorimeters.
double etamin () const
 Return lower \( \eta \) value range boundary.
double phimin () const
 Return lower \( \varphi \) value range boundary.
double deta () const
 Return bin size \( \Delta \eta \).
double dphi () const
 Return bin size \( \Delta \varphi \).
size_t neta () const
 Return number of \( \eta \) bins.
size_t nphi () const
 Return number of \( \varphi \) bins.
const CaloTowerSegtowerseg () const
 Return a copy of the attached CaloTowerSeg.
double et (double theEta, double thePhi) const
 Return the tower transverse energy at a given grid position.
double et (index_t etaIndex, index_t phiIndex) const
 Return the tower transverse energy at a given grid position.
double et (int etaIndex, int phiIndex) const
 Return the tower transverse energy at a given grid position.
double e (double theEta, double thePhi) const
 Return the tower energy at a given grid position.
double e (index_t etaIndex, index_t phiIndex) const
 Return the tower energy at a given grid position.
double e (int etaIndex, int phiIndex) const
 Return the tower energy at a given grid position.
double energy (double theEta, double thePhi) const
 Return the tower energy at a given grid position.
double energy (index_t etaIndex, index_t phiIndex) const
 Return the tower energy at a given grid position.
double energy (int etaIndex, int phiIndex) const
 Return the tower energy at a given grid position.
index_t getTowerIndex (const CaloTower *aTower) const
 Returns the combined index of a tower on the grid.
index_t getTowerIndex (index_t etaIndex, index_t phiIndex) const
 Returns the combined index for given \( \eta \) and \( \varphi \) indices.
index_t getTowerIndex (double theEta, double thePhi) const
 Returns the combined index for given \( \eta \) and \( \varphi \) values.
index_t getTowerEtaIndex (const CaloTower *aTower) const
 Returns the \( \eta \) index for a given tower.
index_t getTowerEtaIndex (double theEta) const
 Returns the \( \eta \) index for a given \( \eta \) value.
index_t getTowerEtaIndex (index_t towerIndex) const
 Returns the \( \eta \) index for a given combined index.
index_t getTowerPhiIndex (const CaloTower *aTower) const
 Returns the \( \varphi \) index for a given tower.
index_t getTowerPhiIndex (double thePhi) const
 Returns the \( \varphi \) index for a given \( \varphi \) value.
index_t getTowerPhiIndex (index_t towerIndex) const
 Returns the \( \varphi \) index for a given combined index.
bool getTowerIndices (const CaloTower *aTower, index_t &indexEta, index_t &indexPhi) const
 Returns both \( \eta \) and \( \varphi \) indices for a given tower.
bool getTowerIndices (double theEta, double thePhi, index_t &indexEta, index_t &indexPhi) const
 Returns both \( \eta \) and \( \varphi \) indices for given \( \eta \) and \( \varphi \) values.
CaloTowergetTower (index_t eta, index_t phi)
 Returns a pointer to a tower with given \( ( \eta, \varphi ) \) indices.
const CaloTowergetTower (index_t eta, index_t phi) const
 Returns a const pointer to a tower with given \( ( \eta, \varphi ) \) indices.
CaloTowergetTower (int eta, int phi)
 Returns a pointer to a tower with given \( ( \eta, \varphi ) \) indices.
const CaloTowergetTower (int eta, int phi) const
 Returns a const pointer to a tower with given \( ( \eta, \varphi ) \) indices.
CaloTowergetTower (double eta, double phi)
 Returns a pointer to a tower with given \( ( \eta, \varphi ) \) values.
const CaloTowergetTower (double eta, double phi) const
 Returns a const pointer to a tower with given \( ( \eta, \varphi ) \) values.
CaloTowergetTower (index_t theIndex)
 Returns a pointer to a tower with a given combined index.
const CaloTowergetTower (index_t theIndex) const
 Returns a const pointer to a tower with a given combined index.
index_t flagOutOfRange () const
 Returns the index out-of-range indicator.
bool isOutOfRange (index_t anIndex) const
 Checks if an index is out of range.
CaloToweroperator[] (size_type n)
CaloTowerat (size_type n)
CaloTowerfront ()
CaloTowerback ()
iterator begin ()
iterator end ()
reverse_iterator rbegin ()
reverse_iterator rend ()
void insert (iterator position, iterator first, iterator last)
void clear (SG::OwnershipPolicy p)
void push_back (value_type pElem)
const CaloToweroperator[] (size_type n) const
 Access an element, as an rvalue.
const CaloTowerat (size_type n) const
 Access an element, as an rvalue.
const CaloTowerfront () const
 Access the first element in the collection as an rvalue.
const CaloTowerback () const
 Access the last element in the collection as an rvalue.
const_iterator begin () const noexcept
 Return a const_iterator pointing at the beginning of the collection.
const_iterator end () const noexcept
 Return a const_iterator pointing past the end of the collection.
const_reverse_iterator rbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection.
const_reverse_iterator rend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection.
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.
Element access.

Change the vector capacity to match the current size.

Note: this does not affect auxiliary data.

const CaloTowerget (size_type n) const
 Access an element, as an rvalue.
Iterator creation.
const_iterator cbegin () const noexcept
 Return a const_iterator pointing at the beginning of the collection.
const_iterator cend () const noexcept
 Return a const_iterator pointing past the end of the collection.
const_reverse_iterator crbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection.
const_reverse_iterator crend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection.
Insertion operations.
value_type push_back (std::unique_ptr< base_value_type > pElem)
 Add an element to the end of the collection.
size_type push_new (size_type n, F alloc)
 Create and add a number of new elements to the end of the container.
value_type emplace_back (value_type pElem)
 Add an element to the end of the collection.
iterator insert (iterator position, value_type pElem)
 Add a new element to the collection.
iterator insert (iterator position, std::unique_ptr< base_value_type > pElem)
 Add a new element to the collection.
void insert (iterator position, InputIterator first, InputIterator last)
 Add a group of new elements to the collection.
void insert (iterator position, std::initializer_list< value_type > l)
 Add a group of new elements to the collection.
iterator emplace (iterator position, value_type pElem)
 Add a new element to the collection.
void insertMove (iterator position, DataVector &other)
 Insert the contents of another DataVector, with auxiliary data copied via move semantics.
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position.
iterator erase (iterator first, iterator last)
 Remove a range of elements.

Static Public Attributes

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

Private Member Functions

template<class InputIterator>
void assign (InputIterator first, InputIterator last)
iterator insert (iterator position, value_type pElem)
template<class InputIterator>
void insert (iterator position, InputIterator first, InputIterator last)
iterator erase (iterator position)
iterator erase (iterator first, iterator last)
void sort ()
template<class COMPARE>
void sort (COMPARE comp)
void swapElement (size_type index, value_type newElem, reference oldElem)
void resize (size_type sz)
void reserve (size_type n)
void pop_back ()
void clear ()

Private Attributes

CaloTowerSeg m_towerSeg
 Tower grid \( ( \Delta \eta \times \Delta \varphi ) \) descriptor.
std::vector< unsigned int > m_caloRegions
 Vector of calorimeter regions contributing to the tower signals.

Static Private Attributes

static const index_t m_outOfRange = static_cast<index_t>(-1)
 Index overflow indicator.

Friends

class CaloTowerContainerCnv_p1

Internal operations.

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

Non-standard operations.

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.
void swapElement (iterator pos, value_type newElem, reference oldElem)
 Swap one element out of the container.
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.
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.
virtual const DataModel_detail::DVLInfoBasedvlinfo_v () const override
 Return the DV/DL info struct for this class.
const SG::AuxVectorBaseauxbase () const
 Convert to AuxVectorBase.
size_type max_size () const noexcept
 Returns the size() of the largest possible collection.
size_type capacity () const noexcept
 Returns the total number of elements that the collection can hold before needing to allocate more memory.
bool empty () const noexcept
 Returns true if the collection is empty.
void shrink_to_fit ()
const PtrVectorstdcont () const
 Return the underlying std::vector of the container.
SG::OwnershipPolicy ownPolicy () const
 Return the ownership policy setting for this container.
static const DataModel_detail::DVLInfoBasedvlinfo ()
 Return the DV/DL info struct for this class.
static int baseOffset (const std::type_info &ti)
 Return the offset of a base DataVector class.

Swap and sort.

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

Detailed Description

Storable container class for CaloTower.

Author
H. Ma hma@b.nosp@m.nl.g.nosp@m.ov
S. Rajagopalan srini.nosp@m.r@bn.nosp@m.l.gov
P. Loch loch@.nosp@m.phys.nosp@m.ics.a.nosp@m.rizo.nosp@m.na.ed.nosp@m.u
Date
April 1, 2005
Version
2

The CaloTowerContainer holds an ordered list of pointers to CaloTower s, where the index of a given tower in the list is determined by its \( ( \eta, \varphi ) \) location on the tower grid. When persistified, only the tower grid as stored in a CaloTowerSeg object held by the CaloTowerContainer object, and the list of contributing calorimeters are saved to disk. The CaloTowerContainer is refilled on the fly using this information when retrieved from the persistent store into the transient store (requires original CaloCellContainer to be available also).

Definition at line 76 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

Member Typedef Documentation

◆ allocator_type

typedef typename DataVectorBase<CaloTower>::Base::allocator_type DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::allocator_type
inherited

Definition at line 817 of file DataVector.h.

◆ Base

◆ base_data_vector

typedef DataVector DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::base_data_vector
inherited

Definition at line 854 of file DataVector.h.

◆ base_value_type

typedef CaloTower DataVector< CaloTower, typename DataVectorBase<CaloTower>::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 825 of file DataVector.h.

◆ BaseContainer

typedef typename DataVectorBase<CaloTower>::Base::PtrVector DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::BaseContainer
inherited

Definition at line 807 of file DataVector.h.

◆ const_iterator

◆ const_pointer

typedef CaloTower* const* DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::const_pointer
inherited

Definition at line 819 of file DataVector.h.

◆ const_reference

typedef CaloTower* const& DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::const_reference
inherited

Definition at line 813 of file DataVector.h.

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::const_reverse_iterator
inherited

Standard const_reverse_iterator.

Definition at line 847 of file DataVector.h.

◆ const_value_type

typedef const CaloTower* DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::const_value_type
inherited

Definition at line 821 of file DataVector.h.

◆ DataVector_BASE

typedef typename DataVectorBase<CaloTower>::Base DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::DataVector_BASE
inherited

Definition at line 797 of file DataVector.h.

◆ Deleter

using DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::Deleter
inherited

Definition at line 857 of file DataVector.h.

◆ difference_type

typedef typename DataVectorBase<CaloTower>::Base::difference_type DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::difference_type
inherited

Definition at line 815 of file DataVector.h.

◆ DVL_BASE

typedef typename DataVectorBase<CaloTower>::Base DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::DVL_BASE
inherited

Definition at line 798 of file DataVector.h.

◆ ElementProxy

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

Definition at line 833 of file DataVector.h.

◆ index_t

Tower map index type.

Definition at line 82 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

◆ iterator

Standard iterator.

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

Definition at line 842 of file DataVector.h.

◆ pointer

typedef CaloTower** DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::pointer
inherited

Definition at line 818 of file DataVector.h.

◆ PtrVector

typedef typename DataVectorBase<CaloTower>::Base::PtrVector DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::PtrVector
inherited

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

Definition at line 806 of file DataVector.h.

◆ reference

Definition at line 812 of file DataVector.h.

◆ reverse_iterator

◆ self

Definition at line 2063 of file DataVector.h.

◆ size_type

typedef typename DataVectorBase<CaloTower>::Base::size_type DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::size_type
inherited

Definition at line 814 of file DataVector.h.

◆ unique_type

typedef std::unique_ptr<base_value_type> DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::unique_type
inherited

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

Definition at line 829 of file DataVector.h.

◆ value_type

Definition at line 816 of file DataVector.h.

Constructor & Destructor Documentation

◆ CaloTowerContainer() [1/3]

CaloTowerContainer::CaloTowerContainer ( )

Default constructor.

Instantiates a CaloTowerContainer without a \( \Delta \eta \times \Delta \varphi \) grid definition. Limited use only.

Definition at line 46 of file CaloTowerContainer.cxx.

48{ }
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts

◆ CaloTowerContainer() [2/3]

CaloTowerContainer::CaloTowerContainer ( const CaloTowerSeg & tseg,
bool noTowers = false )

Useable Constructor.

Parameters
tseginput a CaloTowerSeg object containing a \( \Delta \eta \times \Delta \varphi \) tower grid description
noTowersIf true, don't create the contained towers.

Creates an empty CaloTower at each \( ( \eta, \varphi ) \) location of the grid.

Definition at line 50 of file CaloTowerContainer.cxx.

53 m_towerSeg(theSegmentation)
54{
55 if (!noTowers)
56 init();
57}
void init()
Initializes the CaloTowerContainer.

◆ CaloTowerContainer() [3/3]

CaloTowerContainer::CaloTowerContainer ( const CaloTowerContainer & other)

Copy constructor.

Definition at line 68 of file CaloTowerContainer.cxx.

70 Base(other.m_towers.size(), SG::VIEW_ELEMENTS),
71 m_towerSeg (other.m_towerSeg),
72 m_caloRegions (other.m_caloRegions),
73 m_towers (other.m_towers)
74{
75 setTowers();
76}
std::vector< unsigned int > m_caloRegions
Vector of calorimeter regions contributing to the tower signals.
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)

◆ ~CaloTowerContainer()

CaloTowerContainer::~CaloTowerContainer ( )
virtualdefault

Destructor.

Member Function Documentation

◆ assign() [1/2]

template<class InputIterator>
void CaloTowerContainer::assign ( InputIterator first,
InputIterator last )
private

◆ assign() [2/2]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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]

CaloTower * CaloTowerContainer::at ( size_type n)
inline

Definition at line 665 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

666{
667 return Base::at(n);
668}
const CaloTower * at(size_type n) const

◆ at() [2/2]

const CaloTower * DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::at ( size_type n) const

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< CaloTower, typename DataVectorBase<CaloTower>::Base >::auxbase ( ) const
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]

CaloTower * CaloTowerContainer::back ( )
inline

Definition at line 675 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

676{
677 return Base::back();
678}
const CaloTower * back() const

◆ back() [2/2]

const CaloTower * DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::back ( ) const

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

int DataVector< CaloTower, typename DataVectorBase<CaloTower>::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()

int DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::baseOffset1 ( const char * p,
const DataVector< CaloTower > & 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]

CaloTowerContainer::iterator CaloTowerContainer::begin ( )
inline

Definition at line 680 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

681{
682 return iterator (Base::begin());
683}
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
const_iterator begin() const noexcept

◆ begin() [2/2]

const_iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::begin ( ) const
noexcept

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.

◆ capacity()

size_type DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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.

◆ clear() [1/4]

void CaloTowerContainer::clear ( )
private

◆ clear() [2/4]

void CaloTowerContainer::clear ( SG::OwnershipPolicy p)

Definition at line 296 of file CaloTowerContainer.cxx.

297{
298 if (m_towerSeg.neta() > 0 || m_towerSeg.nphi() > 0)
299 throw std::runtime_error ("Bad call to CaloTowerContainer::clear");
300 Base::clear (p);
301}

◆ clear() [3/4]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::clear ( SG::OwnershipPolicy ownPolicy,
SG::IndexTrackingPolicy trackIndices )
inherited

◆ clear() [4/4]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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.

◆ deta()

double CaloTowerContainer::deta ( ) const
inline

Return bin size \( \Delta \eta \).

Definition at line 570 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

571{
572 return m_towerSeg.deta();
573}

◆ do_cast()

const CaloTower * DataVector< CaloTower, typename DataVectorBase<CaloTower>::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()

CaloTower * DataVector< CaloTower, typename DataVectorBase<CaloTower>::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.

◆ dphi()

double CaloTowerContainer::dphi ( ) const
inline

Return bin size \( \Delta \varphi \).

Definition at line 583 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

584{
585 return m_towerSeg.dphi();
586}

◆ dv_typeid()

virtual const std::type_info & DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::dv_typeid ( ) const
overrideprivatevirtualinherited

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

const DataModel_detail::DVLInfoBase & DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::Base >::dvlinfo_v ( ) const
overridevirtualinherited

Return the DV/DL info struct for this class.

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

◆ e() [1/3]

double CaloTowerContainer::e ( double theEta,
double thePhi ) const
inline

Return the tower energy at a given grid position.

Parameters
theEtainput \( \eta \) value
thePhiinput \( \varphi \) value

Returns 0 if input out of range.

Definition at line 205 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

206 { return this->energy(theEta,thePhi); }
double energy(double theEta, double thePhi) const
Return the tower energy at a given grid position.

◆ e() [2/3]

double CaloTowerContainer::e ( index_t etaIndex,
index_t phiIndex ) const
inline

Return the tower energy at a given grid position.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
etaIndexinput \( \eta \) index
phiIndexinput \( \varphi \) index

Definition at line 214 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

215 { return this->energy(etaIndex,phiIndex); }

◆ e() [3/3]

double CaloTowerContainer::e ( int etaIndex,
int phiIndex ) const
inline

Return the tower energy at a given grid position.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 220 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

221 { return this->energy(etaIndex,phiIndex); }

◆ emplace()

iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::Base >::empty ( ) const
nodiscardnoexceptinherited

Returns true if the collection is empty.

◆ end() [1/2]

CaloTowerContainer::iterator CaloTowerContainer::end ( )
inline

Definition at line 685 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

686{
687 return iterator (Base::end());
688}
const_iterator end() const noexcept

◆ end() [2/2]

const_iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::end ( ) const
noexcept

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.

◆ energy() [1/3]

double CaloTowerContainer::energy ( double theEta,
double thePhi ) const

Return the tower energy at a given grid position.

Parameters
theEtainput \( \eta \) value
thePhiinput \( \varphi \) value

Returns 0 if input out of range.

Definition at line 208 of file CaloTowerContainer.cxx.

209{
210 const CaloTower* t = this->getTower(theEta, thePhi);
211 return t ? t->e() : 0;
212}
CaloTower * getTower(index_t eta, index_t phi)
Returns a pointer to a tower with given indices.

◆ energy() [2/3]

double CaloTowerContainer::energy ( index_t etaIndex,
index_t phiIndex ) const

Return the tower energy at a given grid position.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
etaIndexinput \( \eta \) index
phiIndexinput \( \varphi \) index

Definition at line 202 of file CaloTowerContainer.cxx.

203{
204 const CaloTower* t = this->getTower(etaIndex,phiIndex);
205 return t ? t->e() : 0;
206}

◆ energy() [3/3]

double CaloTowerContainer::energy ( int etaIndex,
int phiIndex ) const
inline

Return the tower energy at a given grid position.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 243 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

244 { return energy((index_t)etaIndex,(index_t)phiIndex); }

◆ erase() [1/4]

iterator CaloTowerContainer::erase ( iterator first,
iterator last )
private

◆ erase() [2/4]

iterator CaloTowerContainer::erase ( iterator position)
private

◆ erase() [3/4]

iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::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() [4/4]

iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::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.

◆ et() [1/3]

double CaloTowerContainer::et ( double theEta,
double thePhi ) const

Return the tower transverse energy at a given grid position.

Parameters
theEtainput \( \eta \) value
thePhiinput \( \varphi \) value

Returns 0 if input out of range.

Definition at line 223 of file CaloTowerContainer.cxx.

224{
225 const CaloTower* t = this->getTower(theEta, thePhi);
226 return t ? t->et() : 0;
227}

◆ et() [2/3]

double CaloTowerContainer::et ( index_t etaIndex,
index_t phiIndex ) const

Return the tower transverse energy at a given grid position.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
etaIndexinput \( \eta \) index
phiIndexinput \( \varphi \) index

Definition at line 215 of file CaloTowerContainer.cxx.

216{
217 const CaloTower* t = this->getTower(etaIndex, phiIndex);
218 return t ? t->et() : 0;
219}

◆ et() [3/3]

double CaloTowerContainer::et ( int etaIndex,
int phiIndex ) const
inline

Return the tower transverse energy at a given grid position.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 195 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

196 { return et((index_t)etaIndex,(index_t)phiIndex); } // temp fix!
double et(double theEta, double thePhi) const
Return the tower transverse energy at a given grid position.

◆ etamin()

double CaloTowerContainer::etamin ( ) const
inline

Return lower \( \eta \) value range boundary.

Definition at line 566 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

567{
568 return m_towerSeg.etamin();
569}

◆ flagOutOfRange()

CaloTowerContainer::index_t CaloTowerContainer::flagOutOfRange ( ) const
inline

Returns the index out-of-range indicator.

Definition at line 651 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

652{
653 return m_outOfRange;
654}
static const index_t m_outOfRange
Index overflow indicator.

◆ front() [1/2]

CaloTower * CaloTowerContainer::front ( )
inline

Definition at line 670 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

671{
672 return Base::front();
673}
const CaloTower * front() const

◆ front() [2/2]

const CaloTower * DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::front ( ) const

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 CaloTower * DataVector< CaloTower, typename DataVectorBase<CaloTower>::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).

◆ getCalos()

size_t CaloTowerContainer::getCalos ( std::vector< CaloCell_ID::SUBCALO > & theCalos) const

Retrieve the list of used calorimeters.

Parameters
theCalosreference to a modifiable vector of calorimeter indices

Fills a vector with the list of included calorimeters and returns the number of included calorimeters.

Definition at line 180 of file CaloTowerContainer.cxx.

181{
182 theCalos.resize(m_caloRegions.size());
183 std::vector<unsigned int>::size_type i;
184 for(i=0;i<m_caloRegions.size();++i)
185 theCalos[i] = (CaloCell_ID::SUBCALO) m_caloRegions[i];
186
187// std::copy(m_caloRegions.begin(),m_caloRegions.end(),theCalos.begin());
188 return theCalos.size();
189}
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50

◆ getNumberOfCalos()

size_t CaloTowerContainer::getNumberOfCalos ( ) const
inline

Returns the number of included calorimeters.

Definition at line 560 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

561{
562 return m_caloRegions.size();
563}

◆ getTower() [1/8]

CaloTower * CaloTowerContainer::getTower ( double eta,
double phi )

Returns a pointer to a tower with given \( ( \eta, \varphi ) \) values.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
etainput \( \eta \) value
phiinput \( \varphi \) value

Definition at line 286 of file CaloTowerContainer.cxx.

287{
288 index_t etaIndex = m_outOfRange;
290 return this->getTowerIndices(theEta,thePhi,etaIndex,phiIndex)
291 ? (this->operator[])(this->getTowerIndex(etaIndex,phiIndex))
292 : (CaloTower*)nullptr;
293}
index_t getTowerIndex(const CaloTower *aTower) const
Returns the combined index of a tower on the grid.
bool getTowerIndices(const CaloTower *aTower, index_t &indexEta, index_t &indexPhi) const
Returns both and indices for a given tower.
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

◆ getTower() [2/8]

const CaloTower * CaloTowerContainer::getTower ( double eta,
double phi ) const

Returns a const pointer to a tower with given \( ( \eta, \varphi ) \) values.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 277 of file CaloTowerContainer.cxx.

279{
280 index_t etaIndex = m_outOfRange;
282 return this->getTowerIndices(theEta,thePhi,etaIndex,phiIndex)
283 ? (this->operator[])(this->getTowerIndex(etaIndex,phiIndex))
284 : (const CaloTower*)nullptr;
285}
bool const RAWDATA *ch2 const

◆ getTower() [3/8]

CaloTower * CaloTowerContainer::getTower ( index_t eta,
index_t phi )

Returns a pointer to a tower with given \( ( \eta, \varphi ) \) indices.

Parameters
etainput \( \eta \) index
phiinput \( \varphi \) index

Returns 0 if indices out of range.

Definition at line 266 of file CaloTowerContainer.cxx.

267{
268 index_t theIndex = this->getTowerIndex(etaIndex,phiIndex);
269 return theIndex != m_outOfRange
270#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
271 ? Base::operator[](theIndex)
272#else
273 ? &m_towers[theIndex]
274#endif
275 : (CaloTower*)nullptr;
276}
const CaloTower * operator[](size_type n) const

◆ getTower() [4/8]

const CaloTower * CaloTowerContainer::getTower ( index_t eta,
index_t phi ) const

Returns a const pointer to a tower with given \( ( \eta, \varphi ) \) indices.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 253 of file CaloTowerContainer.cxx.

256{
257 index_t theIndex = this->getTowerIndex(etaIndex,phiIndex);
258 return theIndex != m_outOfRange
259#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
260 ? Base::operator[](theIndex)
261#else
262 ? &m_towers[theIndex]
263#endif
264 : (const CaloTower*)nullptr;
265}

◆ getTower() [5/8]

CaloTower * CaloTowerContainer::getTower ( index_t theIndex)
inline

Returns a pointer to a tower with a given combined index.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
theIndexinput combined index

Definition at line 403 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

404 {
405 return theIndex < this->size()
406 ? (this->operator[])(theIndex)
407 : (CaloTower*)0;
408 }
size_type size() const noexcept

◆ getTower() [6/8]

const CaloTower * CaloTowerContainer::getTower ( index_t theIndex) const
inline

Returns a const pointer to a tower with a given combined index.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 413 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

414 {
415 return theIndex < this->size()
416 ? (this->operator[])(theIndex)
417 : (const CaloTower*)0;
418 }

◆ getTower() [7/8]

CaloTower * CaloTowerContainer::getTower ( int eta,
int phi )
inline

Returns a pointer to a tower with given \( ( \eta, \varphi ) \) indices.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 372 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

373 { return this->getTower(index_t(eta), index_t(phi)); }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method

◆ getTower() [8/8]

const CaloTower * CaloTowerContainer::getTower ( int eta,
int phi ) const
inline

Returns a const pointer to a tower with given \( ( \eta, \varphi ) \) indices.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 379 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

380 { return this->getTower(index_t(eta), index_t(phi)); }

◆ getTowerEtaIndex() [1/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerEtaIndex ( const CaloTower * aTower) const
inline

Returns the \( \eta \) index for a given tower.

Parameters
aTowerpointer to a CaloTower object

Returns index_t(-1) if input invalid.

Definition at line 616 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

617{
618 return aTower != 0
619 ? this->getTowerEtaIndex(aTower->eta())
620 : m_outOfRange;
621}
index_t getTowerEtaIndex(const CaloTower *aTower) const
Returns the index for a given tower.
virtual double eta() const override final
get eta data member

◆ getTowerEtaIndex() [2/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerEtaIndex ( double theEta) const
inline

Returns the \( \eta \) index for a given \( \eta \) value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
theEtainput \( \eta \) value

Definition at line 623 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

624{
625 return m_towerSeg.etaIndex(theEta);
626}

◆ getTowerEtaIndex() [3/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerEtaIndex ( index_t towerIndex) const
inline

Returns the \( \eta \) index for a given combined index.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
towerIndexinput combined index

Definition at line 628 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

629{
630 return m_towerSeg.etaIndex(combinedIndex);
631}

◆ getTowerIndex() [1/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerIndex ( const CaloTower * aTower) const
inline

Returns the combined index of a tower on the grid.

Parameters
aTowerpointer to a CaloTower object

Returns index_t(-1) if input invalid.

Definition at line 598 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

599{
600 return aTower != 0
601 ? this->getTowerIndex(aTower->eta(),aTower->phi())
602 : m_outOfRange;
603}
virtual double phi() const override final
get phi data member

◆ getTowerIndex() [2/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerIndex ( double theEta,
double thePhi ) const
inline

Returns the combined index for given \( \eta \) and \( \varphi \) values.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
theEtainput \( \eta \) value
thePhiinput \( \varphi \) value

Definition at line 610 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

611{
612 return this->getTowerIndex(this->getTowerEtaIndex(theEta),
613 this->getTowerPhiIndex(thePhi));
614}
index_t getTowerPhiIndex(const CaloTower *aTower) const
Returns the index for a given tower.

◆ getTowerIndex() [3/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerIndex ( index_t etaIndex,
index_t phiIndex ) const
inline

Returns the combined index for given \( \eta \) and \( \varphi \) indices.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
etaIndexinput \( \eta \) index
phiIndexinput \( \varphi \) index

Definition at line 605 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

606{
607 return m_towerSeg.etaphi(etaIndex,phiIndex);
608}

◆ getTowerIndices() [1/2]

bool CaloTowerContainer::getTowerIndices ( const CaloTower * aTower,
index_t & indexEta,
index_t & indexPhi ) const

Returns both \( \eta \) and \( \varphi \) indices for a given tower.

Parameters
aTowerinput pointer to a CaloTower
indexEtareference to a modifiable \( \eta \) index (set on return)
indexPhireference to a modifiable \( \varphi \) index (set on return)

Returns true if tower allocated with valid indices.

Definition at line 235 of file CaloTowerContainer.cxx.

238{
239 return aTower != nullptr
240 ? this->getTowerIndices(aTower->eta(),aTower->phi(),etaIndex,phiIndex)
241 : false;
242}

◆ getTowerIndices() [2/2]

bool CaloTowerContainer::getTowerIndices ( double theEta,
double thePhi,
index_t & indexEta,
index_t & indexPhi ) const

Returns both \( \eta \) and \( \varphi \) indices for given \( \eta \) and \( \varphi \) values.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
theEtainput \( \eta \) index
thePhiinput \( \varphi \) index
indexEtareference to a modifiable \( \eta \) index (set on return)
indexPhireference to a modifiable \( \varphi \) index (set on return)

Returns true if tower allocated with valid indices.

Definition at line 243 of file CaloTowerContainer.cxx.

246{
247 etaIndex = this->getTowerEtaIndex(theEta);
248 phiIndex = this->getTowerPhiIndex(thePhi);
249 return ( etaIndex != m_outOfRange && phiIndex != m_outOfRange );
250}

◆ getTowerPhiIndex() [1/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerPhiIndex ( const CaloTower * aTower) const
inline

Returns the \( \varphi \) index for a given tower.

Parameters
aTowerpointer to a CaloTower object

Returns index_t(-1) if input invalid.

Definition at line 633 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

634{
635 return aTower != 0
636 ? this->getTowerPhiIndex(aTower->phi())
637 : m_outOfRange;
638}

◆ getTowerPhiIndex() [2/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerPhiIndex ( double thePhi) const
inline

Returns the \( \varphi \) index for a given \( \varphi \) value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
thePhiinput \( \varphi \) value

Definition at line 640 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

641{
642 return m_towerSeg.phiIndex(thePhi);
643}

◆ getTowerPhiIndex() [3/3]

CaloTowerContainer::index_t CaloTowerContainer::getTowerPhiIndex ( index_t towerIndex) const
inline

Returns the \( \varphi \) index for a given combined index.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
towerIndexinput combined index

Definition at line 645 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

646{
647 return m_towerSeg.phiIndex(combinedIndex);
648}

◆ init()

void CaloTowerContainer::init ( )

Initializes the CaloTowerContainer.

A CaloTower object with zero energy is put at each \( ( \eta, \varphi ) \) position of the tower grid.

Definition at line 107 of file CaloTowerContainer.cxx.

108{
109 // pre-size the container
112 index_t phiBins = (index_t)m_towerSeg.nphi();
113#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
114 Base::resize (etaBins * phiBins);
115#else
116 this->m_towers.resize (etaBins * phiBins);
117 setTowers();
118#endif
119
120
121 // get the eta/phi segmentation
122 double deltaEta = m_towerSeg.deta();
123 double minEta = m_towerSeg.etamin() + deltaEta / 2.;
124 double deltaPhi = m_towerSeg.dphi();
125 double minPhi = CaloPhiRange::fix (m_towerSeg.phimin() + deltaPhi / 2.);
126
127#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
128 DataPool<CaloTower> towersPool (etaBins * phiBins);
129#endif
130
131 // insert empty towers
132 // NOTE: eta/phi indexing is 1-based.
133 for (index_t etaIndex = 1; etaIndex <= etaBins; ++etaIndex) {
134 double theEta = minEta + (etaIndex-1) * deltaEta;
135 for (index_t phiIndex = 1; phiIndex <= phiBins; ++phiIndex) {
136 double thePhi = CaloPhiRange::fix (minPhi + (phiIndex-1) * deltaPhi);
137 index_t towerIndex = this->getTowerIndex(etaIndex,phiIndex);
138#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
139 CaloTower& tower = *towersPool.nextElementPtr();
140 Base::operator[] (towerIndex) = &tower;
141 tower.removeCells();
142 tower.setE(0);
143#else
144 CaloTower& tower = m_towers[towerIndex];
145#endif
146 tower.setEta (theEta);
147 tower.setPhi (thePhi);
148 }
149 }
150}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
void removeCells()
Remove all cells without kinematic update.
static double fix(double phi)
void resize(size_type sz)
virtual void setEta(double theEta)
set eta data member
Definition P4EEtaPhiM.h:117
virtual void setE(double theE)
set energy data member
Definition P4EEtaPhiM.h:114
virtual void setPhi(double thePhi)
set phi data member
Definition P4EEtaPhiM.h:120
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition P4Helpers.h:66

◆ insert() [1/7]

template<class InputIterator>
void CaloTowerContainer::insert ( iterator position,
InputIterator first,
InputIterator last )
private

◆ insert() [2/7]

void CaloTowerContainer::insert ( iterator position,
iterator first,
iterator last )

Definition at line 303 of file CaloTowerContainer.cxx.

306{
307 if (m_towerSeg.neta() > 0 || m_towerSeg.nphi() > 0 ||
309 {
310 throw std::runtime_error ("Bad call to CaloTowerContainer::insert");
311 }
312 Base::insert (position.base(), first.base(), last.base());
313}
iterator insert(iterator position, value_type pElem)
SG::OwnershipPolicy ownPolicy() const
bool first
Definition DeMoScan.py:534

◆ insert() [3/7]

iterator CaloTowerContainer::insert ( iterator position,
value_type pElem )
private

◆ insert() [4/7]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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() [5/7]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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() [6/7]

iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::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() [7/7]

iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::Base >::insertMove ( iterator position,
DataVector< CaloTower > & 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.

◆ isOutOfRange()

bool CaloTowerContainer::isOutOfRange ( index_t anIndex) const
inline

Checks if an index is out of range.

Parameters
anIndexinput combined tower index

Returns true if index is out of range.

Definition at line 655 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

656{
657 return anIndex >= this->size() || anIndex == m_outOfRange;
658}

◆ iter_swap()

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::Base >::max_size ( ) const
noexceptinherited

Returns the size() of the largest possible collection.

◆ neta()

size_t CaloTowerContainer::neta ( ) const
inline

Return number of \( \eta \) bins.

Definition at line 574 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

575{
576 return m_towerSeg.neta();
577}

◆ nphi()

size_t CaloTowerContainer::nphi ( ) const
inline

Return number of \( \varphi \) bins.

Definition at line 587 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

588{
589 return m_towerSeg.nphi();
590}

◆ operator=()

CaloTowerContainer & CaloTowerContainer::operator= ( const CaloTowerContainer & other)

Assignment.

Definition at line 80 of file CaloTowerContainer.cxx.

81{
82 if (this != &other) {
83 m_towerSeg = other.m_towerSeg;
84 m_caloRegions = other.m_caloRegions;
85#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
86 Base::operator= (other);
87#else
88 m_towers = other.m_towers;
89 setTowers();
90#endif
91 }
92 return *this;
93}
DataVector & operator=(const DataVector &rhs)

◆ operator[]() [1/2]

CaloTower * CaloTowerContainer::operator[] ( size_type n)
inline

Definition at line 660 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

661{
662 return Base::operator[](n);
663}

◆ operator[]() [2/2]

const CaloTower * DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::operator[] ( size_type n) const

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.

◆ ownPolicy()

SG::OwnershipPolicy DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::ownPolicy ( ) const
inherited

Return the ownership policy setting for this container.

◆ phimin()

double CaloTowerContainer::phimin ( ) const
inline

Return lower \( \varphi \) value range boundary.

Definition at line 578 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

579{
580 return m_towerSeg.phimin();
581}

◆ pop_back()

void CaloTowerContainer::pop_back ( )
private

◆ push_back() [1/2]

void CaloTowerContainer::push_back ( value_type pElem)

Definition at line 315 of file CaloTowerContainer.cxx.

316{
317 if (m_towerSeg.neta() > 0 || m_towerSeg.nphi() > 0 ||
319 {
320 throw std::runtime_error ("Bad call to CaloTowerContainer::push_back");
321 }
322 Base::push_back (pElem);
323}
value_type push_back(value_type pElem)

◆ push_back() [2/2]

value_type DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::push_back ( std::unique_ptr< 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_new()

size_type DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::push_new ( size_type n,
F alloc )
inherited

Create and add a number of new elements to the end of the container.

Parameters
nThe number of new elements to add.
allocFunctional to call to allocate a new element to push. Should be callable like T* = alloc(); For example:
dv.push_new (n, [](){ return new Foo; });
Definition FooBar.h:9
It may also be useful to allocate from a DataPool.

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

Returns the original size of the vector.

◆ rbegin() [1/2]

◆ rbegin() [2/2]

const_reverse_iterator DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::rbegin ( ) const
noexcept

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.

◆ rend() [1/2]

◆ rend() [2/2]

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.

◆ reserve()

void CaloTowerContainer::reserve ( size_type n)
private

◆ resize()

void CaloTowerContainer::resize ( size_type sz)
private

◆ resortAux()

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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.

◆ setCalo()

void CaloTowerContainer::setCalo ( const CaloCell_ID::SUBCALO & nCalo)

Adds a calorimeter index to the tower.

Parameters
nCaloinput calorimeter index

Updates the list of calorimeters included in the towers. This list is needed to restore the CaloTowerContainer from persistency.

Definition at line 169 of file CaloTowerContainer.cxx.

170{
171 unsigned int intCalo = theCalo ;
172 if ( std::find(m_caloRegions.begin(),m_caloRegions.end(),intCalo)
173 == m_caloRegions.end() )
174 {
175 m_caloRegions.push_back(intCalo);
176 }
177}

◆ setMostDerived()

virtual void DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::setMostDerived ( )
overrideprotectedvirtualinherited

Set m_isMostDerived for this instance and clear it for all bases.

Called from testInsert if the test fails. The flag may not have been set if this container was made via copy construction, so set it appropriately now so we can test again.

◆ shift()

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::Base >::shrink_to_fit ( )
inherited

◆ size()

size_type DataVector< CaloTower, typename DataVectorBase<CaloTower>::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 CaloTowerContainer::sort ( )
private

◆ sort() [2/2]

template<class COMPARE>
void CaloTowerContainer::sort ( COMPARE comp)
private

◆ stdcont()

const PtrVector & DataVector< CaloTower, typename DataVectorBase<CaloTower>::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 CaloTowerContainer::swap ( CaloTowerContainer & other)

Swap.

Definition at line 95 of file CaloTowerContainer.cxx.

96{
97 if (this != &other) {
98 Base::swap (other);
99 std::swap (m_towerSeg, other.m_towerSeg);
100 m_caloRegions.swap (other.m_caloRegions);
101#ifndef CALOTOWERCONTAINER_USES_DATAPOOL
102 m_towers.swap (other.m_towers);
103#endif
104 }
105}
void swap(DataVector &rhs)
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)

◆ swap() [2/2]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::swap ( DataVector< CaloTower > & 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 CaloTowerContainer::swapElement ( size_type index,
value_type newElem,
reference oldElem )
private

◆ swapElement() [2/4]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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() [3/4]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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() [4/4]

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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.

◆ testInsert()

void DataVector< CaloTower, typename DataVectorBase<CaloTower>::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< CaloTower, typename DataVectorBase<CaloTower>::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.

◆ towerseg()

const CaloTowerSeg & CaloTowerContainer::towerseg ( ) const
inline

Return a copy of the attached CaloTowerSeg.

Definition at line 591 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

592{
593 return m_towerSeg;
594}

◆ CaloTowerContainerCnv_p1

Member Data Documentation

◆ has_virtual

const bool DataVector< CaloTower, typename DataVectorBase<CaloTower>::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 802 of file DataVector.h.

◆ m_caloRegions

std::vector<unsigned int> CaloTowerContainer::m_caloRegions
private

Vector of calorimeter regions contributing to the tower signals.

Definition at line 520 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

◆ m_isMostDerived

SG::IsMostDerivedFlag DataVector< CaloTower, typename DataVectorBase<CaloTower>::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 2059 of file DataVector.h.

◆ m_outOfRange

const index_t CaloTowerContainer::m_outOfRange = static_cast<index_t>(-1)
staticprivate

Index overflow indicator.

Definition at line 530 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

◆ m_towerSeg

CaloTowerSeg CaloTowerContainer::m_towerSeg
private

Tower grid \( ( \Delta \eta \times \Delta \varphi ) \) descriptor.

Definition at line 517 of file Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h.

◆ must_own

bool DataVector< CaloTower, typename DataVectorBase<CaloTower>::Base >::must_own
staticconstexprinherited

If true, then this type must own its contents.

Definition at line 860 of file DataVector.h.


The documentation for this class was generated from the following files: