LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 ( )

Definition at line 50 of file G4EzWorld.cc.

52 {
53 }
G4EzWorld::~G4EzWorld ( )

Definition at line 56 of file G4EzWorld.cc.

References CreateWorld(), and world.

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

Member Function Documentation

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

Definition at line 65 of file G4EzWorld.cc.

Referenced by Reset(), and ~G4EzWorld().

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 }
G4VPhysicalVolume * G4EzWorld::GetWorldVolume ( )
inlinestatic

Definition at line 73 of file G4EzWorld.hh.

References world.

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

73 { return world; }
static G4VPhysicalVolume * world
Definition: G4EzWorld.hh:52
void G4EzWorld::Reset ( G4double  dx,
G4double  dy,
G4double  dz 
)
static

Definition at line 96 of file G4EzWorld.cc.

References CreateWorld(), and world.

Referenced by pyEZgeom::ResetWorld().

98 {
99  delete world;
100  world= CreateWorld(dx, dy, dz);
101 
102  G4RunManager* runManager= G4RunManager::GetRunManager();
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 G4VPhysicalVolume * world
Definition: G4EzWorld.hh:52
void G4EzWorld::Resize ( G4double  dx,
G4double  dy,
G4double  dz 
)
static

Definition at line 108 of file G4EzWorld.cc.

References pyG4RunManager::GeometryHasBeenModified, and world.

Referenced by pyEZgeom::ResizeWorld().

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 
116  G4RunManager* runManager= G4RunManager::GetRunManager();
117  runManager-> GeometryHasBeenModified();
118 }
static G4VPhysicalVolume * world
Definition: G4EzWorld.hh:52
void G4EzWorld::SetMaterial ( G4Material *  amaterial)
static

Definition at line 122 of file G4EzWorld.cc.

References world.

Referenced by pyEZgeom::SetWorldMaterial().

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

Definition at line 130 of file G4EzWorld.cc.

References world.

Referenced by pyEZgeom::SetWorldVisibility().

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

Member Data Documentation

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

Definition at line 52 of file G4EzWorld.hh.

Referenced by GetWorldVolume(), Reset(), Resize(), SetMaterial(), SetVisibility(), and ~G4EzWorld().


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