23 static bool s_type_changed =
false;
25 TGeoUnit::UnitType tgeo_unit_type;
26 TGeant4Unit::UnitType tgeant4_unit_type;
27 _unit_type(TGeoUnit::UnitType t) { tgeo_unit_type = t; }
28 } s_unit_type(TGeoUnit::kTGeoUnits);
31 TGeoUnit::UnitType TGeoUnit::unitType() {
32 return s_unit_type.tgeo_unit_type;
35 TGeoUnit::UnitType TGeoUnit::setUnitType(UnitType new_type) {
36 UnitType tmp = s_unit_type.tgeo_unit_type;
37 if ( !s_type_changed || new_type == s_unit_type.tgeo_unit_type ) {
38 s_unit_type.tgeo_unit_type = new_type;
39 s_type_changed =
true;
42 Fatal(
"TGeoUnit",
"The system of units may only be changed once at the beginning of the program!");
46 TGeant4Unit::UnitType TGeant4Unit::unitType() {
47 return s_unit_type.tgeant4_unit_type;
50 TGeant4Unit::UnitType TGeant4Unit::setUnitType(UnitType new_type) {
51 UnitType tmp = s_unit_type.tgeant4_unit_type;
52 if ( !s_type_changed || new_type == s_unit_type.tgeant4_unit_type ) {
53 s_unit_type.tgeant4_unit_type = new_type;
54 s_type_changed =
true;
57 Fatal(
"TGeoUnit",
"The system of units may only be changed once at the beginning of the program!");