]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Correction in CompareElement (to prevent from crash when vacuum (z<1) is passed.
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2001 13:20:34 +0000 (13:20 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2001 13:20:34 +0000 (13:20 +0000)
TGeant4/TG4GeometryServices.cxx

index 8e5434bdaaeb89d2ec7dd9f04b1143c82619e82f..9d6513aaf530e23e2b405be5b7e9180024c4c5a0 100644 (file)
@@ -117,7 +117,13 @@ G4bool TG4GeometryServices::CompareElement(G4double a, G4double z,
   G4double ze = element->GetZ();
 
   // g3tog4 can redefine A
   G4double ze = element->GetZ();
 
   // g3tog4 can redefine A
-  G4double ax = G3Ele.GetEle(z)->GetA()/TG4G3Units::AtomicWeight();
+  G4double ax;
+  if (z<1) {
+    // vacuum 
+    ax = 1.01*g/mole; 
+  }
+  else  
+    ax = G3Ele.GetEle(z)->GetA()/TG4G3Units::AtomicWeight();
 
   if (abs(ax - ae) < fgkAZTolerance && abs(z  - ze) < fgkAZTolerance) 
     return true;
 
   if (abs(ax - ae) < fgkAZTolerance && abs(z  - ze) < fgkAZTolerance) 
     return true;