Geant4 11.1.1
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 56 of file G3MedTable.hh.

Constructor & Destructor Documentation

◆ G3MedTable()

G3MedTable::G3MedTable ( )

Definition at line 32 of file G3MedTable.cc.

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

◆ ~G3MedTable()

G3MedTable::~G3MedTable ( )
virtual

Definition at line 37 of file G3MedTable.cc.

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

Member Function Documentation

◆ Clear()

void G3MedTable::Clear ( )

Definition at line 73 of file G3MedTable.cc.

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

Referenced by ~G3MedTable().

◆ get()

G3MedTableEntry * G3MedTable::get ( G4int  id) const

Definition at line 43 of file G3MedTable.cc.

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

Referenced by G3toG4BuildLVTree().

◆ GetMTE()

G3MedTableEntry * G3MedTable::GetMTE ( G4int  i) const

Definition at line 60 of file G3MedTable.cc.

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

◆ GetSize()

G4int G3MedTable::GetSize ( ) const

Definition at line 68 of file G3MedTable.cc.

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

◆ put()

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

Definition at line 52 of file G3MedTable.cc.

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

Referenced by G4gstmed().


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