79{
80
81
82 G4double cryst_dX = 6*cm, cryst_dY = 6*cm, cryst_dZ = 3*cm;
83 G4int nb_cryst = 32;
84 G4int nb_rings = 9;
85
86 G4double dPhi = twopi/nb_cryst, half_dPhi = 0.5*dPhi;
87 G4double cosdPhi = std::cos(half_dPhi);
88 G4double tandPhi = std::tan(half_dPhi);
89
90 G4double ring_R1 = 0.5*cryst_dY/tandPhi;
91 G4double ring_R2 = (ring_R1+cryst_dZ)/cosdPhi;
92
93 G4double detector_dZ = nb_rings*cryst_dX;
94
96 G4Material* default_mat = nist->FindOrBuildMaterial(
"G4_AIR");
97 G4Material* cryst_mat = nist->FindOrBuildMaterial(
"Lu2SiO5");
98
99
100
101
102 G4double world_sizeXY = 2.4*ring_R2;
103 G4double world_sizeZ = 1.2*detector_dZ;
104
105 auto solidWorld =
new G4Box(
"World",
106 0.5 * world_sizeXY, 0.5 * world_sizeXY, 0.5 * world_sizeZ);
107
109 default_mat,
110 "World");
111
113 G4ThreeVector(),
114 logicWorld,
115 "World",
116 nullptr,
117 false,
118 0,
120
121
122
123
124 auto solidRing =
new G4Tubs(
"Ring", ring_R1, ring_R2, 0.5 * cryst_dX, 0., twopi);
125
127 default_mat,
128 "Ring");
129
130
131
132
133 G4double gap = 0.5*mm;
134 G4double dX = cryst_dX - gap, dY = cryst_dY - gap;
135 auto solidCryst =
new G4Box(
"crystal", dX / 2, dY / 2, cryst_dZ / 2);
136
138 cryst_mat,
139 "CrystalLV");
140
141
142
143 for (G4int icrys = 0; icrys < nb_cryst ; icrys++) {
144 G4double phi = icrys*dPhi;
145 G4RotationMatrix rotm = G4RotationMatrix();
146 rotm.rotateY(90*deg);
147 rotm.rotateZ(phi);
148 G4ThreeVector uz = G4ThreeVector(std::cos(phi), std::sin(phi),0.);
149 G4ThreeVector
position = (ring_R1+0.5*cryst_dZ)*uz;
150 G4Transform3D transform = G4Transform3D(rotm,
position);
151
153 logicCryst,
154 "crystal",
155 logicRing,
156 false,
157 icrys,
159 }
160
161
162
163
164 auto solidDetector =
new G4Tubs(
"Detector", ring_R1, ring_R2, 0.5 * detector_dZ, 0., twopi);
165
167 default_mat,
168 "Detector");
169
170
171
172
173 G4double OG = -0.5*(detector_dZ + cryst_dX);
174 for (G4int iring = 0; iring < nb_rings ; iring++) {
175 OG += cryst_dX;
177 G4ThreeVector(0, 0, OG),
178 logicRing,
179 "ring",
180 logicDetector,
181 false,
182 iring,
184 }
185
186
187
188
190 G4ThreeVector(),
191 logicDetector,
192 "Detector",
193 logicWorld,
194 false,
195 0,
197
198
199
200
201 G4double patient_radius = 8*cm;
202 G4double patient_dZ = 10*cm;
203 G4Material* patient_mat = nist->FindOrBuildMaterial(
"G4_BRAIN_ICRP");
204
205 auto solidPatient =
new G4Tubs(
"Patient", 0., patient_radius, 0.5 * patient_dZ, 0., twopi);
206
208 patient_mat,
209 "PatientLV");
210
211
212
213
215 G4ThreeVector(),
216 logicPatient,
217 "Patient",
218 logicWorld,
219 false,
220 0,
222
223
224
225 logicRing->SetVisAttributes (G4VisAttributes::GetInvisible());
226 logicDetector->SetVisAttributes (G4VisAttributes::GetInvisible());
227
228
229 G4cout << *(G4Material::GetMaterialTable()) << G4endl;
230
231
232
233 return physWorld;
234}