Unit of the mass returned by G4LogicalVolume::GetMass()

Could anyone please tell the unit of the mass returned by G4LogicalVolume::GetMass()?
For a 1cm3 cube of water (nist->FindOrBuildMaterial(“G4_WATER”)), I get 6.24151e+21.
For a 1cm3 cube of air (nist->FindOrBuildMaterial(“G4_AIR”)), the value is 7.51971e+18.

Geant4 dimensional quantities always include a units scale factor (http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/ForApplicationDeveloper/html/Fundamentals/unitSystem.html). G4LV::GetMass() returns ordinary mass (density x volume), so you can report it in whatever units are convenient for you:

G4double lb = kg / 2.205;            // For the Americans
G4double vmass = myvol->GetMass();
G4cout << "My volume has a mass of " << vmass/kg << " kg", or "
       << vmass/lb << " lb." << G4endl;
1 Like

Perfect! Thank you so much!

you can also use the function G4BestUnit() which will print vmass in the most appropriate existing unit or subunit :
G4cout << " mass = " << G4BestUnit (vmass, “Mass”) << G4endl;

1 Like