DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
Length Class Reference

#include <DLG4Units.hh>

Collaboration diagram for Length:
[legend]

Public Member Functions

 Length (double raw, Length u)
 
 Length ()
 
void CheckValue (const G4String &context) const
 
void CheckUnit (const G4String &context) const
 

Static Public Member Functions

static Length FromNative (G4double native_value)
 
static Length GetGlobalDefault ()
 

Public Attributes

ScalableProxy< LengthInUnits
 
DefaultUnitsProxy InDefaultUnits
 
NativeProxy Native
 

Static Public Attributes

static const Length fermi {CLHEP::fermi}
 
static const Length angstrom {CLHEP::angstrom}
 
static const Length nm {CLHEP::nanometer}
 
static const Length pm {1e-9 * CLHEP::mm}
 
static const Length um {CLHEP::micrometer}
 
static const Length micron {CLHEP::micrometer}
 
static const Length mm {CLHEP::mm}
 
static const Length cm {CLHEP::cm}
 
static const Length dm
 
static const Length m {CLHEP::m}
 
static const Length km {CLHEP::kilometer}
 
static const Length mil {0.0254}
 
static const Length inch {25.4}
 
static const Length foot {304.8}
 
static const Length feet {304.8}
 
static Length native
 

Protected Attributes

std::optional< G4double > NativeValue_
 

Detailed Description

Definition at line 293 of file DLG4Units.hh.

Constructor & Destructor Documentation

◆ Length() [1/2]

Length ( double  raw,
Length  u 
)
inlineexplicit

Definition at line 303 of file DLG4Units.hh.

304 : UnitBase(raw, u) {
305 }

◆ Length() [2/2]

Length ( )
inline

Definition at line 307 of file DLG4Units.hh.

Member Function Documentation

◆ CheckUnit()

void CheckUnit ( const G4String &  context) const
inlineinherited

Definition at line 271 of file DLG4Units.hh.

271 {
272 CheckValue(context);
273 if (!(NativeValue_ > 0.0)) {
274 G4Exception(context, "InvalidScale", FatalException,
275 "\n Attempted to apply a negative Unit\n");
276 exit(1);
277 }
278 }
void CheckValue(const G4String &context) const
Definition DLG4Units.hh:260

◆ CheckValue()

void CheckValue ( const G4String &  context) const
inlineinherited

Definition at line 260 of file DLG4Units.hh.

260 {
261 // volatile may help with debugging dangling references.
262 volatile bool engagement_flag = NativeValue_.has_value();
263 if (!engagement_flag) {
264 //if (!NativeValue_.has_value()) {
265 G4Exception(context, "InvalidScale", FatalException,
266 "\n Attempted to use a Unit (or measure) before setting it;\n");
267 exit(1);
268 }
269 }

◆ FromNative()

static Length FromNative ( G4double  native_value)
inlinestaticinherited

Definition at line 232 of file DLG4Units.hh.

232{ return T(native_value); }

◆ GetGlobalDefault()

static Length GetGlobalDefault ( )
inlinestaticinherited

Definition at line 258 of file DLG4Units.hh.

258{ return T(global_default_unit<T>); }

Member Data Documentation

◆ angstrom

const Length angstrom {CLHEP::angstrom}
inlinestatic

Definition at line 311 of file DLG4Units.hh.

◆ cm

const Length cm {CLHEP::cm}
inlinestatic

Definition at line 317 of file DLG4Units.hh.

◆ dm

const Length dm
static

Definition at line 318 of file DLG4Units.hh.

◆ feet

const Length feet {304.8}
inlinestatic

Definition at line 326 of file DLG4Units.hh.

◆ fermi

const Length fermi {CLHEP::fermi}
inlinestatic

Definition at line 310 of file DLG4Units.hh.

◆ foot

const Length foot {304.8}
inlinestatic

Definition at line 325 of file DLG4Units.hh.

◆ inch

const Length inch {25.4}
inlinestatic

Definition at line 324 of file DLG4Units.hh.

◆ InDefaultUnits

DefaultUnitsProxy InDefaultUnits
inherited

Definition at line 228 of file DLG4Units.hh.

228{*this};

◆ InUnits

ScalableProxy<Length > InUnits
inherited

Definition at line 227 of file DLG4Units.hh.

227{*this};

◆ km

const Length km {CLHEP::kilometer}
inlinestatic

Definition at line 320 of file DLG4Units.hh.

◆ m

const Length m {CLHEP::m}
inlinestatic

Definition at line 319 of file DLG4Units.hh.

◆ micron

const Length micron {CLHEP::micrometer}
inlinestatic

Definition at line 315 of file DLG4Units.hh.

◆ mil

const Length mil {0.0254}
inlinestatic

Definition at line 323 of file DLG4Units.hh.

◆ mm

const Length mm {CLHEP::mm}
inlinestatic

Definition at line 316 of file DLG4Units.hh.

◆ Native

NativeProxy Native
inherited

Definition at line 229 of file DLG4Units.hh.

229{*this};

◆ native

Length native
inlinestaticinherited

Definition at line 231 of file DLG4Units.hh.

231{1.0};

◆ NativeValue_

std::optional<G4double > NativeValue_
protectedinherited

Definition at line 98 of file DLG4Units.hh.

◆ nm

const Length nm {CLHEP::nanometer}
inlinestatic

Definition at line 312 of file DLG4Units.hh.

◆ pm

const Length pm {1e-9 * CLHEP::mm}
inlinestatic

Definition at line 313 of file DLG4Units.hh.

◆ um

const Length um {CLHEP::micrometer}
inlinestatic

Definition at line 314 of file DLG4Units.hh.


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