Geant4-11
Public Member Functions | Private Attributes
G4HCofThisEvent Class Reference

#include <G4HCofThisEvent.hh>

Public Member Functions

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

Private Attributes

std::vector< G4VHitsCollection * > * HC
 

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{
41 HC = new std::vector<G4VHitsCollection*>;
42}
G4Allocator< G4HCofThisEvent > *& anHCoTHAllocator_G4MT_TLS_()
std::vector< G4VHitsCollection * > * HC

References anHCoTHAllocator_G4MT_TLS_(), and HC.

◆ G4HCofThisEvent() [2/3]

G4HCofThisEvent::G4HCofThisEvent ( G4int  cap)

Definition at line 44 of file G4HCofThisEvent.cc.

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

References anHCoTHAllocator_G4MT_TLS_(), and HC.

◆ ~G4HCofThisEvent()

G4HCofThisEvent::~G4HCofThisEvent ( )

Definition at line 55 of file G4HCofThisEvent.cc.

56{
59 // HC->clearAndDestroy();
60 for(size_t i = 0; i < HC->size(); i++)
61 {
62 delete(*HC)[i];
63 }
64 HC->clear();
65 delete HC;
66}

References anHCoTHAllocator_G4MT_TLS_(), and HC.

◆ G4HCofThisEvent() [3/3]

G4HCofThisEvent::G4HCofThisEvent ( const G4HCofThisEvent rhs)

Definition at line 79 of file G4HCofThisEvent.cc.

80{
83 HC = new std::vector<G4VHitsCollection*>(rhs.HC->size());
84 for(unsigned int i = 0; i < rhs.HC->size(); ++i)
85 *(HC->at(i)) = *(rhs.HC->at(i));
86}

References anHCoTHAllocator_G4MT_TLS_(), and HC.

Member Function Documentation

◆ AddHitsCollection()

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

◆ GetCapacity()

size_t G4HCofThisEvent::GetCapacity ( )
inline

Definition at line 85 of file G4HCofThisEvent.hh.

85{ return HC->size(); }

References HC.

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

◆ GetHC()

G4VHitsCollection * G4HCofThisEvent::GetHC ( G4int  i)
inline

Definition at line 66 of file G4HCofThisEvent.hh.

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

References HC.

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 }

References HC, and CLHEP::detail::n.

◆ operator delete()

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

Definition at line 111 of file G4HCofThisEvent.hh.

112{
113 ;
114 ;
115 ;
118 G4Allocator<G4HCofThisEvent>& anHCoTHAllocator =
120 ;
121 ;
122 ;
123 anHCoTHAllocator.FreeSingle((G4HCofThisEvent*) anHCoTH);
124}
G4DLLIMPORT G4Allocator< G4HCofThisEvent > *& anHCoTHAllocator_G4MT_TLS_()
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:206

References anHCoTHAllocator_G4MT_TLS_(), and G4Allocator< Type >::FreeSingle().

◆ operator new()

void * G4HCofThisEvent::operator new ( size_t  )
inline

Definition at line 94 of file G4HCofThisEvent.hh.

95{
96 ;
97 ;
98 ;
101 G4Allocator<G4HCofThisEvent>& anHCoTHAllocator =
103 ;
104 ;
105 ;
106 void* anHCoTH;
107 anHCoTH = (void*) anHCoTHAllocator.MallocSingle();
108 return anHCoTH;
109}
Type * MallocSingle()
Definition: G4Allocator.hh:196

References anHCoTHAllocator_G4MT_TLS_(), and G4Allocator< Type >::MallocSingle().

◆ operator=()

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

Definition at line 88 of file G4HCofThisEvent.cc.

89{
90 if(this == &rhs)
91 return *this;
94 for(std::vector<G4VHitsCollection*>::const_iterator it = HC->begin();
95 it != HC->end(); ++it)
96 {
97 delete *it;
98 }
99 HC->resize(rhs.HC->size());
100 for(unsigned int i = 0; i < rhs.HC->size(); ++i)
101 *(HC->at(i)) = *(rhs.HC->at(i));
102 return *this;
103}

References anHCoTHAllocator_G4MT_TLS_(), and HC.

Field Documentation

◆ HC

std::vector<G4VHitsCollection*>* G4HCofThisEvent::HC
private

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