Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExG4DetectorConstruction01 Class Reference

Simple detector construction with only a world volume. More...

#include <ExG4DetectorConstruction01.hh>

Inheritance diagram for ExG4DetectorConstruction01:
Collaboration diagram for ExG4DetectorConstruction01:

Public Member Functions

 ExG4DetectorConstruction01 (const G4String &materialName="G4_AIR", G4double hx=50 *CLHEP::cm, G4double hy=50 *CLHEP::cm, G4double hz=50 *CLHEP::cm)
 
 ~ExG4DetectorConstruction01 ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void SetMaterial (const G4String &materialName)
 
void SetDimensions (G4double hx, G4double hy, G4double hz)
 
 ExG4DetectorConstruction01 (const G4String &materialName="G4_AIR", G4double hx=50 *CLHEP::cm, G4double hy=50 *CLHEP::cm, G4double hz=50 *CLHEP::cm)
 
 ~ExG4DetectorConstruction01 ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void SetMaterial (const G4String &materialName)
 
void SetDimensions (G4double hx, G4double hy, G4double hz)
 
 ExG4DetectorConstruction01 (const G4String &materialName="G4_AIR", G4double hx=50 *CLHEP::cm, G4double hy=50 *CLHEP::cm, G4double hz=50 *CLHEP::cm)
 
 ~ExG4DetectorConstruction01 ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void SetMaterial (const G4String &materialName)
 
void SetDimensions (G4double hx, G4double hy, G4double hz)
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Simple detector construction with only a world volume.

Definition at line 48 of file ExG4DetectorConstruction01.hh.

Constructor & Destructor Documentation

ExG4DetectorConstruction01::ExG4DetectorConstruction01 ( const G4String materialName = "G4_AIR",
G4double  hx = 50*CLHEP::cm,
G4double  hy = 50*CLHEP::cm,
G4double  hz = 50*CLHEP::cm 
)

Definition at line 42 of file ExG4DetectorConstruction01.cc.

46  fMessenger(this),
47  fMaterialName(materialName),
48  fDimensions(hx, hy, hz),
49  fWorldVolume(0)
50 {
51 }
ExG4DetectorConstruction01::~ExG4DetectorConstruction01 ( )

Definition at line 55 of file ExG4DetectorConstruction01.cc.

56 {
57 }
ExG4DetectorConstruction01::ExG4DetectorConstruction01 ( const G4String materialName = "G4_AIR",
G4double  hx = 50 *CLHEP::cm,
G4double  hy = 50 *CLHEP::cm,
G4double  hz = 50 *CLHEP::cm 
)
ExG4DetectorConstruction01::~ExG4DetectorConstruction01 ( )
ExG4DetectorConstruction01::ExG4DetectorConstruction01 ( const G4String materialName = "G4_AIR",
G4double  hx = 50 *CLHEP::cm,
G4double  hy = 50 *CLHEP::cm,
G4double  hz = 50 *CLHEP::cm 
)
ExG4DetectorConstruction01::~ExG4DetectorConstruction01 ( )

Member Function Documentation

G4VPhysicalVolume * ExG4DetectorConstruction01::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 61 of file ExG4DetectorConstruction01.cc.

62 {
63  // Define materials via NIST manager
64  //
65  G4NistManager* nistManager = G4NistManager::Instance();
66 
68  = nistManager->FindOrBuildMaterial(fMaterialName);
69 
70  // World
71  //
72  G4Box* sWorld
73  = new G4Box("World", //name
74  fDimensions.x(), //dimensions (half-lentghs)
75  fDimensions.y(),
76  fDimensions.z());
77 
78  fWorldVolume
79  = new G4LogicalVolume(sWorld, //shape
80  material, //material
81  "World"); //name
82 
83  G4VPhysicalVolume* pWorld
84  = new G4PVPlacement(0, //no rotation
85  G4ThreeVector(), //at (0,0,0)
86  fWorldVolume, //logical volume
87  "World", //name
88  0, //mother volume
89  false, //no boolean operation
90  0); //copy number
91 
92  //always return the root volume
93  //
94  return pWorld;
95 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
double x() const
Definition: G4Box.hh:64
static G4NistManager * Instance()
double z() const
string material
Definition: eplot.py:19
double y() const

Here is the call graph for this function:

virtual G4VPhysicalVolume* ExG4DetectorConstruction01::Construct ( )
virtual
virtual G4VPhysicalVolume* ExG4DetectorConstruction01::Construct ( )
virtual
void ExG4DetectorConstruction01::SetDimensions ( G4double  hx,
G4double  hy,
G4double  hz 
)

Set world dimension (in half lengths). This setting has effect only if called in PreInit> phase

Definition at line 118 of file ExG4DetectorConstruction01.cc.

120 {
123 
124  fDimensions = G4ThreeVector(hx, hy, hz);
125 }
CLHEP::Hep3Vector G4ThreeVector

Here is the caller graph for this function:

void ExG4DetectorConstruction01::SetDimensions ( G4double  hx,
G4double  hy,
G4double  hz 
)
void ExG4DetectorConstruction01::SetDimensions ( G4double  hx,
G4double  hy,
G4double  hz 
)
void ExG4DetectorConstruction01::SetMaterial ( const G4String materialName)

Definition at line 99 of file ExG4DetectorConstruction01.cc.

100 {
101  G4NistManager* nistManager = G4NistManager::Instance();
102 
103  G4Material* newMaterial
104  = nistManager->FindOrBuildMaterial(materialName);
105 
106  if ( ! newMaterial ) {
107  G4cerr << "Material " << materialName << " not found." << G4endl;
108  G4cerr << "The box material was not changed." << G4endl;
109  return;
110  }
111 
112  if ( fWorldVolume ) fWorldVolume->SetMaterial(newMaterial);
113  G4cout << "Material of box changed to " << materialName << G4endl;
114 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void SetMaterial(G4Material *pMaterial)
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

Here is the caller graph for this function:

void ExG4DetectorConstruction01::SetMaterial ( const G4String materialName)
void ExG4DetectorConstruction01::SetMaterial ( const G4String materialName)

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