#include <G4UnitsTable.hh>
Definition at line 148 of file G4UnitsTable.hh.
Definition at line 422 of file G4UnitsTable.cc.
References FatalException, G4cout, G4endl, G4Exception(), and G4UnitDefinition::GetUnitsTable().
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",
std::vector< G4UnitsCategory * > G4UnitsTable
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4UnitsTable & GetUnitsTable()
const XML_Char int const XML_Char * value
Definition at line 446 of file G4UnitsTable.cc.
References FatalException, G4cerr, G4endl, G4Exception(), G4UnitDefinition::GetUnitsTable(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().
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();
std::vector< G4UnitsCategory * > G4UnitsTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4UnitsTable & GetUnitsTable()
const XML_Char int const XML_Char * value
G4GLOB_DLL std::ostream G4cerr
G4BestUnit::~G4BestUnit |
( |
| ) |
|
const G4String& G4BestUnit::GetCategory |
( |
| ) |
const |
|
inline |
size_t G4BestUnit::GetIndexOfCategory |
( |
| ) |
const |
|
inline |
std::ostream& operator<< |
( |
std::ostream & |
flux, |
|
|
G4BestUnit |
VU |
|
) |
| |
|
friend |
Definition at line 483 of file G4UnitsTable.cc.
488 G4int len = theUnitsTable[
a.IndexOfCategory]->GetSymbMxLen();
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; }
518 for (
G4int j=0; j<
a.nbOfVals; j++)
519 { flux <<
a.Value[j]/(List[index]->GetValue()) <<
" "; }
521 std::ios::fmtflags oldform = flux.flags();
524 flux << std::setw(len) << List[index]->GetSymbol();
std::vector< G4UnitsCategory * > G4UnitsTable
static G4UnitsTable & GetUnitsTable()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
const XML_Char int const XML_Char * value
std::vector< G4UnitDefinition * > G4UnitsContainer
The documentation for this class was generated from the following files: