ATLAS Offline Software
Loading...
Searching...
No Matches
TileHitVectorCellBuilder< NCells > Class Template Reference

Event-owned TileHit accumulator for SDs that merge one TileSimHit per cell. More...

#include <TileHitVectorCellBuilder.h>

Inheritance diagram for TileHitVectorCellBuilder< NCells >:
Collaboration diagram for TileHitVectorCellBuilder< NCells >:

Public Types

typedef TileHit base_value_type
typedef std::vector< TileHitCONT
typedef CONT::value_type value_type
typedef CONT::pointer pointer
typedef CONT::const_pointer const_pointer
typedef CONT::iterator iterator
typedef CONT::const_iterator const_iterator
typedef CONT::reference reference
typedef CONT::const_reference const_reference
typedef CONT::size_type size_type
typedef CONT::difference_type difference_type

Public Member Functions

 TileHitVectorCellBuilder (const std::string &collectionName)
bool HasHit (std::size_t index) const
void AddHit (std::size_t index, Identifier id, double energy, double time=0.0, double deltaT=0.0)
void Finalize ()
void Clear ()
void Insert (const TileHit &h)
void Insert (TileHit &&h)
void Emplace (Args &&... args)
int Size () const
const std::string & Name () const
void setName (const std::string &name)
const std::vector< TileHit > & getVector () const
bool empty () const
const_iterator begin () const
iterator begin ()
const_iterator end () const
iterator end ()
size_type size () const
void push_back (const TileHit &t)
TileHit At (unsigned int pos) const
const TileHit operator[] (size_type n) const
void clear ()
void reserve (size_type n)
void resize (size_type n)

Static Public Member Functions

static const std::type_info * initHelper ()

Static Public Attributes

static const std::type_info *const s_info

Protected Attributes

std::string m_name
std::vector< TileHitm_hitvector

Private Attributes

std::array< std::unique_ptr< TileSimHit >, NCells > m_hits {}

Detailed Description

template<std::size_t NCells>
class TileHitVectorCellBuilder< NCells >

Event-owned TileHit accumulator for SDs that merge one TileSimHit per cell.

The sensitive detector is owned by Geant4, so per-Athena-event merge state should live in the hit collection. Finalization is intentionally delayed until Gather to support multiple G4Events per Athena event and to preserve the legacy output ordering: one merged TileHit per cell, in cell-index order.

Definition at line 25 of file TileHitVectorCellBuilder.h.

Member Typedef Documentation

◆ base_value_type

typedef TileHit AtlasHitsVector< TileHit >::base_value_type
inherited

Definition at line 36 of file AtlasHitsVector.h.

◆ const_iterator

typedef CONT::const_iterator AtlasHitsVector< TileHit >::const_iterator
inherited

Definition at line 42 of file AtlasHitsVector.h.

◆ const_pointer

typedef CONT::const_pointer AtlasHitsVector< TileHit >::const_pointer
inherited

Definition at line 40 of file AtlasHitsVector.h.

◆ const_reference

typedef CONT::const_reference AtlasHitsVector< TileHit >::const_reference
inherited

Definition at line 44 of file AtlasHitsVector.h.

◆ CONT

typedef std::vector<TileHit> AtlasHitsVector< TileHit >::CONT
inherited

Definition at line 37 of file AtlasHitsVector.h.

◆ difference_type

typedef CONT::difference_type AtlasHitsVector< TileHit >::difference_type
inherited

Definition at line 46 of file AtlasHitsVector.h.

◆ iterator

typedef CONT::iterator AtlasHitsVector< TileHit >::iterator
inherited

Definition at line 41 of file AtlasHitsVector.h.

◆ pointer

typedef CONT::pointer AtlasHitsVector< TileHit >::pointer
inherited

Definition at line 39 of file AtlasHitsVector.h.

◆ reference

typedef CONT::reference AtlasHitsVector< TileHit >::reference
inherited

Definition at line 43 of file AtlasHitsVector.h.

◆ size_type

typedef CONT::size_type AtlasHitsVector< TileHit >::size_type
inherited

Definition at line 45 of file AtlasHitsVector.h.

◆ value_type

typedef CONT::value_type AtlasHitsVector< TileHit >::value_type
inherited

Definition at line 38 of file AtlasHitsVector.h.

Constructor & Destructor Documentation

◆ TileHitVectorCellBuilder()

template<std::size_t NCells>
TileHitVectorCellBuilder< NCells >::TileHitVectorCellBuilder ( const std::string & collectionName)
inlineexplicit

Definition at line 28 of file TileHitVectorCellBuilder.h.

30 {}
AtlasHitsVector< TileHit > TileHitVector
Event-owned TileHit accumulator for SDs that merge one TileSimHit per cell.

Member Function Documentation

◆ AddHit()

template<std::size_t NCells>
void TileHitVectorCellBuilder< NCells >::AddHit ( std::size_t index,
Identifier id,
double energy,
double time = 0.0,
double deltaT = 0.0 )
inline

Definition at line 34 of file TileHitVectorCellBuilder.h.

35 {
36 if (m_hits[index]) {
37 m_hits[index]->add(energy, time, deltaT);
38 } else {
40 }
41 }
std::array< std::unique_ptr< TileSimHit >, NCells > m_hits

◆ At()

TileHit AtlasHitsVector< TileHit >::At ( unsigned int pos) const
inlineinherited

Definition at line 146 of file AtlasHitsVector.h.

146 {
147 return m_hitvector.at(pos);
148 }
std::vector< TileHit > m_hitvector

◆ begin() [1/2]

iterator AtlasHitsVector< TileHit >::begin ( )
inlineinherited

Definition at line 136 of file AtlasHitsVector.h.

137 { return m_hitvector.begin(); }

◆ begin() [2/2]

const_iterator AtlasHitsVector< TileHit >::begin ( ) const
inlineinherited

Definition at line 130 of file AtlasHitsVector.h.

131 { return m_hitvector.begin(); }

◆ Clear()

void AtlasHitsVector< TileHit >::Clear ( )
inlineinherited

Definition at line 66 of file AtlasHitsVector.h.

67 {
68 m_hitvector.clear();
70 }

◆ clear()

void AtlasHitsVector< TileHit >::clear ( )
inlineinherited

Definition at line 152 of file AtlasHitsVector.h.

152 {
153 m_hitvector.clear();
155 }

◆ Emplace()

void AtlasHitsVector< TileHit >::Emplace ( Args &&... args)
inlineinherited

Definition at line 80 of file AtlasHitsVector.h.

81 {
82 m_hitvector.emplace_back( std::forward<Args>(args)... );
83 }

◆ empty()

bool AtlasHitsVector< TileHit >::empty ( ) const
inlineinherited

Definition at line 128 of file AtlasHitsVector.h.

128{ return m_hitvector.empty(); }

◆ end() [1/2]

iterator AtlasHitsVector< TileHit >::end ( )
inlineinherited

Definition at line 139 of file AtlasHitsVector.h.

140 { return m_hitvector.end(); }

◆ end() [2/2]

const_iterator AtlasHitsVector< TileHit >::end ( ) const
inlineinherited

Definition at line 133 of file AtlasHitsVector.h.

134 { return m_hitvector.end(); }

◆ Finalize()

template<std::size_t NCells>
void TileHitVectorCellBuilder< NCells >::Finalize ( )
inline

Definition at line 43 of file TileHitVectorCellBuilder.h.

44 {
45 for (std::size_t index = 0; index < NCells; ++index) {
46 if (m_hits[index]) {
48 m_hits[index].reset();
49 }
50 }
51 }
void Insert(const TileHit &h)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132

◆ getVector()

const std::vector< TileHit > & AtlasHitsVector< TileHit >::getVector ( ) const
inlineinherited

Definition at line 126 of file AtlasHitsVector.h.

126{return m_hitvector;}

◆ HasHit()

template<std::size_t NCells>
bool TileHitVectorCellBuilder< NCells >::HasHit ( std::size_t index) const
inline

Definition at line 32 of file TileHitVectorCellBuilder.h.

32{ return m_hits[index] != nullptr; }

◆ initHelper()

const std::type_info * AtlasHitsVector< TileHit >::initHelper ( )
inlinestaticinherited

Definition at line 170 of file AtlasHitsVector.h.

◆ Insert() [1/2]

void AtlasHitsVector< TileHit >::Insert ( const TileHit & h)
inlineinherited

Definition at line 72 of file AtlasHitsVector.h.

73 {
74 m_hitvector.push_back(h);
75 }

◆ Insert() [2/2]

void AtlasHitsVector< TileHit >::Insert ( TileHit && h)
inlineinherited

Definition at line 76 of file AtlasHitsVector.h.

77 {
78 m_hitvector.push_back( std::move(h) );
79 }

◆ Name()

const std::string & AtlasHitsVector< TileHit >::Name ( ) const
inlineinherited

Definition at line 121 of file AtlasHitsVector.h.

121{return m_name;}

◆ operator[]()

const TileHit AtlasHitsVector< TileHit >::operator[] ( size_type n) const
inlineinherited

Definition at line 150 of file AtlasHitsVector.h.

150{return m_hitvector[n];}

◆ push_back()

void AtlasHitsVector< TileHit >::push_back ( const TileHit & t)
inlineinherited

Definition at line 144 of file AtlasHitsVector.h.

144{ m_hitvector.push_back(t);}

◆ reserve()

void AtlasHitsVector< TileHit >::reserve ( size_type n)
inlineinherited

Definition at line 157 of file AtlasHitsVector.h.

157{ m_hitvector.reserve (n); }

◆ resize()

void AtlasHitsVector< TileHit >::resize ( size_type n)
inlineinherited

Definition at line 159 of file AtlasHitsVector.h.

159{ m_hitvector.resize (n); }

◆ setName()

void AtlasHitsVector< TileHit >::setName ( const std::string & name)
inlineinherited

Definition at line 123 of file AtlasHitsVector.h.

123{m_name = name;}

◆ Size()

int AtlasHitsVector< TileHit >::Size ( ) const
inlineinherited

Definition at line 84 of file AtlasHitsVector.h.

85 {
86 return size();
87 }

◆ size()

size_type AtlasHitsVector< TileHit >::size ( ) const
inlineinherited

Definition at line 142 of file AtlasHitsVector.h.

142{ return m_hitvector.size(); }

Member Data Documentation

◆ m_hits

template<std::size_t NCells>
std::array<std::unique_ptr<TileSimHit>, NCells> TileHitVectorCellBuilder< NCells >::m_hits {}
private

Definition at line 54 of file TileHitVectorCellBuilder.h.

54{};

◆ m_hitvector

std::vector<TileHit> AtlasHitsVector< TileHit >::m_hitvector
protectedinherited

Definition at line 164 of file AtlasHitsVector.h.

◆ m_name

std::string AtlasHitsVector< TileHit >::m_name
protectedinherited

Definition at line 163 of file AtlasHitsVector.h.

◆ s_info

const std::type_info* const AtlasHitsVector< TileHit >::s_info
staticinherited

Definition at line 172 of file AtlasHitsVector.h.


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