62 : Name(name),SymbolName(symbol),Value(value)
77 ((*pUnitsTable)[
CategoryIndex]->GetUnitsList()).push_back(
this);
81 (*pUnitsTable)[i]->UpdateNameMxLen((
G4int)name.length());
82 (*pUnitsTable)[i]->UpdateSymbMxLen((
G4int)symbol.length());
144 for (
size_t j=0;j<units.size();j++)
146 name=units[j]->GetName(); symbol=units[j]->GetSymbol();
147 if(str==name||str==symbol)
148 {
return units[j]->GetValue(); }
151 std::ostringstream message;
152 message <<
"The unit '" << str <<
"' does not exist in the Units Table.";
153 G4Exception(
"G4UnitDefinition::GetValueOf()",
"InvalidUnit",
166 for (
size_t j=0;j<units.size();j++)
168 name=units[j]->GetName(); symbol=units[j]->GetSymbol();
169 if(str==name||str==symbol)
173 std::ostringstream message;
174 message <<
"The unit '" << str <<
"' does not exist in the Units Table.";
175 G4Exception(
"G4UnitDefinition::GetCategory()",
"InvalidUnit",
338 G4cout <<
"\n ----- The Table of Units ----- \n";
342 (*pUnitsTable)[i]->PrintCategory();
353 delete (*pUnitsTable)[i];
361 : Name(name),UnitsList(),NameMxLen(0),SymbMxLen(0)
427 size_t nbCat = theUnitsTable.size();
429 while ((i<nbCat)&&(theUnitsTable[i]->GetName()!=category)) { i++; }
432 G4cout <<
" G4BestUnit: the category " << category
433 <<
" does not exist !!" <<
G4endl;
434 G4Exception(
"G4BestUnit::G4BestUnit()",
"InvalidCall",
451 size_t nbCat = theUnitsTable.size();
453 while ((i<nbCat)&&(theUnitsTable[i]->GetName()!=category)) { i++; }
456 G4cerr <<
" G4BestUnit: the category " << category
457 <<
" does not exist." <<
G4endl;
458 G4Exception(
"G4BestUnit::G4BestUnit()",
"InvalidCall",
462 Value[0] = value.x();
463 Value[1] = value.y();
464 Value[2] = value.z();
476 std::ostringstream oss;
490 G4int ksup(-1), kinf(-1);
496 std::fabs(a.
Value[1])),
497 std::fabs(a.
Value[2]));
499 for (
size_t k=0; k<List.size(); k++)
501 G4double unit = List[k]->GetValue();
503 {
if(unit>umax) {umax=unit; ksup=k;}}
505 {
if(unit<umin) {umin=unit; kinf=k;}}
509 if ((ratio>=1.)&&(ratio<rsup)) {rsup=ratio; ksup=k;}
510 if ((ratio< 1.)&&(ratio>rinf)) {rinf=ratio; kinf=k;}
515 if(index==-1) { index=kinf; }
516 if(index==-1) { index=0; }
519 { flux << a.
Value[j]/(List[index]->GetValue()) <<
" "; }
521 std::ios::fmtflags oldform = flux.flags();
524 flux << std::setw(len) << List[index]->GetSymbol();
static const double kilometer3
static const double megavolt
G4UnitsCategory & operator=(const G4UnitsCategory &)
static void BuildUnitsTable()
static const double megaelectronvolt
G4int operator==(const G4UnitsCategory &) const
static const double kilometer
static const double nanobarn
CLHEP::Hep3Vector G4ThreeVector
static const double milligram
static const double nanometer
std::ostream & operator<<(std::ostream &flux, G4BestUnit a)
G4UnitDefinition & operator=(const G4UnitDefinition &)
G4BestUnit(G4double internalValue, const G4String &category)
static const double millimeter3
std::vector< G4UnitsCategory * > G4UnitsTable
static const double microbarn
static const double joule
static const double centimeter3
static const double kilohertz
static const double parsec
static G4ThreadLocal G4UnitsTable * pUnitsTable
G4UnitsCategory(const G4String &name)
static const double newton
static const double steradian
static const double centimeter2
static const double microsecond
static const double millimeter2
static const double kiloelectronvolt
static G4double GetValueOf(const G4String &)
G4GLOB_DLL std::ostream G4cout
static const double megahertz
static const double electronvolt
static const double meter2
static const double meter
static const double coulomb
G4UnitDefinition(const G4String &name, const G4String &symbol, const G4String &category, G4double value)
static const double becquerel
G4int operator!=(const G4UnitsCategory &) const
static const double second
static const double millisecond
static const double teraelectronvolt
static const double hertz
static const double nanoampere
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static const double kelvin
static const double curie
static void ClearUnitsTable()
static G4UnitsTable & GetUnitsTable()
static const double kilovolt
static G4String GetCategory(const G4String &)
static const double centimeter
static const double micrometer
static const double nanosecond
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static const double kilogram
static const double gauss
static const double atmosphere
static const double gigaelectronvolt
static const double petaelectronvolt
G4int operator!=(const G4UnitDefinition &) const
static const double millibarn
static const double degree
G4int operator==(const G4UnitDefinition &) const
static const double milliampere
static void PrintUnitsTable()
const G4String & GetName() const
static const double millimeter
static const double radian
static const double picosecond
static const double tesla
std::vector< G4UnitDefinition * > G4UnitsContainer
static const double eplus
static const double kilogauss
static const double microampere
static const double ampere
static const double milliradian
static const double fermi
static const double meter3
static const double weber
static const double kilometer2
G4UnitsContainer UnitsList
G4GLOB_DLL std::ostream G4cerr
static const double angstrom
static const double picobarn