Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes
B1DetectorConstruction Class Reference

Detector construction class to define materials and geometry. More...

#include <B1DetectorConstruction.hh>

Inheritance diagram for B1DetectorConstruction:
G4VUserDetectorConstruction G4VUserDetectorConstruction G4VUserDetectorConstruction

Public Member Functions

 B1DetectorConstruction ()
 
virtual ~B1DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
G4LogicalVolumeGetScoringVolume () const
 
 B1DetectorConstruction ()
 
virtual ~B1DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
G4LogicalVolumeGetScoringVolume () const
 
 B1DetectorConstruction ()
 
virtual ~B1DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
- 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
 

Protected Attributes

G4LogicalVolumefScoringVolume
 

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

Detector construction class to define materials and geometry.

Definition at line 42 of file basic/B1/include/B1DetectorConstruction.hh.

Constructor & Destructor Documentation

B1DetectorConstruction::B1DetectorConstruction ( )
B1DetectorConstruction::~B1DetectorConstruction ( )
virtual

Definition at line 53 of file basic/B1/src/B1DetectorConstruction.cc.

54 { }
B1DetectorConstruction::B1DetectorConstruction ( )
virtual B1DetectorConstruction::~B1DetectorConstruction ( )
virtual
B1DetectorConstruction::B1DetectorConstruction ( )
virtual B1DetectorConstruction::~B1DetectorConstruction ( )
virtual

Member Function Documentation

G4VPhysicalVolume * B1DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 58 of file basic/B1/src/B1DetectorConstruction.cc.

References python.hepunit::cm, python.hepunit::deg, G4NistManager::FindOrBuildMaterial(), fScoringVolume, and G4NistManager::Instance().

59 {
60  // Get nist material manager
62 
63  // Envelope parameters
64  //
65  G4double env_sizeXY = 20*cm, env_sizeZ = 30*cm;
66  G4Material* env_mat = nist->FindOrBuildMaterial("G4_WATER");
67 
68  // Option to switch on/off checking of volumes overlaps
69  //
70  G4bool checkOverlaps = true;
71 
72  //
73  // World
74  //
75  G4double world_sizeXY = 1.2*env_sizeXY;
76  G4double world_sizeZ = 1.2*env_sizeZ;
77  G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
78 
79  G4Box* solidWorld =
80  new G4Box("World", //its name
81  0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //its size
82 
83  G4LogicalVolume* logicWorld =
84  new G4LogicalVolume(solidWorld, //its solid
85  world_mat, //its material
86  "World"); //its name
87 
88  G4VPhysicalVolume* physWorld =
89  new G4PVPlacement(0, //no rotation
90  G4ThreeVector(), //at (0,0,0)
91  logicWorld, //its logical volume
92  "World", //its name
93  0, //its mother volume
94  false, //no boolean operation
95  0, //copy number
96  checkOverlaps); //overlaps checking
97 
98  //
99  // Envelope
100  //
101  G4Box* solidEnv =
102  new G4Box("Envelope", //its name
103  0.5*env_sizeXY, 0.5*env_sizeXY, 0.5*env_sizeZ); //its size
104 
105  G4LogicalVolume* logicEnv =
106  new G4LogicalVolume(solidEnv, //its solid
107  env_mat, //its material
108  "Envelope"); //its name
109 
110  new G4PVPlacement(0, //no rotation
111  G4ThreeVector(), //at (0,0,0)
112  logicEnv, //its logical volume
113  "Envelope", //its name
114  logicWorld, //its mother volume
115  false, //no boolean operation
116  0, //copy number
117  checkOverlaps); //overlaps checking
118 
119  //
120  // Shape 1
121  //
122  G4Material* shape1_mat = nist->FindOrBuildMaterial("G4_A-150_TISSUE");
123  G4ThreeVector pos1 = G4ThreeVector(0, 2*cm, -7*cm);
124 
125  // Conical section shape
126  G4double shape1_rmina = 0.*cm, shape1_rmaxa = 2.*cm;
127  G4double shape1_rminb = 0.*cm, shape1_rmaxb = 4.*cm;
128  G4double shape1_hz = 3.*cm;
129  G4double shape1_phimin = 0.*deg, shape1_phimax = 360.*deg;
130  G4Cons* solidShape1 =
131  new G4Cons("Shape1",
132  shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb, shape1_hz,
133  shape1_phimin, shape1_phimax);
134 
135  G4LogicalVolume* logicShape1 =
136  new G4LogicalVolume(solidShape1, //its solid
137  shape1_mat, //its material
138  "Shape1"); //its name
139 
140  new G4PVPlacement(0, //no rotation
141  pos1, //at position
142  logicShape1, //its logical volume
143  "Shape1", //its name
144  logicEnv, //its mother volume
145  false, //no boolean operation
146  0, //copy number
147  checkOverlaps); //overlaps checking
148 
149 
150  //
151  // Shape 2
152  //
153  G4Material* shape2_mat = nist->FindOrBuildMaterial("G4_BONE_COMPACT_ICRU");
154  G4ThreeVector pos2 = G4ThreeVector(0, -1*cm, 7*cm);
155 
156  // Trapezoid shape
157  G4double shape2_dxa = 12*cm, shape2_dxb = 12*cm;
158  G4double shape2_dya = 10*cm, shape2_dyb = 16*cm;
159  G4double shape2_dz = 6*cm;
160  G4Trd* solidShape2 =
161  new G4Trd("Shape2", //its name
162  0.5*shape2_dxa, 0.5*shape2_dxb,
163  0.5*shape2_dya, 0.5*shape2_dyb, 0.5*shape2_dz); //its size
164 
165  G4LogicalVolume* logicShape2 =
166  new G4LogicalVolume(solidShape2, //its solid
167  shape2_mat, //its material
168  "Shape2"); //its name
169 
170  new G4PVPlacement(0, //no rotation
171  pos2, //at position
172  logicShape2, //its logical volume
173  "Shape2", //its name
174  logicEnv, //its mother volume
175  false, //no boolean operation
176  0, //copy number
177  checkOverlaps); //overlaps checking
178 
179  // Set Shape2 as scoring volume
180  //
181  fScoringVolume = logicShape2;
182 
183  //
184  //always return the physical World
185  //
186  return physWorld;
187 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:63
Definition: G4Trd.hh:71
static G4NistManager * Instance()
bool G4bool
Definition: G4Types.hh:79
Definition: G4Cons.hh:82
double G4double
Definition: G4Types.hh:76
virtual G4VPhysicalVolume* B1DetectorConstruction::Construct ( )
virtual
virtual G4VPhysicalVolume* B1DetectorConstruction::Construct ( )
virtual
G4LogicalVolume* B1DetectorConstruction::GetScoringVolume ( ) const
inline
G4LogicalVolume* B1DetectorConstruction::GetScoringVolume ( ) const
inline

Field Documentation

G4LogicalVolume * B1DetectorConstruction::fScoringVolume
protected

Definition at line 53 of file basic/B1/include/B1DetectorConstruction.hh.

Referenced by Construct(), and GetScoringVolume().


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