Geant4 11.1.1
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.

38{
39 HC = new std::vector<G4VHitsCollection*>;
40}

◆ G4HCofThisEvent() [2/3]

G4HCofThisEvent::G4HCofThisEvent ( G4int  cap)

Definition at line 42 of file G4HCofThisEvent.cc.

43{
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.

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

◆ G4HCofThisEvent() [3/3]

G4HCofThisEvent::G4HCofThisEvent ( const G4HCofThisEvent rhs)

Definition at line 70 of file G4HCofThisEvent.cc.

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

Member Function Documentation

◆ AddHitsCollection()

◆ GetCapacity()

size_t G4HCofThisEvent::GetCapacity ( )
inline

Definition at line 85 of file G4HCofThisEvent.hh.

85{ return HC->size(); }

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

◆ GetHC()

G4VHitsCollection * G4HCofThisEvent::GetHC ( G4int  i)
inline

Definition at line 66 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])
78 n++;
79 }
80 return n;
81 }

◆ operator delete()

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

Definition at line 103 of file G4HCofThisEvent.hh.

104{
105 anHCoTHAllocator_G4MT_TLS_()->FreeSingle((G4HCofThisEvent*) anHCoTH);
106}
G4DLLIMPORT G4Allocator< G4HCofThisEvent > *& anHCoTHAllocator_G4MT_TLS_()

◆ operator new()

void * G4HCofThisEvent::operator new ( size_t  )
inline

Definition at line 94 of file G4HCofThisEvent.hh.

95{
96 if(anHCoTHAllocator_G4MT_TLS_() == nullptr)
97 {
99 }
100 return (void*) anHCoTHAllocator_G4MT_TLS_()->MallocSingle();
101}

◆ operator=()

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

Definition at line 77 of file G4HCofThisEvent.cc.

78{
79 if(this == &rhs)
80 return *this;
81
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: