Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4HCofThisEvent Class Reference

#include <G4HCofThisEvent.hh>

Public Member Functions

 G4HCofThisEvent ()
 
 G4HCofThisEvent (G4int cap)
 
 ~G4HCofThisEvent ()
 
voidoperator new (size_t)
 
void operator delete (void *anHCoTE)
 
void AddHitsCollection (G4int HCID, G4VHitsCollection *aHC)
 
 G4HCofThisEvent (const G4HCofThisEvent &)
 
G4HCofThisEventoperator= (const G4HCofThisEvent &)
 
G4VHitsCollectionGetHC (G4int i)
 
G4int GetNumberOfCollections ()
 
G4int GetCapacity ()
 

Detailed Description

Definition at line 49 of file G4HCofThisEvent.hh.

Constructor & Destructor Documentation

G4HCofThisEvent::G4HCofThisEvent ( )

Definition at line 34 of file G4HCofThisEvent.cc.

36  HC = new std::vector<G4VHitsCollection*>;
37 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_
G4HCofThisEvent::G4HCofThisEvent ( G4int  cap)

Definition at line 39 of file G4HCofThisEvent.cc.

41  HC = new std::vector<G4VHitsCollection*>;
42  for(G4int i=0;i<cap;i++)
43  {
44  HC->push_back((G4VHitsCollection*)0);
45  }
46 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_
int G4int
Definition: G4Types.hh:78
G4HCofThisEvent::~G4HCofThisEvent ( )

Definition at line 48 of file G4HCofThisEvent.cc.

50  //HC->clearAndDestroy();
51  for(size_t i=0;i<HC->size();i++)
52  { delete (*HC)[i]; }
53  HC->clear();
54  delete HC;
55 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_
G4HCofThisEvent::G4HCofThisEvent ( const G4HCofThisEvent rhs)

Definition at line 67 of file G4HCofThisEvent.cc.

68 {
70  HC = new std::vector<G4VHitsCollection*>(rhs.HC->size());
71  for ( unsigned int i = 0 ; i<rhs.HC->size() ; ++i)
72  *(HC->at(i)) = *(rhs.HC->at(i));
73 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_

Member Function Documentation

void G4HCofThisEvent::AddHitsCollection ( G4int  HCID,
G4VHitsCollection aHC 
)

Definition at line 57 of file G4HCofThisEvent.cc.

59  if(HCID>=0 && HCID<G4int(HC->size()))
60  {
61  aHC->SetColID(HCID);
62  (*HC)[HCID] = aHC;
63  }
64 }
void SetColID(G4int i)
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_
int G4int
Definition: G4Types.hh:78

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4HCofThisEvent::GetCapacity ( )
inline

Definition at line 85 of file G4HCofThisEvent.hh.

86  {
87  return HC->size();
88  }

Here is the caller graph for this function:

G4VHitsCollection* G4HCofThisEvent::GetHC ( G4int  i)
inline

Definition at line 66 of file G4HCofThisEvent.hh.

67  { return (*HC)[i]; }

Here is the caller graph for this function:

G4int G4HCofThisEvent::GetNumberOfCollections ( )
inline

Definition at line 73 of file G4HCofThisEvent.hh.

74  {
75  G4int n = 0;
76  for(size_t i=0;i<HC->size();i++)
77  {
78  if((*HC)[i]) n++;
79  }
80  return n;
81  }
int G4int
Definition: G4Types.hh:78
void G4HCofThisEvent::operator delete ( void anHCoTE)
inline

Definition at line 104 of file G4HCofThisEvent.hh.

106  anHCoTHAllocator.FreeSingle((G4HCofThisEvent*)anHCoTH);
107 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:212

Here is the call graph for this function:

void * G4HCofThisEvent::operator new ( size_t  )
inline

Definition at line 97 of file G4HCofThisEvent.hh.

99  void* anHCoTH;
100  anHCoTH = (void*)anHCoTHAllocator.MallocSingle();
101  return anHCoTH;
102 }
Type * MallocSingle()
Definition: G4Allocator.hh:202
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_

Here is the call graph for this function:

G4HCofThisEvent & G4HCofThisEvent::operator= ( const G4HCofThisEvent rhs)

Definition at line 75 of file G4HCofThisEvent.cc.

76 {
77  if ( this == &rhs ) return *this;
79  for ( std::vector<G4VHitsCollection*>::const_iterator it = HC->begin() ;
80  it != HC->end() ; ++it )
81  {
82  delete *it;
83  }
84  HC->resize(rhs.HC->size());
85  for ( unsigned int i = 0 ; i<rhs.HC->size() ; ++i)
86  *(HC->at(i)) = *(rhs.HC->at(i));
87  return *this;
88 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4HCofThisEvent > * anHCoTHAllocator_G4MT_TLS_

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