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

#include <G3MedTable.hh>

Public Member Functions

 G3MedTable ()
 
virtual ~G3MedTable ()
 
G3MedTableEntryget (G4int id) const
 
void put (G4int id, G4Material *material, G4MagneticField *field, G4UserLimits *limits, G4int isvol)
 
G4int GetSize () const
 
G3MedTableEntryGetMTE (G4int i) const
 
void Clear ()
 

Detailed Description

Definition at line 57 of file G3MedTable.hh.

Constructor & Destructor Documentation

◆ G3MedTable()

G3MedTable::G3MedTable ( )

Definition at line 33 of file G3MedTable.cc.

34{
35 fMedVector = new G3MediumVector();
36}
std::vector< G3MedTableEntry * > G3MediumVector
Definition: G3MedTable.hh:55

◆ ~G3MedTable()

G3MedTable::~G3MedTable ( )
virtual

Definition at line 38 of file G3MedTable.cc.

39{
40 Clear();
41 delete fMedVector;
42}
void Clear()
Definition: G3MedTable.cc:74

Member Function Documentation

◆ Clear()

void G3MedTable::Clear ( )

Definition at line 74 of file G3MedTable.cc.

75{
77 while (fMedVector->size()>0) {
78 a = fMedVector->back();
79 fMedVector->pop_back();
80 for (G3MediumVector::iterator i=fMedVector->begin();
81 i!=fMedVector->end();){
82 if (*i==a) {
83 i = fMedVector->erase(i);
84 }
85 else {
86 ++i;
87 }
88 }
89 if ( a ) delete a;
90 }
91}

Referenced by ~G3MedTable().

◆ get()

G3MedTableEntry * G3MedTable::get ( G4int  id) const

Definition at line 44 of file G3MedTable.cc.

45{
46 for (size_t i=0; i< fMedVector->size(); i++) {
47 G3MedTableEntry* mte = (*fMedVector)[i];
48 if (id == mte->GetID()) return mte;
49 }
50 return 0;
51}
G4int GetID() const

Referenced by G3toG4BuildLVTree().

◆ GetMTE()

G3MedTableEntry * G3MedTable::GetMTE ( G4int  i) const

Definition at line 61 of file G3MedTable.cc.

62{
63 if (i<0 || i>= G4int(fMedVector->size()))
64 return 0;
65
66 return (*fMedVector)[i];
67}
int G4int
Definition: G4Types.hh:66

◆ GetSize()

G4int G3MedTable::GetSize ( ) const

Definition at line 69 of file G3MedTable.cc.

70{
71 return fMedVector->size();
72}

◆ put()

void G3MedTable::put ( G4int  id,
G4Material material,
G4MagneticField field,
G4UserLimits limits,
G4int  isvol 
)

Definition at line 53 of file G3MedTable.cc.

55{
56 G3MedTableEntry* mte
57 = new G3MedTableEntry(id, material, field, limits, isvol);
58 fMedVector->push_back(mte);
59}

Referenced by G4gstmed().


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