LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
G4THitsCollection< T > Class Template Reference

#include "G4THitsCollection.hh"

Inheritance diagram for G4THitsCollection< T >:
G4HitsCollection G4HitsCollection G4VHitsCollection G4VHitsCollection G4VHitsCollection G4VHitsCollection ShadowedMarshaledG4THitsCollection< T > ShadowedMarshaledG4THitsCollection< T >

Public Member Functions

 G4THitsCollection ()
 
 G4THitsCollection (G4String detName, G4String colNam)
 
virtual ~G4THitsCollection ()
 
G4bool operator== (const G4THitsCollection< T > &right) const
 
void * operator new (size_t)
 
void operator delete (void *anHC)
 
virtual void DrawAllHits ()
 
virtual void PrintAllHits ()
 
T * operator[] (size_t i) const
 
std::vector< T * > * GetVector () const
 
G4int insert (T *aHit)
 
G4int entries () const
 
virtual G4VHit * GetHit (size_t i) const
 
virtual size_t GetSize () const
 
 G4THitsCollection ()
 
 G4THitsCollection (G4String detName, G4String colNam)
 
virtual ~G4THitsCollection ()
 
G4bool operator== (const G4THitsCollection< T > &right) const
 
void * operator new (size_t)
 
void operator delete (void *anHC)
 
virtual void DrawAllHits ()
 
virtual void PrintAllHits ()
 
T * operator[] (size_t i) const
 
std::vector< T * > * GetVector () const
 
G4int insert (T *aHit)
 
G4int entries () const
 
virtual G4VHit * GetHit (size_t i) const
 
virtual size_t GetSize () const
 
G4bool operator== (const G4HitsCollection &right) const
 
G4bool operator== (const G4VHitsCollection &right) const
 
G4String GetName ()
 
G4String GetName ()
 
G4String GetSDname ()
 
G4String GetSDname ()
 

Protected Attributes

void * theCollection
 
G4String collectionName
 
G4String SDname
 

Detailed Description

template<class T>
class G4THitsCollection< T >

Definition at line 78 of file G4THitsCollection.hh.

Constructor & Destructor Documentation

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

Definition at line 144 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

Referenced by G4THitsCollection< T >::GetSize().

145 {
146  std::vector<T*> * theHitsCollection
147  = new std::vector<T*>;
148  theCollection = (void*)theHitsCollection;
149 }
template<class T >
G4THitsCollection< T >::G4THitsCollection ( G4String  detName,
G4String  colNam 
)

Definition at line 151 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

152 : G4HitsCollection(detName,colNam)
153 {
154  std::vector<T*> * theHitsCollection
155  = new std::vector<T*>;
156  theCollection = (void*)theHitsCollection;
157 }
template<class T >
G4THitsCollection< T >::~G4THitsCollection ( )
virtual

Definition at line 159 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

Referenced by G4THitsCollection< T >::GetSize().

160 {
161  std::vector<T*> * theHitsCollection
162  = (std::vector<T*>*)theCollection;
163  //theHitsCollection->clearAndDestroy();
164  for(size_t i=0;i<theHitsCollection->size();i++)
165  { delete (*theHitsCollection)[i]; }
166  theHitsCollection->clear();
167  delete theHitsCollection;
168 }
template<class T>
G4THitsCollection< T >::G4THitsCollection ( )
template<class T>
G4THitsCollection< T >::G4THitsCollection ( G4String  detName,
G4String  colNam 
)
template<class T>
virtual G4THitsCollection< T >::~G4THitsCollection ( )
virtual

Member Function Documentation

template<class T >
void G4THitsCollection< T >::DrawAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

Definition at line 173 of file G4THitsCollection.hh.

References n, and G4HitsCollection::theCollection.

Referenced by G4THitsCollection< T >::GetSize().

174 {
175  std::vector<T*> * theHitsCollection
176  = (std::vector<T*>*)theCollection;
177  size_t n = theHitsCollection->size();
178  for(size_t i=0;i<n;i++)
179  { (*theHitsCollection)[i]->Draw(); }
180 }
Char_t n[5]
template<class T>
virtual void G4THitsCollection< T >::DrawAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

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

Definition at line 113 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

114  {
115  std::vector<T*>*theHitsCollection
116  = (std::vector<T*>*)theCollection;
117  return theHitsCollection->size();
118  }
template<class T>
G4int G4THitsCollection< T >::entries ( ) const
inline

Definition at line 146 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

147  {
148  std::vector<T*>*theHitsCollection
149  = (std::vector<T*>*)theCollection;
150  return theHitsCollection->size();
151  }
template<class T>
virtual G4VHit* G4THitsCollection< T >::GetHit ( size_t  i) const
inlinevirtual

Reimplemented from G4VHitsCollection.

Definition at line 122 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

123  { return (*((std::vector<T*>*)theCollection))[i]; }
template<class T>
virtual G4VHit* G4THitsCollection< T >::GetHit ( size_t  i) const
inlinevirtual

Reimplemented from G4VHitsCollection.

Definition at line 155 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

156  { return (*((std::vector<T*>*)theCollection))[i]; }
G4String G4VHitsCollection::GetName ( )
inlineinherited
G4String G4VHitsCollection::GetName ( )
inlineinherited

Definition at line 77 of file G4VHitsCollection.hh.

References G4VHitsCollection::collectionName.

78  { return collectionName; }
G4String G4VHitsCollection::GetSDname ( )
inlineinherited

Definition at line 77 of file G4VHitsCollection.hh.

References G4VHitsCollection::SDname.

Referenced by MarshaledG4VHitsCollection::marshal2().

78  { return SDname; }
G4String G4VHitsCollection::GetSDname ( )
inlineinherited

Definition at line 79 of file G4VHitsCollection.hh.

References G4VHitsCollection::SDname.

80  { return SDname; }
template<class T>
virtual size_t G4THitsCollection< T >::GetSize ( ) const
inlinevirtual

Reimplemented from G4VHitsCollection.

Definition at line 124 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

125  { return ((std::vector<T*>*)theCollection)->size(); }
template<class T>
std::vector<T*>* G4THitsCollection< T >::GetVector ( ) const
inline

Definition at line 101 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

102  { return (std::vector<T*>*)theCollection; }
template<class T>
std::vector<T*>* G4THitsCollection< T >::GetVector ( ) const
inline

Definition at line 134 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

135  { return (std::vector<T*>*)theCollection; }
template<class T>
G4int G4THitsCollection< T >::insert ( T *  aHit)
inline

Definition at line 104 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

105  {
106  std::vector<T*>*theHitsCollection
107  = (std::vector<T*>*)theCollection;
108  theHitsCollection->push_back(aHit);
109  return theHitsCollection->size();
110  }
template<class T>
G4int G4THitsCollection< T >::insert ( T *  aHit)
inline

Definition at line 137 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

138  {
139  std::vector<T*>*theHitsCollection
140  = (std::vector<T*>*)theCollection;
141  theHitsCollection->push_back(aHit);
142  return theHitsCollection->size();
143  }
template<class T >
void G4THitsCollection< T >::operator delete ( void *  anHC)
inline

Definition at line 139 of file G4THitsCollection.hh.

References anHCAllocator.

140 {
141  anHCAllocator.FreeSingle((G4HitsCollection*)anHC);
142 }
G4DLLIMPORT G4Allocator< G4HitsCollection > anHCAllocator
template<class T>
void G4THitsCollection< T >::operator delete ( void *  anHC)
inline
template<class T >
void * G4THitsCollection< T >::operator new ( size_t  )
inline

Definition at line 132 of file G4THitsCollection.hh.

References anHCAllocator.

133 {
134  void* anHC;
135  anHC = (void*)anHCAllocator.MallocSingle();
136  return anHC;
137 }
G4DLLIMPORT G4Allocator< G4HitsCollection > anHCAllocator
template<class T>
void* G4THitsCollection< T >::operator new ( size_t  )
inline
G4bool G4VHitsCollection::operator== ( const G4VHitsCollection right) const
inherited
G4bool G4HitsCollection::operator== ( const G4HitsCollection right) const
inherited
template<class T >
G4bool G4THitsCollection< T >::operator== ( const G4THitsCollection< T > &  right) const

Definition at line 170 of file G4THitsCollection.hh.

References G4VHitsCollection::collectionName.

Referenced by G4THitsCollection< T >::GetSize().

171 { return (collectionName==right.collectionName); }
template<class T>
G4bool G4THitsCollection< T >::operator== ( const G4THitsCollection< T > &  right) const
template<class T>
T* G4THitsCollection< T >::operator[] ( size_t  i) const
inline

Definition at line 98 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

99  { return (*((std::vector<T*>*)theCollection))[i]; }
template<class T>
T* G4THitsCollection< T >::operator[] ( size_t  i) const
inline

Definition at line 131 of file G4THitsCollection.hh.

References G4HitsCollection::theCollection.

132  { return (*((std::vector<T*>*)theCollection))[i]; }
template<class T >
void G4THitsCollection< T >::PrintAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

Definition at line 182 of file G4THitsCollection.hh.

References n, and G4HitsCollection::theCollection.

Referenced by G4THitsCollection< T >::GetSize().

183 {
184  std::vector<T*> * theHitsCollection
185  = (std::vector<T*>*)theCollection;
186  size_t n = theHitsCollection->size();
187  for(size_t i=0;i<n;i++)
188  { (*theHitsCollection)[i]->Print(); }
189 }
Char_t n[5]
template<class T>
virtual void G4THitsCollection< T >::PrintAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

Member Data Documentation

G4String G4VHitsCollection::SDname
protectedinherited

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