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

#include <TgcRdo.h>

Inheritance diagram for TgcRdo:
Collaboration diagram for TgcRdo:

Classes

struct  Errors
struct  LocalStatus
struct  m_errors
struct  m_localStatus
struct  m_rodStatus
struct  RodStatus

Public Types

typedef uint16_t ID
typedef TgcRawData DIGIT
typedef typename DataVectorBase< TgcRawData >::Base DataVector_BASE
typedef typename DataVectorBase< TgcRawData >::Base DVL_BASE
typedef typename DataVectorBase< TgcRawData >::Base::PtrVector PtrVector
 This is the type of the underlying std::vector (what stdcont returns).
typedef typename DataVectorBase< TgcRawData >::Base::PtrVector BaseContainer
typedef TgcRawData *& reference
typedef TgcRawData *const & const_reference
typedef typename DataVectorBase< TgcRawData >::Base::size_type size_type
typedef typename DataVectorBase< TgcRawData >::Base::difference_type difference_type
typedef TgcRawDatavalue_type
typedef typename DataVectorBase< TgcRawData >::Base::allocator_type allocator_type
typedef TgcRawData ** pointer
typedef TgcRawData *const * const_pointer
typedef const TgcRawDataconst_value_type
typedef TgcRawData 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 std::reverse_iterator< iteratorreverse_iterator
 Standard reverse_iterator.
typedef DataVector base_data_vector
using Deleter

Public Member Functions

 TgcRdo ()
 Default constructor.
 TgcRdo (uint16_t id, IdentifierHash idHash)
 Creates an empty container ready for writing.
 TgcRdo (uint16_t subDetectorId, uint16_t rodId, uint16_t bcId, uint16_t l1Id)
virtual ~TgcRdo ()
uint16_t identify () const
IdentifierHash identifyHash () const
void setL1Id (uint32_t v)
void setBcId (uint16_t v)
void setTriggerType (uint16_t v)
void setOnlineId (uint16_t subDetectorId, uint16_t rodId)
uint16_t subDetectorId () const
uint16_t rodId () const
uint16_t triggerType () const
uint16_t bcId () const
uint16_t l1Id () const
const Errorserrors () const
void setErrors (uint16_t data)
const RodStatusrodStatus () const
void setRodStatus (uint32_t data)
const LocalStatuslocalStatus () const
void setLocalStatus (uint32_t data)
uint32_t orbit () const
void setOrbit (uint32_t orbit)
uint16_t version () const
void setVersion (uint16_t version)
void clear ()
Constructors, destructors, assignment.
void assign (InputIterator first, InputIterator last)
 Assign from iterators.
Size and capacity.
size_type size () const noexcept
 Returns the number of elements in the collection.
void resize (size_type sz)
 Resizes the collection to the specified number of elements.
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements.
Element access.

Change the vector capacity to match the current size.

Note: this does not affect auxiliary data.

const TgcRawDataoperator[] (size_type n) const
 Access an element, as an rvalue.
const TgcRawDataget (size_type n) const
 Access an element, as an rvalue.
const TgcRawDataat (size_type n) const
 Access an element, as an rvalue.
const TgcRawDatafront () const
 Access the first element in the collection as an rvalue.
const TgcRawDataback () const
 Access the last element in the collection as an rvalue.
Iterator creation.
const_iterator begin () const noexcept
 Return a const_iterator pointing at the beginning of the collection.
const_iterator end () const noexcept
 Return a const_iterator pointing past the end of the collection.
const_reverse_iterator rbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection.
const_reverse_iterator rend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection.
const_iterator cbegin () const noexcept
 Return a const_iterator pointing at the beginning of the collection.
const_iterator cend () const noexcept
 Return a const_iterator pointing past the end of the collection.
const_reverse_iterator crbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection.
const_reverse_iterator crend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection.
Insertion operations.
value_type push_back (value_type pElem)
 Add an element to the end of the collection.
size_type push_new (size_type n, F alloc)
 Create and add a number of new elements to the end of the container.
value_type emplace_back (value_type pElem)
 Add an element to the end of the collection.
iterator insert (iterator position, value_type pElem)
 Add a new element to the collection.
iterator emplace (iterator position, value_type pElem)
 Add a new element to the collection.
void insertMove (iterator position, DataVector &other)
 Insert the contents of another DataVector, with auxiliary data copied via move semantics.
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position.
void pop_back ()
 Remove the last element from the collection.

Static Public Member Functions

static uint16_t identifyRawData (const TgcRawData &rawData)
static uint16_t calculateOnlineId (uint16_t subDetectorId, uint16_t rodId)

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.

Static Private Member Functions

static std::pair< int, int > initOnlineId ()

Private Attributes

uint16_t m_version = 0U
uint16_t m_id = 0U
 ID of this instance.
IdentifierHash m_idHash
 OFFLINE hash of this collection.
uint16_t m_subDetectorId = 0U
uint16_t m_rodId = 0U
uint16_t m_triggerType = 0U
uint16_t m_bcId = 0U
uint16_t m_l1Id = 0U
uint32_t m_orbit = 0U

Internal operations.

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

Swap and sort.

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

Non-standard operations.

void swapElement (size_type index, value_type newElem, reference oldElem)
 Swap one element out of the container.
virtual const DataModel_detail::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.

Detailed Description

Definition at line 21 of file TgcRdo.h.

Member Typedef Documentation

◆ allocator_type

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

Definition at line 817 of file DataVector.h.

◆ base_data_vector

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

Definition at line 854 of file DataVector.h.

◆ base_value_type

typedef TgcRawData DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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<TgcRawData>::Base::PtrVector DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::BaseContainer
inherited

Definition at line 807 of file DataVector.h.

◆ const_iterator

◆ const_pointer

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

Definition at line 819 of file DataVector.h.

◆ const_reference

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

Definition at line 813 of file DataVector.h.

◆ const_reverse_iterator

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

Standard const_reverse_iterator.

Definition at line 847 of file DataVector.h.

◆ const_value_type

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

Definition at line 821 of file DataVector.h.

◆ DataVector_BASE

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

Definition at line 797 of file DataVector.h.

◆ Deleter

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

Definition at line 857 of file DataVector.h.

◆ difference_type

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

Definition at line 815 of file DataVector.h.

◆ DIGIT

Definition at line 26 of file TgcRdo.h.

◆ DVL_BASE

typedef typename DataVectorBase<TgcRawData>::Base DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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.

◆ ID

typedef uint16_t TgcRdo::ID

Definition at line 25 of file TgcRdo.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 TgcRawData** DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::pointer
inherited

Definition at line 818 of file DataVector.h.

◆ PtrVector

typedef typename DataVectorBase<TgcRawData>::Base::PtrVector DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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

typedef std::reverse_iterator<iterator> DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::reverse_iterator
inherited

Standard reverse_iterator.

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

Definition at line 852 of file DataVector.h.

◆ self

Definition at line 2063 of file DataVector.h.

◆ size_type

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

Definition at line 814 of file DataVector.h.

◆ unique_type

typedef std::unique_ptr<base_value_type> DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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

◆ TgcRdo() [1/3]

TgcRdo::TgcRdo ( )

Default constructor.

Definition at line 11 of file TgcRdo.cxx.

12{
13 m_id = 9999;
14 clear();
15}
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
void clear()
Definition TgcRdo.cxx:114
uint16_t m_id
ID of this instance.
Definition TgcRdo.h:240

◆ TgcRdo() [2/3]

TgcRdo::TgcRdo ( uint16_t id,
IdentifierHash idHash )

Creates an empty container ready for writing.

Definition at line 18 of file TgcRdo.cxx.

18 : DataVector<TgcRawData>(), m_id(id), m_idHash(idHash)
19{
20 clear();
21}
IdentifierHash m_idHash
OFFLINE hash of this collection.
Definition TgcRdo.h:243

◆ TgcRdo() [3/3]

TgcRdo::TgcRdo ( uint16_t subDetectorId,
uint16_t rodId,
uint16_t bcId,
uint16_t l1Id )

Definition at line 24 of file TgcRdo.cxx.

28{
29 clear();
30 m_bcId = bcId;
31 m_l1Id = l1Id;
32
34}
uint16_t m_bcId
Definition TgcRdo.h:253
uint16_t rodId() const
Definition TgcRdo.h:138
uint16_t l1Id() const
Definition TgcRdo.h:150
uint16_t m_l1Id
Definition TgcRdo.h:254
void setOnlineId(uint16_t subDetectorId, uint16_t rodId)
Definition TgcRdo.cxx:37
uint16_t subDetectorId() const
Definition TgcRdo.h:134
uint16_t bcId() const
Definition TgcRdo.h:146

◆ ~TgcRdo()

virtual TgcRdo::~TgcRdo ( )
inlinevirtual

Definition at line 102 of file TgcRdo.h.

103 {
104 }

Member Function Documentation

◆ assign()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::assign ( InputIterator first,
InputIterator last )
inherited

Assign from iterators.

Parameters
firstThe start of the range to put in the container.
lastThe end of the range to put in the container.

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

◆ assignBaseElement()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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()

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

Access an element, as an rvalue.

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

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

◆ auxbase()

const SG::AuxVectorBase & DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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()

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

Access the last element in the collection as an rvalue.

Returns
The last element in the collection.

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

◆ baseOffset()

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

◆ bcId()

uint16_t TgcRdo::bcId ( ) const
inline

Definition at line 146 of file TgcRdo.h.

147 {
148 return m_bcId;
149 }

◆ begin()

const_iterator DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::begin ( ) 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.

◆ calculateOnlineId()

uint16_t TgcRdo::calculateOnlineId ( uint16_t subDetectorId,
uint16_t rodId )
static

Definition at line 60 of file TgcRdo.cxx.

61{
62 int offset = -1;
63 int MAX_N_ROD = 12;
64 if ( rodId < 13 ){
65 static const std::pair<int, int> offset_max = initOnlineId();
66 offset = offset_max.first;
67 MAX_N_ROD = offset_max.second;
68 }else{
69 offset = 7; // 24-0x11
70 MAX_N_ROD = 3;
71 }
72 if (MAX_N_ROD < 0) {
73 return 9999;
74 }
75
76 // A-side or C-side ?
77 uint16_t is = (subDetectorId == 0x67) ? 0 : 1;
78
79 return is * MAX_N_ROD + rodId + offset; // 0-23 : ROD, 24-29 : SROD
80}
static std::pair< int, int > initOnlineId()
Definition TgcRdo.cxx:53
setWord1 uint16_t

◆ capacity()

size_type DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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< TgcRawData, typename DataVectorBase<TgcRawData>::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< TgcRawData, typename DataVectorBase<TgcRawData>::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()

void TgcRdo::clear ( )

Definition at line 114 of file TgcRdo.cxx.

115{
116 m_version = 300;
118 memset(&m_errors, 0, sizeof(Errors));
119 memset(&m_rodStatus, 0, sizeof(RodStatus));
120 memset(&m_localStatus, 0, sizeof(LocalStatus));
121 m_orbit = 0;
122}
uint16_t m_version
Definition TgcRdo.h:237
uint16_t m_rodId
Definition TgcRdo.h:247
uint32_t m_orbit
Definition TgcRdo.h:259
uint16_t m_subDetectorId
Definition TgcRdo.h:246
uint16_t m_triggerType
Definition TgcRdo.h:250

◆ clearMostDerived()

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

Return a const_reverse_iterator pointing at the beginning of the collection.

Returns
A const_reverse_iterator.

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

◆ do_cast()

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

TgcRawData * DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::do_cast_nc ( typename PtrVector::value_type p)
staticinherited

Helper to shorten calls to DataModel_detail::DVLCast.

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

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

◆ dv_typeid()

virtual const std::type_info & DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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< TgcRawData, typename DataVectorBase<TgcRawData>::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< TgcRawData, typename DataVectorBase<TgcRawData>::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.

◆ emplace()

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

Returns true if the collection is empty.

◆ end()

const_iterator DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::end ( ) 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.

◆ erase()

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

◆ errors()

const Errors & TgcRdo::errors ( ) const
inline

Definition at line 158 of file TgcRdo.h.

159 {
160 return m_errors;
161 }

◆ front()

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

Access the first element in the collection as an rvalue.

Returns
The first element in the collection.

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

◆ get()

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

◆ identify()

uint16_t TgcRdo::identify ( ) const
inline

Definition at line 107 of file TgcRdo.h.

108 {
109 return m_id;
110 }

◆ identifyHash()

IdentifierHash TgcRdo::identifyHash ( ) const
inline

Definition at line 113 of file TgcRdo.h.

114 {
115 return m_idHash;
116 }

◆ identifyRawData()

uint16_t TgcRdo::identifyRawData ( const TgcRawData & rawData)
static

Definition at line 47 of file TgcRdo.cxx.

48{
49 return calculateOnlineId(rawData.subDetectorId(), rawData.rodId());
50}
uint16_t subDetectorId() const
Definition TgcRawData.h:264
uint16_t rodId() const
Definition TgcRawData.h:268
static uint16_t calculateOnlineId(uint16_t subDetectorId, uint16_t rodId)
Definition TgcRdo.cxx:60

◆ initOnlineId()

std::pair< int, int > TgcRdo::initOnlineId ( )
staticprivate

Definition at line 53 of file TgcRdo.cxx.

53 {
54 static constexpr int offset = -1;
55 static constexpr int MAX_N_ROD = 12;
56 return std::make_pair (offset, MAX_N_ROD);
57}

◆ insert()

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

◆ iter_swap()

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

◆ l1Id()

uint16_t TgcRdo::l1Id ( ) const
inline

Definition at line 150 of file TgcRdo.h.

151 {
152 return m_l1Id;
153 }

◆ localStatus()

const LocalStatus & TgcRdo::localStatus ( ) const
inline

Definition at line 190 of file TgcRdo.h.

191 {
192 return m_localStatus;
193 }

◆ max_size()

size_type DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::max_size ( ) const
noexceptinherited

Returns the size() of the largest possible collection.

◆ operator[]()

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

Access an element, as an rvalue.

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

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

◆ orbit()

uint32_t TgcRdo::orbit ( ) const
inline

Definition at line 206 of file TgcRdo.h.

207 {
208 return m_orbit;
209 }

◆ ownPolicy()

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

Return the ownership policy setting for this container.

◆ pop_back()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::pop_back ( )
inherited

Remove the last element from the collection.

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

◆ push_back()

value_type DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::push_back ( value_type pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe element to add to the collection.

The container's ownership policy will determine if it takes ownership of the new element.

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

Returns the pushed pointer.

◆ push_new()

size_type DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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()

const_reverse_iterator DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::rbegin ( ) 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.

◆ rend()

const_reverse_iterator DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::rend ( ) 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.

◆ reserve()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::reserve ( size_type n)
inherited

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

Parameters
nNumber of elements required.

◆ resize()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::resize ( size_type sz)
inherited

Resizes the collection to the specified number of elements.

Parameters
szThe new size of the collection.

Note that this function differs from the standard in that it does not allow specifying the value of any inserted elements. They will always be 0.

If the container is shrunk, elements will be deleted as with erase().

◆ resortAux()

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

◆ rodId()

uint16_t TgcRdo::rodId ( ) const
inline

Definition at line 138 of file TgcRdo.h.

139 {
140 return m_rodId;
141 }

◆ rodStatus()

const RodStatus & TgcRdo::rodStatus ( ) const
inline

Definition at line 174 of file TgcRdo.h.

175 {
176 return m_rodStatus;
177 }

◆ setBcId()

void TgcRdo::setBcId ( uint16_t v)
inline

Definition at line 123 of file TgcRdo.h.

124 {
125 m_bcId = v;
126 }

◆ setErrors()

void TgcRdo::setErrors ( uint16_t data)
inline

Definition at line 162 of file TgcRdo.h.

163 {
164 // FIXME BUG: This is not portable!
165 // The layout of bitfields in a structure is implementation-defined.
166 union cnvErrors {
168 Errors errors;
169 } cnv;
170 cnv.data = data;
171 m_errors = cnv.errors;
172 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11

◆ setL1Id()

void TgcRdo::setL1Id ( uint32_t v)
inline

Definition at line 119 of file TgcRdo.h.

120 {
121 m_l1Id = v;
122 }

◆ setLocalStatus()

void TgcRdo::setLocalStatus ( uint32_t data)
inline

Definition at line 194 of file TgcRdo.h.

195 {
196 // FIXME BUG: This is not portable!
197 // The layout of bitfields in a structure is implementation-defined.
198 union cnvLocalStatus {
200 LocalStatus localStatus;
201 } cnv;
202 cnv.data = data;
203 m_localStatus = cnv.localStatus;
204 }

◆ setMostDerived()

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

◆ setOnlineId()

void TgcRdo::setOnlineId ( uint16_t subDetectorId,
uint16_t rodId )

Definition at line 37 of file TgcRdo.cxx.

38{
40 m_rodId = rodId;
41
42 // set my ID
44}

◆ setOrbit()

void TgcRdo::setOrbit ( uint32_t orbit)
inline

Definition at line 210 of file TgcRdo.h.

211 {
212 m_orbit = orbit;
213 }
uint32_t orbit() const
Definition TgcRdo.h:206

◆ setRodStatus()

void TgcRdo::setRodStatus ( uint32_t data)
inline

Definition at line 178 of file TgcRdo.h.

179 {
180 // FIXME BUG: This is not portable!
181 // The layout of bitfields in a structure is implementation-defined.
182 union cnvRodStatus {
184 RodStatus rodStatus;
185 } cnv;
186 cnv.data = data;
187 m_rodStatus = cnv.rodStatus;
188 }

◆ setTriggerType()

void TgcRdo::setTriggerType ( uint16_t v)
inline

Definition at line 127 of file TgcRdo.h.

128 {
130 }

◆ setVersion()

void TgcRdo::setVersion ( uint16_t version)
inline

Definition at line 220 of file TgcRdo.h.

221 {
223 }
uint16_t version() const
Definition TgcRdo.h:215

◆ shift()

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

◆ size()

size_type DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::sort ( )
inherited

Sort the container.

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

◆ stdcont()

const PtrVector & DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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.

◆ subDetectorId()

uint16_t TgcRdo::subDetectorId ( ) const
inline

Definition at line 134 of file TgcRdo.h.

135 {
136 return m_subDetectorId;
137 }

◆ swap()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::swap ( DataVector< TgcRawData > & 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()

void DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::Base >::swapElement ( size_type index,
value_type newElem,
reference oldElem )
inherited

Swap one element out of the container.

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

Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.

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

◆ testInsert()

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

◆ triggerType()

uint16_t TgcRdo::triggerType ( ) const
inline

Definition at line 142 of file TgcRdo.h.

143 {
144 return m_triggerType;
145 }

◆ version()

uint16_t TgcRdo::version ( ) const
inline

Definition at line 215 of file TgcRdo.h.

216 {
217 return m_version;
218 }

Member Data Documentation

◆ has_virtual

const bool DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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_bcId

uint16_t TgcRdo::m_bcId = 0U
private

Definition at line 253 of file TgcRdo.h.

◆ m_id

uint16_t TgcRdo::m_id = 0U
private

ID of this instance.

Definition at line 240 of file TgcRdo.h.

◆ m_idHash

IdentifierHash TgcRdo::m_idHash
private

OFFLINE hash of this collection.

Definition at line 243 of file TgcRdo.h.

◆ m_isMostDerived

SG::IsMostDerivedFlag DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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_l1Id

uint16_t TgcRdo::m_l1Id = 0U
private

Definition at line 254 of file TgcRdo.h.

◆ m_orbit

uint32_t TgcRdo::m_orbit = 0U
private

Definition at line 259 of file TgcRdo.h.

◆ m_rodId

uint16_t TgcRdo::m_rodId = 0U
private

Definition at line 247 of file TgcRdo.h.

◆ m_subDetectorId

uint16_t TgcRdo::m_subDetectorId = 0U
private

Definition at line 246 of file TgcRdo.h.

◆ m_triggerType

uint16_t TgcRdo::m_triggerType = 0U
private

Definition at line 250 of file TgcRdo.h.

◆ m_version

uint16_t TgcRdo::m_version = 0U
private

Definition at line 237 of file TgcRdo.h.

◆ must_own

bool DataVector< TgcRawData, typename DataVectorBase<TgcRawData>::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: