|
| | CaloTowerContainer_v1 (SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES) |
| | Default constructor Constructs a tower container without structure (binning) or content. More...
|
| |
| | CaloTowerContainer_v1 (int nEtaBins, double etaMin, double etaMax, int nPhiBins, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES) |
| | Loaded constructor. More...
|
| |
| | ~CaloTowerContainer_v1 () |
| | Destructor. More...
|
| |
|
Configure the tower grid with individual parameters
- Note
- Invoking the
configureGrid method is mandatory to set up a valid tower grid, if the CaloTowerContainer_v1 is constructed with the default constructor.
- Parameters
-
| [in] | nEtaBins | number of bins in pseudorapidity |
| [in] | etaMin | lower boundary of pseudorapidity range |
| [in] | etaMax | upper boundary of pseudorapidity range |
| [in] | nPhiBins | number of bins in azimuth |
- Note
- The \( \phi \) boundaries are hardcoded to \( [-\pi,\pi] \)
-
This method will internally invoke
CaloTowerContainer_v1::configureGrid() method.
|
| bool | configureGrid (int nEtaBins, double etaMin, double etaMax, int nPhiBins) |
| |
|
| int | nEtaBins () const |
| |
| double | etaMin () const |
| |
More...
|
| |
| double | etaMax () const |
| |
More...
|
| |
| double | deltaEta () const |
| |
More...
|
| |
| int | nPhiBins () const |
| |
More...
|
| |
| double | phiMin () const |
| |
More...
|
| |
| double | phiMax () const |
| |
More...
|
| |
| double | deltaPhi () const |
| |
More...
|
| |
| int | nTowers () const |
| |
More...
|
| |
|
Returns the nominal number of towers
|
| int | index (double eta, double phi) const |
| |
| double | eta (size_t index) const |
| |
| double | phi (size_t index) const |
| |
| const CaloTower_v1 * | tower (double eta, double phi) const |
| |
|
| 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::DVLInfoBase & | dvlinfo_v () const override |
| | Return the DV/DL info struct for this class. More...
|
| |
| const SG::AuxVectorBase & | auxbase () 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 PtrVector & | stdcont () 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::DVLInfoBase & | dvlinfo () |
| | 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...
|
| |
Basic container storing all information need for xAOD::CaloTower_v1 objects.
This container does not only provide the store for CaloTower_v1 object, but also all meta-data needed to provide the tower grid and kinematics. The tower grid is defined in terms of pseudorapidity ( \( \eta \)) and azimuth ( \( \phi \)). In this it follows the CaloCell direction descriptors. As calorimeter towers represented by xAOD::CaloTower_v1 objects are by definition massless, any four-momentum representation extracted from a calorimeter tower (a bin in tower grid specified by this container) yields \( y = \eta \) for rapidity \( y \).
There is no need to rebuild this container event-by-event, because the direction of any given tower never changes, only its energy content; the direction is related to the tower's index in the container.
Usage default tower grid version (without the code recording in the event store):
towCont->setStore(towAuxCont);
Definition at line 20 of file CaloTowerContainer_v1.h.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Return the offset of a base DataVector class.
- Parameters
-
| ti | std::type_info of the desired class. |
If ti represents a DataVector base class of this one, then return the offset of that base class. Otherwise, return -1.
This function is here due to limitations of root 6, which can't calculate these offsets correctly from the dictionary if virtual derivation is used.
template<class T , class BASE = typename DataVectorBase<T>::Base>
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
-
| ownPolicy | The new ownership policy of the container. |
| trackIndices | The index tracking policy. |
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Erase all the elements in the collection, and reset the ownership mode.
- Parameters
-
| ownPolicy | The 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Erase all the elements in the collection, and change how elements are to be deleted.
- Parameters
-
| deleter | Object 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
|
|
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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Add a new element to the collection.
- Parameters
-
| position | Iterator before which the element will be added. |
| pElem | The 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Add an element to the end of the collection.
- Parameters
-
| pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector in the hierarchy.
For DataVector, this is like the same as push_back, and it returns the pushed element. It's included just for interface compatibility with std::vector.
template<class T , class BASE = typename DataVectorBase<T>::Base>
template<class InputIterator , DataVector_detail::enable_if_ptr_itr< InputIterator, T > = true>
| void DataVector< T, BASE >::insert |
( |
iterator |
position, |
|
|
InputIterator |
first, |
|
|
InputIterator |
last |
|
) |
| |
|
inherited |
Add a group of new elements to the collection.
- Parameters
-
| position | Iterator before which the element will be added. |
| first | The start of the range to put in the container. |
| last | The 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*.
template<class T , class BASE = typename DataVectorBase<T>::Base>
template<class InputIterator , DataVector_detail::enable_if_up_itr< InputIterator, T > = true>
| void DataVector< T, BASE >::insert |
( |
iterator |
position, |
|
|
InputIterator |
first, |
|
|
InputIterator |
last |
|
) |
| |
|
inherited |
Add a group of new elements to the collection.
- Parameters
-
| position | Iterator before which the element will be added. |
| first | The start of the range to put in the container. |
| last | The 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>.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Add a group of new elements to the collection.
- Parameters
-
| position | Iterator before which the element will be added. |
| l | An 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Insert the contents of another DataVector, with auxiliary data copied via move semantics.
- Parameters
-
| position | Iterator before which the new elements will be added. |
| other | The vector to add. |
The ownership mode of this vector must be the same as other; otherwise, an exception will be thrown.
If both vectors are view vectors, then this is the same as insert (position, other.begin(), other.end()) .
Otherwise, the elements from other will be inserted into this vector. This vector will take ownership of the elements, and the ownership mode of other will be changed to VIEW_ELEMENTS. Auxiliary data for these elements will be transferred, using move semantics if possible. (Thus, the auxiliary store for other may be modified and must not be locked.) Finally, the auxiliary store pointer for other will be cleared (but the store itself will not be deleted since it's not owned by the vector).
Note: this method may only be called using the most derived DataVector in the hierarchy.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Add an element to the end of the collection.
- Parameters
-
| pElem | The 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Add an element to the end of the collection.
- Parameters
-
| pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector in the hierarchy.
Returns the pushed pointer.
template<class T , class BASE = typename DataVectorBase<T>::Base>
template<CxxUtils::detail::AllocationFunction< T > F>
Create and add a number of new elements to the end of the container.
- Parameters
-
| n | The number of new elements to add. |
| alloc | Functional to call to allocate a new element to push. Should be callable like T* = alloc(); For example: dv.push_new ( n, [](){ return new Foo; });
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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Resizes the collection to the specified number of elements.
- Parameters
-
| sz | The new size of the collection. |
Note that this function differs from the standard in that it does not allow specifying the value of any inserted elements. They will always be 0.
If the container is shrunk, elements will be deleted as with erase().
template<class T , class BASE = typename DataVectorBase<T>::Base>
Reset indices / reorder aux data after elements have been permuted.
- Parameters
-
| beg | Start of the range of elements to process. |
| end | End of the range of elements to process. |
Call this after some operation that has permuted the elements in the container (such as sort). The index information in the elements will be used to permute all auxiliary data in the same way. Finally, all the indices will be reset in the correct order.
template<class T , class BASE = typename DataVectorBase<T>::Base>
| virtual void DataVector< T, 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
| void DataVector< T, BASE >::shift |
( |
size_t |
pos, |
|
|
ptrdiff_t |
offs |
|
) |
| |
|
privateinherited |
Shift the auxiliary elements of the container.
- Parameters
-
| pos | The starting index for the shift. |
| offs | The (signed) amount of the shift. |
The elements in the container should have already been shifted; this operation will then adjust the element indices and also shift the elements in the vectors for all aux data items. offs may be either positive or negative.
If offs is positive, then the container is growing. The container size should be increased by offs, the element at pos moved to pos + offs, and similarly for following elements. The elements between pos and pos + offs should be default-initialized.
If offs is negative, then the container is shrinking. The element at pos should be moved to pos + offs, and similarly for following elements. The container should then be shrunk by -offs elements (running destructors as appropriate).
template<class T , class BASE = typename DataVectorBase<T>::Base>
Swap this collection with another.
- Parameters
-
| rhs | The collection with which to swap. |
Ownership is swapped along with the collection content.
Note: this method may only be called using the most-derived DataVector in the hierarchy. The rhs must also be referenced using the most-derived DataVector.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Swap one element out of the container.
- Parameters
-
| pos | The element in the container to swap. |
| newElem | New element to put in the container. May be 0. |
| oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Swap one element out of the container.
- Parameters
-
| pos | The element in the container to swap. |
| newElem | New element to put in the container. May be 0. |
| oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element 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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Swap one element out of the container.
- Parameters
-
| index | Index of the element in the container to swap. |
| newElem | New element to put in the container. May be 0. |
| oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem.
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.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Swap one element out of the container.
- Parameters
-
| index | Index of the element in the container to swap. |
| newElem | New element to put in the container. May be 0. |
| oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.
Note: this method may only be called using the most derived DataVector in the hierarchy.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Test if we can insert; raise an exception if not.
- Parameters
-
| op | Description of the attempted operation. |
In order to maintain type-safety, we can only allow insertions using the most-derived instance of DataVector. This checks this by testing the m_isMostDerived, which is set by the constructors to true only for the most-derived instance. If the test fails, we call to potentially out-of-line code to continue.
template<class T , class BASE = typename DataVectorBase<T>::Base>
Test if we can insert; raise an exception if not.
- Parameters
-
| op | Description of the attempted operation. |
This continues the test of testInsert. There is one case where m_isMostDerived may not be set correctly. If this container was made via copy construction, then all the m_isMostDerived flags will be false. So we call setMostDerived to set the flags correctly and test again. If the test fails again, then we raise an exception.