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

#include <G4DCofThisEvent.hh>

Public Member Functions

 G4DCofThisEvent ()
 
 G4DCofThisEvent (G4int cap)
 
 ~G4DCofThisEvent ()
 
 G4DCofThisEvent (const G4DCofThisEvent &)
 
G4DCofThisEventoperator= (const G4DCofThisEvent &)
 
void * operator new (size_t)
 
void operator delete (void *anDCoTE)
 
void AddDigiCollection (G4int DCID, G4VDigiCollection *aDC)
 
G4VDigiCollectionGetDC (G4int i) const
 
G4int GetNumberOfCollections () const
 
size_t GetCapacity () const
 

Detailed Description

Definition at line 49 of file G4DCofThisEvent.hh.

Constructor & Destructor Documentation

◆ G4DCofThisEvent() [1/3]

G4DCofThisEvent::G4DCofThisEvent ( )

Definition at line 39 of file G4DCofThisEvent.cc.

39{ DC = new std::vector<G4VDigiCollection*>; }

◆ G4DCofThisEvent() [2/3]

G4DCofThisEvent::G4DCofThisEvent ( G4int cap)
explicit

Definition at line 41 of file G4DCofThisEvent.cc.

42{
43 DC = new std::vector<G4VDigiCollection*>(cap, nullptr);
44}

◆ ~G4DCofThisEvent()

G4DCofThisEvent::~G4DCofThisEvent ( )

Definition at line 46 of file G4DCofThisEvent.cc.

47{
48 for (const G4VDigiCollection* d : *DC) {
49 delete d;
50 }
51 delete DC;
52}

◆ G4DCofThisEvent() [3/3]

G4DCofThisEvent::G4DCofThisEvent ( const G4DCofThisEvent & rhs)

Definition at line 61 of file G4DCofThisEvent.cc.

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

Member Function Documentation

◆ AddDigiCollection()

void G4DCofThisEvent::AddDigiCollection ( G4int DCID,
G4VDigiCollection * aDC )

Definition at line 54 of file G4DCofThisEvent.cc.

55{
56 if (DCID >= 0 && DCID < G4int(DC->size())) {
57 (*DC)[DCID] = aDC;
58 }
59}
int G4int
Definition G4Types.hh:85

Referenced by G4DigiManager::SetDigiCollection().

◆ GetCapacity()

size_t G4DCofThisEvent::GetCapacity ( ) const
inline

Definition at line 80 of file G4DCofThisEvent.hh.

80{ return DC->size(); }

Referenced by G4DigiModel::DescribeYourselfTo(), and G4Event::Draw().

◆ GetDC()

G4VDigiCollection * G4DCofThisEvent::GetDC ( G4int i) const
inline

Definition at line 68 of file G4DCofThisEvent.hh.

68{ return (*DC)[i]; }

Referenced by G4DigiModel::DescribeYourselfTo(), G4Event::Draw(), and G4DigiManager::GetDigiCollection().

◆ GetNumberOfCollections()

G4int G4DCofThisEvent::GetNumberOfCollections ( ) const
inline

Definition at line 71 of file G4DCofThisEvent.hh.

72 {
73 G4int n = 0;
74 for (const G4VDigiCollection* dc : *DC) {
75 if (dc != nullptr) n++;
76 }
77 return n;
78 }

◆ operator delete()

void G4DCofThisEvent::operator delete ( void * anDCoTE)
inline

Definition at line 100 of file G4DCofThisEvent.hh.

101{
102 anDCoTHAllocator_G4MT_TLS_()->FreeSingle((G4DCofThisEvent*)anDCoTH);
103}
G4DLLIMPORT G4Allocator< G4DCofThisEvent > *& anDCoTHAllocator_G4MT_TLS_()

◆ operator new()

void * G4DCofThisEvent::operator new ( size_t )
inline

Definition at line 92 of file G4DCofThisEvent.hh.

93{
94 if (anDCoTHAllocator_G4MT_TLS_() == nullptr) {
96 }
97 return (void*)anDCoTHAllocator_G4MT_TLS_()->MallocSingle();
98}

◆ operator=()

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

Definition at line 68 of file G4DCofThisEvent.cc.

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

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