Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TDigiCollection< T > Class Template Reference

#include <G4TDigiCollection.hh>

+ Inheritance diagram for G4TDigiCollection< T >:

Public Member Functions

 G4TDigiCollection ()
 
 G4TDigiCollection (G4String detName, G4String colNam)
 
 ~G4TDigiCollection () override
 
G4bool operator== (const G4TDigiCollection &right) const
 
void * operator new (size_t)
 
void operator delete (void *aDC)
 
void DrawAllDigi () override
 
void PrintAllDigi () override
 
T * operator[] (size_t i) const
 
std::vector< T * > * GetVector () const
 
size_t insert (T *aHit)
 
size_t entries () const
 
G4VDigiGetDigi (size_t i) const override
 
size_t GetSize () const override
 
- Public Member Functions inherited from G4DigiCollection
 ~G4DigiCollection () override=default
 
G4bool operator== (const G4DigiCollection &right) const
 
 G4VDigiCollection ()=default
 
 G4VDigiCollection (G4String DMnam, G4String colNam)
 
- Public Member Functions inherited from G4VDigiCollection
 G4VDigiCollection ()=default
 
 G4VDigiCollection (G4String DMnam, G4String colNam)
 
virtual ~G4VDigiCollection ()=default
 
G4bool operator== (const G4VDigiCollection &right) const
 
const G4StringGetName () const
 
const G4StringGetDMname () const
 

Additional Inherited Members

- Protected Attributes inherited from G4DigiCollection
void * theCollection = nullptr
 
- Protected Attributes inherited from G4VDigiCollection
G4String collectionName = "Unknown"
 
G4String DMname = "Unknown"
 

Detailed Description

template<class T>
class G4TDigiCollection< T >

Definition at line 67 of file G4TDigiCollection.hh.

Constructor & Destructor Documentation

◆ G4TDigiCollection() [1/2]

template<class T >
G4TDigiCollection< T >::G4TDigiCollection ( )

Definition at line 129 of file G4TDigiCollection.hh.

130{
131 auto theDigiCollection = new std::vector<T*>;
132 theCollection = (void*)theDigiCollection;
133}

◆ G4TDigiCollection() [2/2]

template<class T >
G4TDigiCollection< T >::G4TDigiCollection ( G4String detName,
G4String colNam )

Definition at line 136 of file G4TDigiCollection.hh.

137 : G4DigiCollection(detName, colNam)
138{
139 auto theDigiCollection = new std::vector<T*>;
140 theCollection = (void*)theDigiCollection;
141}

◆ ~G4TDigiCollection()

template<class T >
G4TDigiCollection< T >::~G4TDigiCollection ( )
override

Definition at line 144 of file G4TDigiCollection.hh.

145{
146 auto theDigiCollection = (std::vector<T*>*)theCollection;
147 for (const auto* digi : *theDigiCollection) {
148 delete digi;
149 }
150 theDigiCollection->clear();
151 delete theDigiCollection;
152}

Member Function Documentation

◆ DrawAllDigi()

template<class T >
void G4TDigiCollection< T >::DrawAllDigi ( )
overridevirtual

Reimplemented from G4VDigiCollection.

Definition at line 161 of file G4TDigiCollection.hh.

162{
163 auto theDigiCollection = (std::vector<T*>*)theCollection;
164 for (auto* digi : *theDigiCollection) {
165 digi->Draw();
166 }
167}

◆ entries()

template<class T >
size_t G4TDigiCollection< T >::entries ( ) const
inline

Definition at line 102 of file G4TDigiCollection.hh.

103 {
104 auto theDigiCollection = (std::vector<T*>*)theCollection;
105 return theDigiCollection->size();
106 }

◆ GetDigi()

template<class T >
G4VDigi * G4TDigiCollection< T >::GetDigi ( size_t i) const
inlineoverridevirtual

Reimplemented from G4VDigiCollection.

Definition at line 108 of file G4TDigiCollection.hh.

108{ return (*((std::vector<T*>*)theCollection))[i]; }

◆ GetSize()

template<class T >
size_t G4TDigiCollection< T >::GetSize ( ) const
inlineoverridevirtual

Reimplemented from G4VDigiCollection.

Definition at line 110 of file G4TDigiCollection.hh.

110{ return ((std::vector<T*>*)theCollection)->size(); }

◆ GetVector()

template<class T >
std::vector< T * > * G4TDigiCollection< T >::GetVector ( ) const
inline

Definition at line 90 of file G4TDigiCollection.hh.

90{ return (std::vector<T*>*)theCollection; }

◆ insert()

template<class T >
size_t G4TDigiCollection< T >::insert ( T * aHit)
inline

Definition at line 94 of file G4TDigiCollection.hh.

95 {
96 auto theDigiCollection = (std::vector<T*>*)theCollection;
97 theDigiCollection->push_back(aHit);
98 return theDigiCollection->size();
99 }

◆ operator delete()

template<class T >
void G4TDigiCollection< T >::operator delete ( void * aDC)
inline

Definition at line 123 of file G4TDigiCollection.hh.

124{
125 aDCAllocator_G4MT_TLS_()->FreeSingle((G4DigiCollection*)aDC);
126}
G4DLLIMPORT G4Allocator< G4DigiCollection > *& aDCAllocator_G4MT_TLS_()

◆ operator new()

template<class T >
void * G4TDigiCollection< T >::operator new ( size_t )
inline

Definition at line 114 of file G4TDigiCollection.hh.

115{
116 if (aDCAllocator_G4MT_TLS_() == nullptr) {
118 }
119 return (void*)aDCAllocator_G4MT_TLS_()->MallocSingle();
120}

◆ operator==()

template<class T >
G4bool G4TDigiCollection< T >::operator== ( const G4TDigiCollection< T > & right) const

Definition at line 155 of file G4TDigiCollection.hh.

156{
157 return (collectionName == right.collectionName);
158}

◆ operator[]()

template<class T >
T * G4TDigiCollection< T >::operator[] ( size_t i) const
inline

Definition at line 87 of file G4TDigiCollection.hh.

87{ return (*((std::vector<T*>*)theCollection))[i]; }

◆ PrintAllDigi()

template<class T >
void G4TDigiCollection< T >::PrintAllDigi ( )
overridevirtual

Reimplemented from G4VDigiCollection.

Definition at line 170 of file G4TDigiCollection.hh.

171{
172 auto theDigiCollection = (std::vector<T*>*)theCollection;
173 for (auto* digi : *theDigiCollection) {
174 digi->Print();
175 }
176}

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