Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
B1DetectorConstruction Class Reference

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

#include <Doxymodules_analysis.h>

Inheritance diagram for B1DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 B1DetectorConstruction ()
 
virtual ~B1DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
G4LogicalVolumeGetScoringVolume () const
 

Protected Attributes

G4LogicalVolumefScoringVolume
 

Detailed Description

Detector construction class to define materials and geometry.

Definition at line 48 of file Doxymodules_analysis.h.

Constructor & Destructor Documentation

◆ B1DetectorConstruction()

B1DetectorConstruction::B1DetectorConstruction ( )

◆ ~B1DetectorConstruction()

B1DetectorConstruction::~B1DetectorConstruction ( )
virtual

Definition at line 52 of file B1DetectorConstruction.cc.

53{ }

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * B1DetectorConstruction::Construct ( )
virtual

Definition at line 57 of file B1DetectorConstruction.cc.

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

◆ GetScoringVolume()

G4LogicalVolume * B1DetectorConstruction::GetScoringVolume ( ) const
inline

Definition at line 49 of file B1DetectorConstruction.hh.

49{ return fScoringVolume; }

Member Data Documentation

◆ fScoringVolume

G4LogicalVolume* B1DetectorConstruction::fScoringVolume
protected

Definition at line 52 of file B1DetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration