LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 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 CreateWorld(), and 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.

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

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 }
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(), and world.

Referenced by pyEZgeom::ResetWorld().

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

Definition at line 109 of file G4EzWorld.cc.

References pyG4RunManager::GeometryHasBeenModified, 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 
117  G4RunManager* runManager= G4RunManager::GetRunManager();
118  runManager-> GeometryHasBeenModified();
119 }
static G4VPhysicalVolume * world
Definition: G4EzWorld.hh:53
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

Member Data Documentation

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

Definition at line 53 of file G4EzWorld.hh.

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


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