Geant4-11
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes
G4EzWorld Class Reference

#include <G4EzWorld.hh>

Public Member Functions

 G4EzWorld ()
 
 ~G4EzWorld ()
 

Static Public Member Functions

static G4VPhysicalVolume * GetWorldVolume ()
 
static void Reset (G4double dx, G4double dy, G4double dz)
 
static void Resize (G4double dx, G4double dy, G4double dz)
 
static void SetMaterial (G4Material *amaterial)
 
static void SetVisibility (G4bool qvis)
 

Static Protected Member Functions

static G4VPhysicalVolume * CreateWorld (G4double dx=1.*m, G4double dy=1.*m, G4double dz=1.*m)
 

Static Protected Attributes

static G4VPhysicalVolume * world = G4EzWorld::CreateWorld()
 

Detailed Description

Definition at line 49 of file G4EzWorld.hh.

Constructor & Destructor Documentation

◆ G4EzWorld()

G4EzWorld::G4EzWorld ( )

Definition at line 50 of file G4EzWorld.cc.

52{
53}

◆ ~G4EzWorld()

G4EzWorld::~G4EzWorld ( )

Definition at line 56 of file G4EzWorld.cc.

58{
59 world= 0;
60}
static G4VPhysicalVolume * world
Definition: G4EzWorld.hh:52

References world.

Member Function Documentation

◆ CreateWorld()

G4VPhysicalVolume * G4EzWorld::CreateWorld ( G4double  dx = 1.*m,
G4double  dy = 1.*m,
G4double  dz = 1.*m 
)
staticprotected

Definition at line 64 of file G4EzWorld.cc.

67{
68 // default matetial is "vacuum"
69 G4Material* vacuum= G4Material::GetMaterial("_Vacuum", false);
70
71 if(vacuum==0) {
72 G4Element* elN= new G4Element("_N", "", 7., 14.00674*g/mole);
73 G4Element* elO= new G4Element("_O", "", 8., 15.9994*g/mole);
74
75 vacuum= new G4Material("_Vacuum", universe_mean_density, 2);
76 vacuum-> AddElement(elN, 0.7);
77 vacuum-> AddElement(elO, 0.3);
78 }
79
80 G4Box* sdworld= new G4Box("world", dx/2., dy/2., dz/2.);
81 G4LogicalVolume* lvworld= new G4LogicalVolume(sdworld, vacuum, "word");
82 G4PVPlacement* aworld= new G4PVPlacement(0, G4ThreeVector(), "world",
83 lvworld, 0, false, 0);
84
85 // vis. attributes
86 G4VisAttributes* vaworld= new G4VisAttributes(G4Color(1.,1.,1.));
87 vaworld-> SetForceWireframe(true);
88 lvworld-> SetVisAttributes(vaworld);
89
90 return aworld;
91
92}
G4Colour G4Color
Definition: G4Color.hh:41
static constexpr double mole
Definition: G4SIunits.hh:279
static constexpr double g
Definition: G4SIunits.hh:168
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:56
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:686
int universe_mean_density
Definition: hepunit.py:306

References g, G4Material::GetMaterial(), mole, and source.hepunit::universe_mean_density.

Referenced by Reset().

◆ GetWorldVolume()

G4VPhysicalVolume * G4EzWorld::GetWorldVolume ( )
inlinestatic

Definition at line 73 of file G4EzWorld.hh.

73{ return world; }

References world.

Referenced by EzDetectorConstruction::Construct(), and G4EzVolume::PlaceIt().

◆ Reset()

void G4EzWorld::Reset ( G4double  dx,
G4double  dy,
G4double  dz 
)
static

Definition at line 96 of file G4EzWorld.cc.

98{
99 delete world;
100 world= CreateWorld(dx, dy, dz);
101
103 runManager-> DefineWorldVolume(world);
104}
static G4VPhysicalVolume * CreateWorld(G4double dx=1.*m, G4double dy=1.*m, G4double dz=1.*m)
Definition: G4EzWorld.cc:65
static G4RunManager * GetRunManager()

References CreateWorld(), G4RunManager::GetRunManager(), and world.

Referenced by pyEZgeom::ResetWorld().

◆ Resize()

void G4EzWorld::Resize ( G4double  dx,
G4double  dy,
G4double  dz 
)
static

Definition at line 108 of file G4EzWorld.cc.

110{
111 G4Box* box= dynamic_cast<G4Box*>(world-> GetLogicalVolume()-> GetSolid());
112 box-> SetXHalfLength(dx/2.);
113 box-> SetYHalfLength(dy/2.);
114 box-> SetZHalfLength(dz/2.);
115
117 runManager-> GeometryHasBeenModified();
118}

References pyG4RunManager::GeometryHasBeenModified, G4RunManager::GetRunManager(), and world.

Referenced by pyEZgeom::ResizeWorld().

◆ SetMaterial()

void G4EzWorld::SetMaterial ( G4Material *  amaterial)
static

Definition at line 122 of file G4EzWorld.cc.

124{
125 world-> GetLogicalVolume()-> SetMaterial(amaterial);
126}
static void SetMaterial(G4Material *amaterial)
Definition: G4EzWorld.cc:122

References SetMaterial(), and world.

Referenced by SetMaterial(), and pyEZgeom::SetWorldMaterial().

◆ SetVisibility()

void G4EzWorld::SetVisibility ( G4bool  qvis)
static

Definition at line 130 of file G4EzWorld.cc.

132{
133 G4VisAttributes* vaworld= const_cast<G4VisAttributes*>(
134 world-> GetLogicalVolume()-> GetVisAttributes());
135 vaworld-> SetVisibility(qvis);
136}
static void SetVisibility(G4bool qvis)
Definition: G4EzWorld.cc:130

References SetVisibility(), and world.

Referenced by SetVisibility(), and pyEZgeom::SetWorldVisibility().

Field Documentation

◆ world

G4VPhysicalVolume * G4EzWorld::world = G4EzWorld::CreateWorld()
staticprotected

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