Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UnitDefinition Class Reference

#include <G4UnitsTable.hh>

Public Member Functions

 G4UnitDefinition (const G4String &name, const G4String &symbol, const G4String &category, G4double value)
 
 ~G4UnitDefinition ()=default
 
G4bool operator== (const G4UnitDefinition &) const
 
G4bool operator!= (const G4UnitDefinition &) const
 
const G4StringGetName () const
 
const G4StringGetSymbol () const
 
G4double GetValue () const
 
void PrintDefinition ()
 

Static Public Member Functions

static void BuildUnitsTable ()
 
static void PrintUnitsTable ()
 
static void ClearUnitsTable ()
 
static G4UnitsTableGetUnitsTable ()
 
static G4bool IsUnitDefined (const G4String &)
 
static G4double GetValueOf (const G4String &)
 
static G4String GetCategory (const G4String &)
 

Detailed Description

Definition at line 74 of file G4UnitsTable.hh.

Constructor & Destructor Documentation

◆ G4UnitDefinition()

G4UnitDefinition::G4UnitDefinition ( const G4String name,
const G4String symbol,
const G4String category,
G4double  value 
)

Definition at line 60 of file G4UnitsTable.cc.

62 : Name(name)
63 , SymbolName(symbol)
64 , Value(value)
65{
66 if(pUnitsTable == nullptr)
67 {
68 if(unitsTableDestroyed)
69 {
70 G4Exception("G4UnitDefinition::G4UnitDefinition", "UnitsTable0000",
71 FatalException, "G4UnitsTable had already deleted.");
72 }
73 pUnitsTable = new G4UnitsTable;
74#ifdef G4MULTITHREADED
76 {
77 pUnitsTableShadow = pUnitsTable;
78 }
79#endif
80 }
81
82 // Does the Category objet already exist ?
83 //
84 std::size_t nbCat = pUnitsTable->size();
85 std::size_t i = 0;
86 while((i < nbCat) && ((*pUnitsTable)[i]->GetName() != category))
87 {
88 ++i;
89 }
90 if(i == nbCat)
91 {
92 pUnitsTable->push_back(new G4UnitsCategory(category));
93 }
94 CategoryIndex = i;
95
96 // Insert this Unit in the Units table
97 //
98 ((*pUnitsTable)[CategoryIndex]->GetUnitsList()).push_back(this);
99
100 // Update string max length for name and symbol
101 //
102 (*pUnitsTable)[i]->UpdateNameMxLen((G4int) name.length());
103 (*pUnitsTable)[i]->UpdateSymbMxLen((G4int) symbol.length());
104}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
int G4int
Definition: G4Types.hh:85
std::vector< G4UnitsCategory * > G4UnitsTable
Definition: G4UnitsTable.hh:68
const G4String & GetName() const
const char * name(G4int ptype)
G4bool IsMasterThread()
Definition: G4Threading.cc:124

◆ ~G4UnitDefinition()

G4UnitDefinition::~G4UnitDefinition ( )
default

Member Function Documentation

◆ BuildUnitsTable()

void G4UnitDefinition::BuildUnitsTable ( )
static

Definition at line 246 of file G4UnitsTable.cc.

247{
248 // Length
249 new G4UnitDefinition("parsec", "pc", "Length", parsec);
250 new G4UnitDefinition("kilometer", "km", "Length", kilometer);
251 new G4UnitDefinition("meter", "m", "Length", meter);
252 new G4UnitDefinition("centimeter", "cm", "Length", centimeter);
253 new G4UnitDefinition("millimeter", "mm", "Length", millimeter);
254 new G4UnitDefinition("micrometer", "um", "Length", micrometer);
255 new G4UnitDefinition("nanometer", "nm", "Length", nanometer);
256 new G4UnitDefinition("angstrom", "Ang", "Length", angstrom);
257 new G4UnitDefinition("fermi", "fm", "Length", fermi);
258
259 // Surface
260 new G4UnitDefinition("kilometer2", "km2", "Surface", kilometer2);
261 new G4UnitDefinition("meter2", "m2", "Surface", meter2);
262 new G4UnitDefinition("centimeter2", "cm2", "Surface", centimeter2);
263 new G4UnitDefinition("millimeter2", "mm2", "Surface", millimeter2);
264 new G4UnitDefinition("barn", "barn", "Surface", barn);
265 new G4UnitDefinition("millibarn", "mbarn", "Surface", millibarn);
266 new G4UnitDefinition("microbarn", "mubarn", "Surface", microbarn);
267 new G4UnitDefinition("nanobarn", "nbarn", "Surface", nanobarn);
268 new G4UnitDefinition("picobarn", "pbarn", "Surface", picobarn);
269
270 // Volume
271 new G4UnitDefinition("kilometer3", "km3", "Volume", kilometer3);
272 new G4UnitDefinition("meter3", "m3", "Volume", meter3);
273 new G4UnitDefinition("centimeter3", "cm3", "Volume", centimeter3);
274 new G4UnitDefinition("millimeter3", "mm3", "Volume", millimeter3);
275
276 new G4UnitDefinition("liter", "L", "Volume", liter);
277 new G4UnitDefinition("dL", "dL", "Volume", dL);
278 new G4UnitDefinition("cL", "cL", "Volume", cL);
279 new G4UnitDefinition("mL", "mL", "Volume", mL);
280
281 // Angle
282 new G4UnitDefinition("radian", "rad", "Angle", radian);
283 new G4UnitDefinition("milliradian", "mrad", "Angle", milliradian);
284 new G4UnitDefinition("degree", "deg", "Angle", degree);
285
286 // Solid angle
287 new G4UnitDefinition("steradian", "sr", "Solid angle", steradian);
288 new G4UnitDefinition("millisteradian", "msr", "Solid angle",
289 steradian * 0.001);
290
291 // Time
292 new G4UnitDefinition("second", "s", "Time", second);
293 new G4UnitDefinition("millisecond", "ms", "Time", millisecond);
294 new G4UnitDefinition("microsecond", "us", "Time", microsecond);
295 new G4UnitDefinition("nanosecond", "ns", "Time", nanosecond);
296 new G4UnitDefinition("picosecond", "ps", "Time", picosecond);
297 new G4UnitDefinition("minute", "min", "Time", minute);
298 new G4UnitDefinition("hour", "h", "Time", hour);
299 new G4UnitDefinition("day", "d", "Time", day);
300 new G4UnitDefinition("year", "y", "Time", year);
301
302 // Frequency
303 new G4UnitDefinition("hertz", "Hz", "Frequency", hertz);
304 new G4UnitDefinition("kilohertz", "kHz", "Frequency", kilohertz);
305 new G4UnitDefinition("megahertz", "MHz", "Frequency", megahertz);
306
307 // Velocity
308 new G4UnitDefinition("cm/ns", "cm/ns", "Velocity", cm/ns);
309 new G4UnitDefinition("mm/ns", "mm/ns", "Velocity", mm/ns);
310 new G4UnitDefinition("cm/us", "cm/us", "Velocity", cm/us);
311 new G4UnitDefinition("km/s" , "km/s" , "Velocity", km/s);
312 new G4UnitDefinition("cm/ms", "cm/ms", "Velocity", cm/ms);
313 new G4UnitDefinition( "m/s" , "m/s" , "Velocity", m/s);
314 new G4UnitDefinition("cm/s" , "cm/s" , "Velocity", cm/s);
315 new G4UnitDefinition("mm/s" , "mm/s" , "Velocity", mm/s);
316
317 // Electric charge
318 new G4UnitDefinition("eplus", "e+", "Electric charge", eplus);
319 new G4UnitDefinition("coulomb", "C", "Electric charge", coulomb);
320
321 // Energy
322 new G4UnitDefinition("electronvolt", "eV", "Energy", electronvolt);
323 new G4UnitDefinition("kiloelectronvolt", "keV", "Energy", kiloelectronvolt);
324 new G4UnitDefinition("megaelectronvolt", "MeV", "Energy", megaelectronvolt);
325 new G4UnitDefinition("gigaelectronvolt", "GeV", "Energy", gigaelectronvolt);
326 new G4UnitDefinition("teraelectronvolt", "TeV", "Energy", teraelectronvolt);
327 new G4UnitDefinition("petaelectronvolt", "PeV", "Energy", petaelectronvolt);
328 new G4UnitDefinition("millielectronVolt", "meV", "Energy", millielectronvolt);
329 new G4UnitDefinition("joule", "J", "Energy", joule);
330
331 //Momentum
332 new G4UnitDefinition( "eV/c", "eV/c", "Momentum", eV);
333 new G4UnitDefinition("keV/c", "keV/c", "Momentum", keV);
334 new G4UnitDefinition("MeV/c", "MeV/c", "Momentum", MeV);
335 new G4UnitDefinition("GeV/c", "GeV/c", "Momentum", GeV);
336 new G4UnitDefinition("TeV/c", "TeV/c", "Momentum", TeV);
337
338 // Energy/Length
339 new G4UnitDefinition("GeV/cm", "GeV/cm", "Energy/Length", GeV / cm);
340 new G4UnitDefinition("MeV/cm", "MeV/cm", "Energy/Length", MeV / cm);
341 new G4UnitDefinition("keV/cm", "keV/cm", "Energy/Length", keV / cm);
342 new G4UnitDefinition("eV/cm", "eV/cm", "Energy/Length", eV / cm);
343
344 // Mass
345 new G4UnitDefinition("milligram", "mg", "Mass", milligram);
346 new G4UnitDefinition("gram", "g", "Mass", gram);
347 new G4UnitDefinition("kilogram", "kg", "Mass", kilogram);
348
349 // Volumic Mass
350 new G4UnitDefinition("g/cm3", "g/cm3", "Volumic Mass", g / cm3);
351 new G4UnitDefinition("mg/cm3", "mg/cm3", "Volumic Mass", mg / cm3);
352 new G4UnitDefinition("kg/m3", "kg/m3", "Volumic Mass", kg / m3);
353
354 // Mass/Surface
355 new G4UnitDefinition("g/cm2", "g/cm2", "Mass/Surface", g / cm2);
356 new G4UnitDefinition("mg/cm2", "mg/cm2", "Mass/Surface", mg / cm2);
357 new G4UnitDefinition("kg/cm2", "kg/cm2", "Mass/Surface", kg / cm2);
358
359 // Surface/Mass
360 new G4UnitDefinition("cm2/g", "cm2/g", "Surface/Mass", cm2 / g);
361
362 // Energy.Surface/Mass
363 new G4UnitDefinition("eV*cm2/g", " eV*cm2/g", "Energy*Surface/Mass",
364 eV * cm2 / g);
365 new G4UnitDefinition("keV*cm2/g", "keV*cm2/g", "Energy*Surface/Mass",
366 keV * cm2 / g);
367 new G4UnitDefinition("MeV*cm2/g", "MeV*cm2/g", "Energy*Surface/Mass",
368 MeV * cm2 / g);
369 new G4UnitDefinition("GeV*cm2/g", "GeV*cm2/g", "Energy*Surface/Mass",
370 GeV * cm2 / g);
371
372 // Power
373 new G4UnitDefinition("watt", "W", "Power", watt);
374
375 // Force
376 new G4UnitDefinition("newton", "N", "Force", newton);
377
378 // Pressure
379 new G4UnitDefinition("pascal", "Pa", "Pressure", hep_pascal);
380 new G4UnitDefinition("bar", "bar", "Pressure", bar);
381 new G4UnitDefinition("atmosphere", "atm", "Pressure", atmosphere);
382
383 // Electric current
384 new G4UnitDefinition("ampere", "A", "Electric current", ampere);
385 new G4UnitDefinition("milliampere", "mA", "Electric current", milliampere);
386 new G4UnitDefinition("microampere", "muA", "Electric current", microampere);
387 new G4UnitDefinition("nanoampere", "nA", "Electric current", nanoampere);
388
389 // Electric potential
390 new G4UnitDefinition("volt", "V", "Electric potential", volt);
391 new G4UnitDefinition("kilovolt", "kV", "Electric potential", kilovolt);
392 new G4UnitDefinition("megavolt", "MV", "Electric potential", megavolt);
393
394 // Electric field
395 new G4UnitDefinition("volt/m", "V/m", "Electric field", volt / m);
396 new G4UnitDefinition("kilovolt/m", "kV/m", "Electric field", kilovolt / m);
397 new G4UnitDefinition("megavolt/m", "MV/m", "Electric field", megavolt / m);
398
399 // Magnetic flux
400 new G4UnitDefinition("weber", "Wb", "Magnetic flux", weber);
401
402 // Magnetic flux density
403 new G4UnitDefinition("tesla", "T", "Magnetic flux density", tesla);
404 new G4UnitDefinition("kilogauss", "kG", "Magnetic flux density", kilogauss);
405 new G4UnitDefinition("gauss", "G", "Magnetic flux density", gauss);
406
407 // Temperature
408 new G4UnitDefinition("kelvin", "K", "Temperature", kelvin);
409
410 // Amount of substance
411 new G4UnitDefinition("mole", "mol", "Amount of substance", mole);
412 new G4UnitDefinition("g/mole", "g/mol", "Molar mass", g / mole);
413
414 // Activity
415 new G4UnitDefinition("becquerel", "Bq", "Activity", becquerel);
416 new G4UnitDefinition("curie", "Ci", "Activity", curie);
417
418 // Dose
419 new G4UnitDefinition("gray", "Gy", "Dose", gray);
420}
#define ns(x)
Definition: xmltok.c:1649

Referenced by GetUnitsTable(), and G4DimensionedTypeUtils::GetUnitValue().

◆ ClearUnitsTable()

void G4UnitDefinition::ClearUnitsTable ( )
static

Definition at line 439 of file G4UnitsTable.cc.

440{
441#ifdef G4MULTITHREADED
442 delete pUnitsTable;
443 pUnitsTable = nullptr;
445 {
446 pUnitsTableShadow = nullptr;
447 }
448#else
449 for(std::size_t i = 0; i < pUnitsTable->size(); ++i)
450 {
451 delete(*pUnitsTable)[i];
452 }
453 pUnitsTable->clear();
454#endif
455 unitsTableDestroyed = true;
456}

Referenced by G4RunManagerKernel::~G4RunManagerKernel().

◆ GetCategory()

G4String G4UnitDefinition::GetCategory ( const G4String str)
static

Definition at line 210 of file G4UnitsTable.cc.

211{
212 G4String name, symbol;
213 for(std::size_t i = 0; i < (GetUnitsTable()).size(); ++i)
214 {
215 G4UnitsContainer& units = (*pUnitsTable)[i]->GetUnitsList();
216 for(auto& unit : units)
217 {
218 name = unit->GetName();
219 symbol = unit->GetSymbol();
220 if(str == name || str == symbol)
221 {
222 return (*pUnitsTable)[i]->GetName();
223 }
224 }
225 }
226 std::ostringstream message;
227 message << "The unit '" << str << "' does not exist in the Units Table!";
228 G4Exception("G4UnitDefinition::GetCategory()", "InvalidUnit", FatalException,
229 message);
230 name = "None";
231 return name;
232}
std::vector< G4UnitDefinition * > G4UnitsContainer
static G4UnitsTable & GetUnitsTable()

Referenced by G4GDMLReadMaterials::AtomRead(), G4GDMLReadParamvol::Box_dimensionsRead(), G4GDMLReadSolids::BoxRead(), G4UIcommand::CategoryOf(), G4VPrimitiveScorer::CheckAndSetUnit(), G4GDMLReadParamvol::Cone_dimensionsRead(), G4GDMLReadSolids::ConeRead(), G4GDMLReadSolids::CutTubeRead(), G4GDMLReadStructure::DivisionvolRead(), G4GDMLReadMaterials::DRead(), G4GDMLReadSolids::ElconeRead(), G4GDMLReadParamvol::Ellipsoid_dimensionsRead(), G4GDMLReadSolids::EllipsoidRead(), G4GDMLReadSolids::EltubeRead(), G4GDMLReadSolids::GenericPolyconeRead(), G4GDMLReadSolids::GenericPolyhedraRead(), G4GDMLReadSolids::GenTrapRead(), G4GDMLReadParamvol::Hype_dimensionsRead(), G4GDMLReadSolids::HypeRead(), G4GDMLReadMaterials::MEERead(), G4GDMLReadParamvol::Orb_dimensionsRead(), G4GDMLReadSolids::OrbRead(), G4GDMLReadParamvol::Para_dimensionsRead(), G4GDMLReadSolids::ParaboloidRead(), G4GDMLReadSolids::ParaRead(), G4GDMLReadParamvol::Polycone_dimensionsRead(), G4GDMLReadSolids::PolyconeRead(), G4GDMLReadParamvol::Polyhedra_dimensionsRead(), G4GDMLReadSolids::PolyhedraRead(), G4GDMLReadDefine::PositionRead(), G4GDMLReadMaterials::PRead(), G4VVisCommand::ProvideValueOfUnit(), G4GDMLReadSolids::QuadrangularRead(), G4GDMLReadStructure::QuantityRead(), G4GDMLReadSolids::ReflectedSolidRead(), G4GDMLReadDefine::RotationRead(), G4GDMLReadParamvol::Sphere_dimensionsRead(), G4GDMLReadSolids::SphereRead(), G4AttCheck::Standard(), G4GDMLReadSolids::TetRead(), G4GDMLReadParamvol::Torus_dimensionsRead(), G4GDMLReadSolids::TorusRead(), G4GDMLReadParamvol::Trap_dimensionsRead(), G4GDMLReadSolids::TrapRead(), G4GDMLReadParamvol::Trd_dimensionsRead(), G4GDMLReadSolids::TrdRead(), G4GDMLReadMaterials::TRead(), G4GDMLReadSolids::TriangularRead(), G4GDMLReadParamvol::Tube_dimensionsRead(), G4GDMLReadSolids::TubeRead(), G4GDMLReadSolids::TwistedboxRead(), G4GDMLReadSolids::TwistedtrapRead(), G4GDMLReadSolids::TwistedtrdRead(), G4GDMLReadSolids::TwistedtubsRead(), and G4GDMLReadSolids::XtruRead().

◆ GetName()

const G4String & G4UnitDefinition::GetName ( ) const
inline

◆ GetSymbol()

const G4String & G4UnitDefinition::GetSymbol ( ) const
inline

◆ GetUnitsTable()

G4UnitsTable & G4UnitDefinition::GetUnitsTable ( )
static

Definition at line 143 of file G4UnitsTable.cc.

144{
145 if(pUnitsTable == nullptr)
146 {
147 pUnitsTable = new G4UnitsTable;
148 }
149 if(pUnitsTable->empty())
150 {
152 }
153#ifdef G4MULTITHREADED
154 if(G4Threading::IsMasterThread() && pUnitsTableShadow == nullptr)
155 {
156 pUnitsTableShadow = pUnitsTable;
157 }
158#endif
159 return *pUnitsTable;
160}
static void BuildUnitsTable()

Referenced by G4AttCheck::G4AttCheck(), G4BestUnit::G4BestUnit(), G4GDMLRead::G4GDMLRead(), G4RunManagerKernel::G4RunManagerKernel(), GetCategory(), G4DimensionedTypeUtils::GetUnitValue(), GetValueOf(), G4RunManagerKernel::InitializePhysics(), IsUnitDefined(), G4RunManagerKernel::RunInitialization(), G4RunManagerKernel::SetupPhysics(), and G4UIcommand::UnitsList().

◆ GetValue()

G4double G4UnitDefinition::GetValue ( ) const
inline

◆ GetValueOf()

G4double G4UnitDefinition::GetValueOf ( const G4String str)
static

Definition at line 185 of file G4UnitsTable.cc.

186{
187 G4String name, symbol;
188 for(std::size_t i = 0; i < (GetUnitsTable()).size(); ++i)
189 {
190 G4UnitsContainer& units = (*pUnitsTable)[i]->GetUnitsList();
191 for(auto& unit : units)
192 {
193 name = unit->GetName();
194 symbol = unit->GetSymbol();
195 if(str == name || str == symbol)
196 {
197 return unit->GetValue();
198 }
199 }
200 }
201 std::ostringstream message;
202 message << "The unit '" << str << "' does not exist in the Units Table!";
203 G4Exception("G4UnitDefinition::GetValueOf()", "InvalidUnit", FatalException,
204 message);
205 return 0.;
206}

Referenced by G4GDMLReadMaterials::AtomRead(), G4GDMLReadParamvol::Box_dimensionsRead(), G4GDMLReadSolids::BoxRead(), G4VPrimitiveScorer::CheckAndSetUnit(), G4GDMLReadParamvol::Cone_dimensionsRead(), G4GDMLReadSolids::ConeRead(), G4GDMLReadSolids::CutTubeRead(), G4GDMLReadStructure::DivisionvolRead(), G4GDMLReadMaterials::DRead(), G4GDMLReadSolids::ElconeRead(), G4GDMLReadParamvol::Ellipsoid_dimensionsRead(), G4GDMLReadSolids::EllipsoidRead(), G4GDMLReadSolids::EltubeRead(), G4ScoreQuantityMessenger::FParticleWithEnergyCommand(), G4GDMLReadSolids::GenericPolyconeRead(), G4GDMLReadSolids::GenericPolyhedraRead(), G4GDMLReadSolids::GenTrapRead(), G4tgrUtils::GetDouble(), G4Analysis::GetUnitValue(), G4GDMLReadParamvol::Hype_dimensionsRead(), G4GDMLReadSolids::HypeRead(), G4GDMLReadMaterials::MEERead(), G4GDMLReadParamvol::Orb_dimensionsRead(), G4GDMLReadSolids::OrbRead(), G4GDMLReadParamvol::Para_dimensionsRead(), G4GDMLReadSolids::ParaboloidRead(), G4GDMLReadSolids::ParaRead(), G4GDMLReadParamvol::Polycone_dimensionsRead(), G4GDMLReadSolids::PolyconeRead(), G4GDMLReadParamvol::Polyhedra_dimensionsRead(), G4GDMLReadSolids::PolyhedraRead(), G4GDMLReadDefine::PositionRead(), G4GDMLReadMaterials::PRead(), G4VVisCommand::ProvideValueOfUnit(), G4GDMLReadSolids::QuadrangularRead(), G4GDMLReadStructure::QuantityRead(), G4GDMLReadDefine::QuantityRead(), G4GDMLReadSolids::ReflectedSolidRead(), G4GDMLReadDefine::RotationRead(), G4AdjointSimMessenger::SetNewValue(), G4ScoreQuantityMessenger::SetNewValue(), G4GDMLReadParamvol::Sphere_dimensionsRead(), G4GDMLReadSolids::SphereRead(), G4AttCheck::Standard(), G4GDMLReadSolids::TetRead(), G4GDMLReadParamvol::Torus_dimensionsRead(), G4GDMLReadSolids::TorusRead(), G4GDMLReadParamvol::Trap_dimensionsRead(), G4GDMLReadSolids::TrapRead(), G4GDMLReadParamvol::Trd_dimensionsRead(), G4GDMLReadSolids::TrdRead(), G4GDMLReadMaterials::TRead(), G4GDMLReadSolids::TriangularRead(), G4GDMLReadParamvol::Tube_dimensionsRead(), G4GDMLReadSolids::TubeRead(), G4GDMLReadSolids::TwistedboxRead(), G4GDMLReadSolids::TwistedtrapRead(), G4GDMLReadSolids::TwistedtrdRead(), G4GDMLReadSolids::TwistedtubsRead(), G4UIcommand::ValueOf(), G4GDMLReadDefine::VectorRead(), and G4GDMLReadSolids::XtruRead().

◆ IsUnitDefined()

G4bool G4UnitDefinition::IsUnitDefined ( const G4String str)
static

Definition at line 164 of file G4UnitsTable.cc.

165{
166 G4String name, symbol;
167 for(std::size_t i = 0; i < (GetUnitsTable()).size(); ++i)
168 {
169 G4UnitsContainer& units = (*pUnitsTable)[i]->GetUnitsList();
170 for(auto& unit : units)
171 {
172 name = unit->GetName();
173 symbol = unit->GetSymbol();
174 if(str == name || str == symbol)
175 {
176 return true;
177 }
178 }
179 }
180 return false;
181}

Referenced by G4VVisCommand::ConvertToDoublePair(), and G4VVisCommand::ProvideValueOfUnit().

◆ operator!=()

G4bool G4UnitDefinition::operator!= ( const G4UnitDefinition right) const

Definition at line 136 of file G4UnitsTable.cc.

137{
138 return (this != (G4UnitDefinition*) &right);
139}

◆ operator==()

G4bool G4UnitDefinition::operator== ( const G4UnitDefinition right) const

Definition at line 129 of file G4UnitsTable.cc.

130{
131 return (this == (G4UnitDefinition*) &right);
132}

◆ PrintDefinition()

void G4UnitDefinition::PrintDefinition ( )

Definition at line 236 of file G4UnitsTable.cc.

237{
238 G4int nameL = (*pUnitsTable)[CategoryIndex]->GetNameMxLen();
239 G4int symbL = (*pUnitsTable)[CategoryIndex]->GetSymbMxLen();
240 G4cout << std::setw(nameL) << Name << " (" << std::setw(symbL) << SymbolName
241 << ") = " << Value << G4endl;
242}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

◆ PrintUnitsTable()

void G4UnitDefinition::PrintUnitsTable ( )
static

Definition at line 424 of file G4UnitsTable.cc.

425{
426 G4cout << "\n ----- The Table of Units ----- \n";
427 if(pUnitsTable == nullptr)
428 {
429 pUnitsTable = new G4UnitsTable;
430 }
431 for(std::size_t i = 0; i < pUnitsTable->size(); ++i)
432 {
433 (*pUnitsTable)[i]->PrintCategory();
434 }
435}

Referenced by G4UnitsMessenger::SetNewValue().


The documentation for this class was generated from the following files: