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

#include <G3MatTable.hh>

Public Member Functions

 G3MatTable ()
 
virtual ~G3MatTable ()
 
G4Materialget (G4int id) const
 
void put (G4int id, G4Material *material)
 
void Clear ()
 

Detailed Description

Definition at line 52 of file G3MatTable.hh.

Constructor & Destructor Documentation

◆ G3MatTable()

G3MatTable::G3MatTable ( )

Definition at line 32 of file G3MatTable.cc.

33{
34 fMatVector = new G3MaterialVector();
35}
std::vector< G3MatTableEntry * > G3MaterialVector
Definition: G3MatTable.hh:50

◆ ~G3MatTable()

G3MatTable::~G3MatTable ( )
virtual

Definition at line 37 of file G3MatTable.cc.

38{
39 Clear();
40 delete fMatVector;
41}
void Clear()
Definition: G3MatTable.cc:58

Member Function Documentation

◆ Clear()

void G3MatTable::Clear ( )

Definition at line 58 of file G3MatTable.cc.

59{
61 while (fMatVector->size()>0) {
62 a = fMatVector->back();
63 fMatVector->pop_back();
64 for (G3MaterialVector::iterator i=fMatVector->begin();
65 i!=fMatVector->end();){
66 if (*i==a) {
67 i = fMatVector->erase(i);
68 }
69 else {
70 ++i;
71 }
72 }
73 if ( a ) delete a;
74 }
75}

Referenced by ~G3MatTable().

◆ get()

G4Material * G3MatTable::get ( G4int  id) const

Definition at line 43 of file G3MatTable.cc.

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

Referenced by G4gstmed().

◆ put()

void G3MatTable::put ( G4int  id,
G4Material material 
)

Definition at line 52 of file G3MatTable.cc.

53{
54 G3MatTableEntry* mte = new G3MatTableEntry(id, material);
55 fMatVector->push_back(mte);
56}

Referenced by G4gsmate(), and G4gsmixt().


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