Geant4 9.6.0
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 53 of file G3MatTable.hh.

Constructor & Destructor Documentation

◆ G3MatTable()

G3MatTable::G3MatTable ( )

Definition at line 33 of file G3MatTable.cc.

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

◆ ~G3MatTable()

G3MatTable::~G3MatTable ( )
virtual

Definition at line 38 of file G3MatTable.cc.

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

Member Function Documentation

◆ Clear()

void G3MatTable::Clear ( )

Definition at line 59 of file G3MatTable.cc.

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

Referenced by ~G3MatTable().

◆ get()

G4Material * G3MatTable::get ( G4int  id) const

Definition at line 44 of file G3MatTable.cc.

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

Referenced by G4gstmed().

◆ put()

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

Definition at line 53 of file G3MatTable.cc.

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

Referenced by G4gsmate(), and G4gsmixt().


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