Geant4 9.6.0
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 ()
 
G4int 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
 
G4int insert (T *aHit)
 
G4int 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 ()
 
G4int operator== (const G4DigiCollection &right) const
 
- Public Member Functions inherited from G4VDigiCollection
 G4VDigiCollection ()
 
 G4VDigiCollection (G4String DMnam, G4String colNam)
 
virtual ~G4VDigiCollection ()
 
G4int operator== (const G4VDigiCollection &right) const
 
virtual void DrawAllDigi ()
 
virtual void PrintAllDigi ()
 
G4String GetName ()
 
G4String GetDMname ()
 
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 129 of file G4TDigiCollection.hh.

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

◆ 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 std::vector<T*> * theDigiCollection
140 = new std::vector<T*>;
141 theCollection = (void*)theDigiCollection;
142}

◆ ~G4TDigiCollection()

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

Definition at line 144 of file G4TDigiCollection.hh.

145{
146 std::vector<T*> * theDigiCollection
147 = (std::vector<T*>*)theCollection;
148 //theDigiCollection->clearAndDestroy();
149 for(size_t i=0;i<theDigiCollection->size();i++)
150 { delete (*theDigiCollection)[i]; }
151 theDigiCollection->clear();
152 delete theDigiCollection;
153}

Member Function Documentation

◆ DrawAllDigi()

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

Reimplemented from G4VDigiCollection.

Definition at line 158 of file G4TDigiCollection.hh.

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

◆ entries()

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

Definition at line 101 of file G4TDigiCollection.hh.

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

◆ GetDigi()

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

Reimplemented from G4VDigiCollection.

Definition at line 110 of file G4TDigiCollection.hh.

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

◆ GetSize()

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

Reimplemented from G4VDigiCollection.

Definition at line 112 of file G4TDigiCollection.hh.

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

◆ GetVector()

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

Definition at line 89 of file G4TDigiCollection.hh.

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

◆ insert()

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

Definition at line 92 of file G4TDigiCollection.hh.

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

◆ operator delete()

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

Definition at line 124 of file G4TDigiCollection.hh.

125{
126 aDCAllocator.FreeSingle((G4DigiCollection*)aDC);
127}
G4DLLIMPORT G4Allocator< G4DigiCollection > aDCAllocator

◆ operator new()

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

Definition at line 117 of file G4TDigiCollection.hh.

118{
119 void* aDC;
120 aDC = (void*)aDCAllocator.MallocSingle();
121 return aDC;
122}

◆ operator==()

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

Definition at line 155 of file G4TDigiCollection.hh.

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

◆ operator[]()

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

Definition at line 86 of file G4TDigiCollection.hh.

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

◆ PrintAllDigi()

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

Reimplemented from G4VDigiCollection.

Definition at line 167 of file G4TDigiCollection.hh.

168{
169 std::vector<T*> * theDigiCollection
170 = (std::vector<T*>*)theCollection;
171 size_t n = theDigiCollection->size();
172 for(size_t i=0;i<n;i++)
173 { (*theDigiCollection)[i]->Print(); }
174}

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