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

Additional Inherited Members

- Protected Attributes inherited from G4DigiCollection
void * theCollection
 
- Protected Attributes inherited from G4VDigiCollection
G4String collectionName
 
G4String DMname
 

Detailed Description

template<class T>
class G4TDigiCollection< T >

Definition at line 66 of file G4TDigiCollection.hh.

Constructor & Destructor Documentation

◆ G4TDigiCollection() [1/2]

template<class T >
G4TDigiCollection< T >::G4TDigiCollection

Definition at line 141 of file G4TDigiCollection.hh.

142{
143 std::vector<T*>* theDigiCollection = new std::vector<T*>;
144 theCollection = (void*) theDigiCollection;
145}

◆ G4TDigiCollection() [2/2]

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

Definition at line 148 of file G4TDigiCollection.hh.

149 : G4DigiCollection(detName, colNam)
150{
151 std::vector<T*>* theDigiCollection = new std::vector<T*>;
152 theCollection = (void*) theDigiCollection;
153}

◆ ~G4TDigiCollection()

template<class T >
G4TDigiCollection< T >::~G4TDigiCollection
virtual

Definition at line 156 of file G4TDigiCollection.hh.

157{
158 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
159
160 for(size_t i = 0; i < theDigiCollection->size(); i++)
161 {
162 delete(*theDigiCollection)[i];
163 }
164 theDigiCollection->clear();
165 delete theDigiCollection;
166}

Member Function Documentation

◆ DrawAllDigi()

template<class T >
void G4TDigiCollection< T >::DrawAllDigi
virtual

Reimplemented from G4VDigiCollection.

Definition at line 175 of file G4TDigiCollection.hh.

176{
177 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
178 size_t n = theDigiCollection->size();
179 for(size_t i = 0; i < n; i++)
180 {
181 (*theDigiCollection)[i]->Draw();
182 }
183}

◆ entries()

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

Definition at line 106 of file G4TDigiCollection.hh.

107 {
108 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
109 return theDigiCollection->size();
110 }

◆ GetDigi()

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

Reimplemented from G4VDigiCollection.

Definition at line 114 of file G4TDigiCollection.hh.

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

◆ GetSize()

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

Reimplemented from G4VDigiCollection.

Definition at line 118 of file G4TDigiCollection.hh.

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

◆ GetVector()

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

Definition at line 93 of file G4TDigiCollection.hh.

94 {
95 return (std::vector<T*>*) theCollection;
96 }

◆ insert()

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

Definition at line 98 of file G4TDigiCollection.hh.

99 {
100 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
101 theDigiCollection->push_back(aHit);
102 return theDigiCollection->size();
103 }

◆ operator delete()

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

Definition at line 135 of file G4TDigiCollection.hh.

136{
137 aDCAllocator_G4MT_TLS_()->FreeSingle((G4DigiCollection*) aDC);
138}
G4DLLIMPORT G4Allocator< G4DigiCollection > *& aDCAllocator_G4MT_TLS_()

◆ operator new()

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

Definition at line 125 of file G4TDigiCollection.hh.

126{
127 if(aDCAllocator_G4MT_TLS_() == nullptr)
128 {
130 }
131 return (void*) aDCAllocator_G4MT_TLS_()->MallocSingle();
132}

◆ operator==()

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

Definition at line 169 of file G4TDigiCollection.hh.

170{
171 return (collectionName == right.collectionName);
172}

◆ operator[]()

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

Definition at line 88 of file G4TDigiCollection.hh.

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

◆ PrintAllDigi()

template<class T >
void G4TDigiCollection< T >::PrintAllDigi
virtual

Reimplemented from G4VDigiCollection.

Definition at line 186 of file G4TDigiCollection.hh.

187{
188 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
189 size_t n = theDigiCollection->size();
190 for(size_t i = 0; i < n; i++)
191 {
192 (*theDigiCollection)[i]->Print();
193 }
194}

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