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

#include <G4DCofThisEvent.hh>

Public Member Functions

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

Private Attributes

std::vector< G4VDigiCollection * > * DC
 

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{
42 DC = new std::vector<G4VDigiCollection*>;
43}
G4Allocator< G4DCofThisEvent > *& anDCoTHAllocator_G4MT_TLS_()
std::vector< G4VDigiCollection * > * DC

References anDCoTHAllocator_G4MT_TLS_(), and DC.

◆ G4DCofThisEvent() [2/3]

G4DCofThisEvent::G4DCofThisEvent ( G4int  cap)

Definition at line 45 of file G4DCofThisEvent.cc.

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

References anDCoTHAllocator_G4MT_TLS_(), and DC.

◆ ~G4DCofThisEvent()

G4DCofThisEvent::~G4DCofThisEvent ( )

Definition at line 56 of file G4DCofThisEvent.cc.

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

References anDCoTHAllocator_G4MT_TLS_(), and DC.

◆ G4DCofThisEvent() [3/3]

G4DCofThisEvent::G4DCofThisEvent ( const G4DCofThisEvent rhs)

Definition at line 79 of file G4DCofThisEvent.cc.

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

References anDCoTHAllocator_G4MT_TLS_(), and DC.

Member Function Documentation

◆ AddDigiCollection()

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

Definition at line 69 of file G4DCofThisEvent.cc.

70{
73 if(DCID >= 0 && DCID < G4int(DC->size()))
74 {
75 (*DC)[DCID] = aDC;
76 }
77}

References anDCoTHAllocator_G4MT_TLS_(), and DC.

Referenced by G4DigiManager::SetDigiCollection().

◆ GetCapacity()

size_t G4DCofThisEvent::GetCapacity ( ) const
inline

Definition at line 84 of file G4DCofThisEvent.hh.

84{ return DC->size(); }

References DC.

Referenced by G4Event::Draw().

◆ GetDC()

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

Definition at line 67 of file G4DCofThisEvent.hh.

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

References DC.

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

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

◆ operator delete()

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

Definition at line 104 of file G4DCofThisEvent.hh.

105{
108 G4Allocator<G4DCofThisEvent>& anDCoTHAllocator =
110 anDCoTHAllocator.FreeSingle((G4DCofThisEvent*) anDCoTH);
111}
G4DLLIMPORT G4Allocator< G4DCofThisEvent > *& anDCoTHAllocator_G4MT_TLS_()
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:206

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

◆ operator new()

void * G4DCofThisEvent::operator new ( size_t  )
inline

Definition at line 93 of file G4DCofThisEvent.hh.

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

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

◆ operator=()

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

Definition at line 88 of file G4DCofThisEvent.cc.

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

References anDCoTHAllocator_G4MT_TLS_(), and DC.

Field Documentation

◆ DC

std::vector<G4VDigiCollection*>* G4DCofThisEvent::DC
private

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