Geant4 11.2.2
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 ()
 
 G4HCofThisEvent (const G4HCofThisEvent &)
 
G4HCofThisEventoperator= (const G4HCofThisEvent &)
 
void * operator new (size_t)
 
void operator delete (void *anHCoTE)
 
void AddHitsCollection (G4int HCID, G4VHitsCollection *aHC)
 
G4VHitsCollectionGetHC (G4int i)
 
G4int GetNumberOfCollections ()
 
size_t GetCapacity ()
 

Detailed Description

Definition at line 49 of file G4HCofThisEvent.hh.

Constructor & Destructor Documentation

◆ G4HCofThisEvent() [1/3]

G4HCofThisEvent::G4HCofThisEvent ( )

Definition at line 37 of file G4HCofThisEvent.cc.

37{ HC = new std::vector<G4VHitsCollection*>; }

◆ G4HCofThisEvent() [2/3]

G4HCofThisEvent::G4HCofThisEvent ( G4int cap)
explicit

Definition at line 39 of file G4HCofThisEvent.cc.

40{
41 HC = new std::vector<G4VHitsCollection*>(cap, nullptr);
42}

◆ ~G4HCofThisEvent()

G4HCofThisEvent::~G4HCofThisEvent ( )

Definition at line 44 of file G4HCofThisEvent.cc.

45{
46 for (const G4VHitsCollection* h : *HC) {
47 delete h;
48 }
49 delete HC;
50}

◆ G4HCofThisEvent() [3/3]

G4HCofThisEvent::G4HCofThisEvent ( const G4HCofThisEvent & rhs)

Definition at line 60 of file G4HCofThisEvent.cc.

61{
62 HC = new std::vector<G4VHitsCollection*>(rhs.HC->size());
63 for (unsigned int i = 0; i < rhs.HC->size(); ++i)
64 *(HC->at(i)) = *(rhs.HC->at(i));
65}

Member Function Documentation

◆ AddHitsCollection()

◆ GetCapacity()

size_t G4HCofThisEvent::GetCapacity ( )
inline

Definition at line 81 of file G4HCofThisEvent.hh.

81{ return HC->size(); }

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

◆ GetHC()

G4VHitsCollection * G4HCofThisEvent::GetHC ( G4int i)
inline

Definition at line 68 of file G4HCofThisEvent.hh.

68{ 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 (const G4VHitsCollection* h : *HC) {
76 if (h != nullptr) n++;
77 }
78 return n;
79 }

◆ operator delete()

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

Definition at line 101 of file G4HCofThisEvent.hh.

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

◆ operator new()

void * G4HCofThisEvent::operator new ( size_t )
inline

Definition at line 93 of file G4HCofThisEvent.hh.

94{
95 if (anHCoTHAllocator_G4MT_TLS_() == nullptr) {
97 }
98 return (void*)anHCoTHAllocator_G4MT_TLS_()->MallocSingle();
99}

◆ operator=()

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

Definition at line 67 of file G4HCofThisEvent.cc.

68{
69 if (this == &rhs) return *this;
70
71 for (const G4VHitsCollection* it : *HC) {
72 delete it;
73 }
74 HC->resize(rhs.HC->size());
75 for (unsigned int i = 0; i < rhs.HC->size(); ++i)
76 *(HC->at(i)) = *(rhs.HC->at(i));
77 return *this;
78}

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