Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 G4VPhysicalVolumeGetWorldVolume ()
 
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 G4VPhysicalVolumeCreateWorld (G4double dx=1.*m, G4double dy=1.*m, G4double dz=1.*m)
 

Static Protected Attributes

static G4VPhysicalVolumeworld = G4EzWorld::CreateWorld()
 

Detailed Description

Definition at line 50 of file G4EzWorld.hh.

Constructor & Destructor Documentation

G4EzWorld::G4EzWorld ( )

Definition at line 51 of file G4EzWorld.cc.

53 {
54 }
G4EzWorld::~G4EzWorld ( )

Definition at line 57 of file G4EzWorld.cc.

References world.

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

Member Function Documentation

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

Definition at line 66 of file G4EzWorld.cc.

References AddElement(), elN, elO, g(), G4Material::GetMaterial(), python.hepunit::mole, and python.hepunit::universe_mean_density.

Referenced by Reset().

68 {
69  // default matetial is "vacuum"
70  G4Material* vacuum= G4Material::GetMaterial("_Vacuum", false);
71 
72  if(vacuum==0) {
73  G4Element* elN= new G4Element("_N", "", 7., 14.00674*g/mole);
74  G4Element* elO= new G4Element("_O", "", 8., 15.9994*g/mole);
75 
76  vacuum= new G4Material("_Vacuum", universe_mean_density, 2);
77  vacuum-> AddElement(elN, 0.7);
78  vacuum-> AddElement(elO, 0.3);
79  }
80 
81  G4Box* sdworld= new G4Box("world", dx/2., dy/2., dz/2.);
82  G4LogicalVolume* lvworld= new G4LogicalVolume(sdworld, vacuum, "word");
83  G4PVPlacement* aworld= new G4PVPlacement(0, G4ThreeVector(), "world",
84  lvworld, 0, false, 0);
85 
86  // vis. attributes
87  G4VisAttributes* vaworld= new G4VisAttributes(G4Color(1.,1.,1.));
88  vaworld-> SetForceWireframe(true);
89  lvworld-> SetVisAttributes(vaworld);
90 
91  return aworld;
92 
93 }
CLHEP::Hep3Vector G4ThreeVector
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
int universe_mean_density
Definition: hepunit.py:307
Definition: G4Box.hh:63
G4Element * elN
Definition: TRTMaterials.hh:44
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
G4Element * elO
Definition: TRTMaterials.hh:46
G4Colour G4Color
Definition: G4Color.hh:42
Air AddElement(elN,.7)
G4VPhysicalVolume * G4EzWorld::GetWorldVolume ( )
inlinestatic

Definition at line 74 of file G4EzWorld.hh.

References world.

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

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

Definition at line 97 of file G4EzWorld.cc.

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

Referenced by pyEZgeom::ResetWorld().

99 {
100  delete world;
101  world= CreateWorld(dx, dy, dz);
102 
104  runManager-> DefineWorldVolume(world);
105 }
static G4VPhysicalVolume * world
Definition: G4EzWorld.hh:53
static G4VPhysicalVolume * CreateWorld(G4double dx=1.*m, G4double dy=1.*m, G4double dz=1.*m)
Definition: G4EzWorld.cc:66
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
void G4EzWorld::Resize ( G4double  dx,
G4double  dy,
G4double  dz 
)
static

Definition at line 109 of file G4EzWorld.cc.

References G4RunManager::GetRunManager(), and world.

Referenced by pyEZgeom::ResizeWorld().

111 {
112  G4Box* box= dynamic_cast<G4Box*>(world-> GetLogicalVolume()-> GetSolid());
113  box-> SetXHalfLength(dx/2.);
114  box-> SetYHalfLength(dy/2.);
115  box-> SetZHalfLength(dz/2.);
116 
118  runManager-> GeometryHasBeenModified();
119 }
static G4VPhysicalVolume * world
Definition: G4EzWorld.hh:53
Definition: G4Box.hh:63
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
void G4EzWorld::SetMaterial ( G4Material amaterial)
static

Definition at line 123 of file G4EzWorld.cc.

References world.

Referenced by pyEZgeom::SetWorldMaterial().

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

Definition at line 131 of file G4EzWorld.cc.

References world.

Referenced by pyEZgeom::SetWorldVisibility().

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

Field Documentation

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

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