Geant4 11.1.1
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 ()
 
void * operator new (size_t)
 
void operator delete (void *anDCoTE)
 
void AddDigiCollection (G4int DCID, G4VDigiCollection *aDC)
 
 G4DCofThisEvent (const G4DCofThisEvent &)
 
G4DCofThisEventoperator= (const G4DCofThisEvent &)
 
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 38 of file G4DCofThisEvent.cc.

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

◆ G4DCofThisEvent() [2/3]

G4DCofThisEvent::G4DCofThisEvent ( G4int  cap)

Definition at line 43 of file G4DCofThisEvent.cc.

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

◆ ~G4DCofThisEvent()

G4DCofThisEvent::~G4DCofThisEvent ( )

Definition at line 52 of file G4DCofThisEvent.cc.

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

◆ G4DCofThisEvent() [3/3]

G4DCofThisEvent::G4DCofThisEvent ( const G4DCofThisEvent rhs)

Definition at line 70 of file G4DCofThisEvent.cc.

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

Member Function Documentation

◆ AddDigiCollection()

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

Definition at line 62 of file G4DCofThisEvent.cc.

63{
64 if(DCID >= 0 && DCID < G4int(DC->size()))
65 {
66 (*DC)[DCID] = aDC;
67 }
68}

Referenced by G4DigiManager::SetDigiCollection().

◆ GetCapacity()

size_t G4DCofThisEvent::GetCapacity ( ) const
inline

Definition at line 84 of file G4DCofThisEvent.hh.

84{ return DC->size(); }

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

◆ GetDC()

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

Definition at line 67 of file G4DCofThisEvent.hh.

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

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

◆ GetNumberOfCollections()

G4int G4DCofThisEvent::GetNumberOfCollections ( ) const
inline

Definition at line 73 of file G4DCofThisEvent.hh.

74 {
75 G4int n = 0;
76 for(auto dc : *DC)
77 if(dc)
78 n++;
79 return n;
80 }

◆ operator delete()

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

Definition at line 102 of file G4DCofThisEvent.hh.

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

◆ operator new()

void * G4DCofThisEvent::operator new ( size_t  )
inline

Definition at line 93 of file G4DCofThisEvent.hh.

94{
95 if(anDCoTHAllocator_G4MT_TLS_() == nullptr)
96 {
98 }
99 return (void*) anDCoTHAllocator_G4MT_TLS_()->MallocSingle();
100}

◆ operator=()

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

Definition at line 77 of file G4DCofThisEvent.cc.

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

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