Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3MatTable.cc,v 2.0 1998/07/02 16:16:10 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G3MatTable.hh"
RWBoolean MatTableMatch(const MatTableEntry* MatTentry, const void* pt)
{
G4int matid;
matid = *((G4int*) pt);
if (MatTentry->matid == matid)
{
return TRUE;
} else {
return FALSE;
}
}
G3MatTable::G3MatTable()
{
MatTable = &MatT;
}
G3MatTable::~G3MatTable()
{
while (! MatTable->isEmpty()) {
MatTableEntry* MatTentry = MatTable->last();
MatTable->removeReference(MatTentry);
delete MatTentry;
}
delete MatTable;
}
G4Material* G3MatTable::get(G4int matid)
{
const void* pt;
pt = &matid;
MatTableEntry* MatTentry = MatTable->find(MatTableMatch, pt);
if (MatTentry == NULL) {
return NULL;
} else {
return MatTentry->matpt;
}
}
void G3MatTable::put(G4int* matid, G4Material* matpt)
{
MatTableEntry* MatTentry = new MatTableEntry;
MatTentry->matid = *matid;
MatTentry->matpt = matpt;
MatTable->append(MatTentry);
}