}
//*****************************************************************************
+int FGeometryInit::GetLastMaterialIndex() const
+{
+// Get last material index as known by FLUKA
+ const FlukaMaterialsTable *matTable = FlukaMaterial::GetMaterialTable();
+ int matsize = matTable->size();
+ return matsize+2;
+}
void FGeometryInit::createFlukaMatFile() {
// last modification Sara Vanini 1/III/99
int FGeometryInit::CurrentVolID(int ir, int& copyNo)
{
+ if (ir == 0)
+ {
+ copyNo = -1;
+ return -1;
+ }
+
G4PhysicalVolumeStore * pVolStore = G4PhysicalVolumeStore::GetInstance();
- G4VPhysicalVolume * physicalvol = (*pVolStore)[ir- 1];
- copyNo = physicalvol->GetCopyNo();
+ G4VPhysicalVolume * physicalvol = (*pVolStore)[ir- 1];
+
+ if (physicalvol) {
+ copyNo = physicalvol->GetCopyNo();
+ } else {
+ copyNo = -1;
+ return -1;
+ }
+
+
int id = fVolIdVolumeMap[physicalvol];
return id;
}