Geant4 10.7.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 ()
 
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 65 of file G4TDigiCollection.hh.

Constructor & Destructor Documentation

◆ G4TDigiCollection() [1/2]

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

Definition at line 146 of file G4TDigiCollection.hh.

147{
149 std::vector<T*> * theDigiCollection = new std::vector<T*>;
150 theCollection = (void*)theDigiCollection;
151}
G4DLLIMPORT G4Allocator< G4DigiCollection > *& aDCAllocator_G4MT_TLS_()

◆ G4TDigiCollection() [2/2]

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

Definition at line 153 of file G4TDigiCollection.hh.

154: G4DigiCollection(detName,colNam)
155{
157
158 std::vector<T*> * theDigiCollection = new std::vector<T*>;
159 theCollection = (void*)theDigiCollection;
160}

◆ ~G4TDigiCollection()

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

Definition at line 162 of file G4TDigiCollection.hh.

163{
165 std::vector<T*> * theDigiCollection = (std::vector<T*>*)theCollection;
166 //theDigiCollection->clearAndDestroy();
167 for(size_t i=0;i<theDigiCollection->size();i++)
168 { delete (*theDigiCollection)[i]; }
169 theDigiCollection->clear();
170 delete theDigiCollection;
171}

Member Function Documentation

◆ DrawAllDigi()

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

Reimplemented from G4VDigiCollection.

Definition at line 179 of file G4TDigiCollection.hh.

180{
182 std::vector<T*> * theDigiCollection = (std::vector<T*>*)theCollection;
183 size_t n = theDigiCollection->size();
184 for(size_t i=0;i<n;i++)
185 { (*theDigiCollection)[i]->Draw(); }
186}

◆ entries()

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

Definition at line 107 of file G4TDigiCollection.hh.

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

◆ GetDigi()

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

Reimplemented from G4VDigiCollection.

Definition at line 117 of file G4TDigiCollection.hh.

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

◆ GetSize()

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

Reimplemented from G4VDigiCollection.

Definition at line 122 of file G4TDigiCollection.hh.

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

◆ GetVector()

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

Definition at line 91 of file G4TDigiCollection.hh.

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

◆ insert()

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

Definition at line 97 of file G4TDigiCollection.hh.

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

◆ operator delete()

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

Definition at line 139 of file G4TDigiCollection.hh.

◆ operator new()

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

Definition at line 130 of file G4TDigiCollection.hh.

131{
134 void* aDC;
135 aDC = (void*)aDCAllocator.MallocSingle();
136 return aDC;
137}
Type * MallocSingle()
Definition: G4Allocator.hh:196

◆ operator==()

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

Definition at line 173 of file G4TDigiCollection.hh.

◆ operator[]()

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

Definition at line 85 of file G4TDigiCollection.hh.

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

◆ PrintAllDigi()

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

Reimplemented from G4VDigiCollection.

Definition at line 188 of file G4TDigiCollection.hh.

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

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