Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HCofThisEvent Class Reference

#include <G4HCofThisEvent.hh>

Public Member Functions

 G4HCofThisEvent ()
 
 G4HCofThisEvent (G4int cap)
 
 ~G4HCofThisEvent ()
 
void * operator 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 ()
 
size_t GetCapacity ()
 

Detailed Description

Definition at line 48 of file G4HCofThisEvent.hh.

Constructor & Destructor Documentation

◆ G4HCofThisEvent() [1/3]

G4HCofThisEvent::G4HCofThisEvent ( )

Definition at line 37 of file G4HCofThisEvent.cc.

39 HC = new std::vector<G4VHitsCollection*>;
40}
G4DLLIMPORT G4Allocator< G4HCofThisEvent > *& anHCoTHAllocator_G4MT_TLS_()

◆ G4HCofThisEvent() [2/3]

G4HCofThisEvent::G4HCofThisEvent ( G4int  cap)

Definition at line 42 of file G4HCofThisEvent.cc.

44 HC = new std::vector<G4VHitsCollection*>;
45 for(G4int i=0;i<cap;i++)
46 {
47 HC->push_back((G4VHitsCollection*)0);
48 }
49}
int G4int
Definition: G4Types.hh:85

◆ ~G4HCofThisEvent()

G4HCofThisEvent::~G4HCofThisEvent ( )

Definition at line 51 of file G4HCofThisEvent.cc.

53 //HC->clearAndDestroy();
54 for(size_t i=0;i<HC->size();i++)
55 { delete (*HC)[i]; }
56 HC->clear();
57 delete HC;
58}

◆ G4HCofThisEvent() [3/3]

G4HCofThisEvent::G4HCofThisEvent ( const G4HCofThisEvent rhs)

Definition at line 70 of file G4HCofThisEvent.cc.

71{
73 HC = new std::vector<G4VHitsCollection*>(rhs.HC->size());
74 for ( unsigned int i = 0 ; i<rhs.HC->size() ; ++i)
75 *(HC->at(i)) = *(rhs.HC->at(i));
76}

Member Function Documentation

◆ AddHitsCollection()

◆ GetCapacity()

size_t G4HCofThisEvent::GetCapacity ( )
inline

Definition at line 84 of file G4HCofThisEvent.hh.

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

Referenced by G4Event::Draw(), and G4RunManager::UpdateScoring().

◆ GetHC()

G4VHitsCollection * G4HCofThisEvent::GetHC ( G4int  i)
inline

Definition at line 65 of file G4HCofThisEvent.hh.

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

Referenced by G4Event::Draw(), G4DigiManager::GetHitsCollection(), and G4RunManager::UpdateScoring().

◆ GetNumberOfCollections()

G4int G4HCofThisEvent::GetNumberOfCollections ( )
inline

Definition at line 72 of file G4HCofThisEvent.hh.

73 {
74 G4int n = 0;
75 for(size_t i=0;i<HC->size();i++)
76 {
77 if((*HC)[i]) n++;
78 }
79 return n;
80 }

◆ operator delete()

void G4HCofThisEvent::operator delete ( void *  anHCoTE)
inline

Definition at line 103 of file G4HCofThisEvent.hh.

105 anHCoTHAllocator.FreeSingle((G4HCofThisEvent*)anHCoTH);
106}
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:206

◆ operator new()

void * G4HCofThisEvent::operator new ( size_t  )
inline

Definition at line 96 of file G4HCofThisEvent.hh.

98 void* anHCoTH;
99 anHCoTH = (void*)anHCoTHAllocator.MallocSingle();
100 return anHCoTH;
101}
Type * MallocSingle()
Definition: G4Allocator.hh:196

◆ operator=()

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

Definition at line 78 of file G4HCofThisEvent.cc.

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

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