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

40 DC = new std::vector<G4VDigiCollection*>;
41}
G4DLLIMPORT G4Allocator< G4DCofThisEvent > *& anDCoTHAllocator_G4MT_TLS_()

◆ G4DCofThisEvent() [2/3]

G4DCofThisEvent::G4DCofThisEvent ( G4int  cap)

Definition at line 43 of file G4DCofThisEvent.cc.

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.

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

◆ G4DCofThisEvent() [3/3]

G4DCofThisEvent::G4DCofThisEvent ( const G4DCofThisEvent rhs)

Definition at line 67 of file G4DCofThisEvent.cc.

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

Member Function Documentation

◆ AddDigiCollection()

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

Definition at line 61 of file G4DCofThisEvent.cc.

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

Referenced by G4DigiManager::SetDigiCollection().

◆ GetCapacity()

size_t G4DCofThisEvent::GetCapacity ( ) const
inline

Definition at line 82 of file G4DCofThisEvent.hh.

83 {
84 return DC->size();
85 }

Referenced by G4Event::Draw().

◆ GetDC()

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

Definition at line 66 of file G4DCofThisEvent.hh.

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

Referenced by 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) if(dc) n++;
77 return n;
78 }

◆ operator delete()

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

Definition at line 105 of file G4DCofThisEvent.hh.

106{
109 G4Allocator<G4DCofThisEvent>& anDCoTHAllocator =
111 anDCoTHAllocator.FreeSingle((G4DCofThisEvent*)anDCoTH);
112}
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:206

◆ operator new()

void * G4DCofThisEvent::operator new ( size_t  )
inline

Definition at line 94 of file G4DCofThisEvent.hh.

95{
98 G4Allocator<G4DCofThisEvent>& anDCoTHAllocator =
100 void* anDCoTH;
101 anDCoTH = (void*)anDCoTHAllocator.MallocSingle();
102 return anDCoTH;
103}
Type * MallocSingle()
Definition: G4Allocator.hh:196

◆ operator=()

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

Definition at line 75 of file G4DCofThisEvent.cc.

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

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