1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // $Id: AXPETDetectorConstruction.cc,v 1.2 2010/11/16 13:35:53 tnikitin Exp $ |
---|
27 | // ------------------------------------------------------------ |
---|
28 | // Geant4 class implementation file |
---|
29 | // |
---|
30 | // 03/09/2008, by T.Nikitina |
---|
31 | // ------------------------------------------------------------ |
---|
32 | |
---|
33 | #include "AXPETDetectorConstruction.hh" |
---|
34 | #include "AXPETDetectorMessenger.hh" |
---|
35 | |
---|
36 | //Solids |
---|
37 | #include "G4Box.hh" |
---|
38 | #include "G4Tubs.hh" |
---|
39 | #include "G4Sphere.hh" |
---|
40 | #include "G4Orb.hh" |
---|
41 | #include "G4Cons.hh" |
---|
42 | #include "G4Hype.hh" |
---|
43 | #include "G4Para.hh" |
---|
44 | #include "G4Paraboloid.hh" |
---|
45 | #include "G4Torus.hh" |
---|
46 | #include "G4Trd.hh" |
---|
47 | #include "G4Ellipsoid.hh" |
---|
48 | #include "G4EllipticalTube.hh" |
---|
49 | #include "G4EllipticalCone.hh" |
---|
50 | |
---|
51 | #include "G4Trap.hh" |
---|
52 | #include "G4Trd.hh" |
---|
53 | #include "G4Tet.hh" |
---|
54 | #include "G4GenericTrap.hh" |
---|
55 | #include "G4TessellatedSolid.hh" |
---|
56 | #include "G4ExtrudedSolid.hh" |
---|
57 | |
---|
58 | #include "G4Polycone.hh" |
---|
59 | #include "G4Polyhedra.hh" |
---|
60 | |
---|
61 | #include "G4TwistedTubs.hh" |
---|
62 | #include "G4TwistedBox.hh" |
---|
63 | #include "G4TwistedTrd.hh" |
---|
64 | #include "G4TwistedTrap.hh" |
---|
65 | |
---|
66 | #include "G4TwoVector.hh" |
---|
67 | #include "G4TriangularFacet.hh" |
---|
68 | #include "G4QuadrangularFacet.hh" |
---|
69 | |
---|
70 | #include "G4BooleanSolid.hh" |
---|
71 | #include "G4DisplacedSolid.hh" |
---|
72 | #include "G4UnionSolid.hh" |
---|
73 | #include "G4IntersectionSolid.hh" |
---|
74 | #include "G4SubtractionSolid.hh" |
---|
75 | #include "G4ReflectedSolid.hh" |
---|
76 | #include "G4RotationMatrix.hh" |
---|
77 | #include "G4BREPSolidBox.hh" |
---|
78 | // |
---|
79 | #include "G4LogicalVolume.hh" |
---|
80 | #include "G4PVPlacement.hh" |
---|
81 | #include "G4PVReplica.hh" |
---|
82 | #include "G4ThreeVector.hh" |
---|
83 | #include "G4RotationMatrix.hh" |
---|
84 | |
---|
85 | #include "G4RunManager.hh" |
---|
86 | #include "G4GeometryManager.hh" |
---|
87 | #include "G4PhysicalVolumeStore.hh" |
---|
88 | #include "G4LogicalVolumeStore.hh" |
---|
89 | #include "G4SolidStore.hh" |
---|
90 | |
---|
91 | #include "G4MaterialPropertiesTable.hh" |
---|
92 | #include "G4OpticalSurface.hh" |
---|
93 | #include "G4LogicalSkinSurface.hh" |
---|
94 | #include "G4LogicalBorderSurface.hh" |
---|
95 | #include "AXPETMaterial.hh" |
---|
96 | |
---|
97 | #include "G4VisAttributes.hh" |
---|
98 | #include "G4Colour.hh" |
---|
99 | |
---|
100 | #include "globals.hh" |
---|
101 | |
---|
102 | AXPETDetectorConstruction::AXPETDetectorConstruction(): |
---|
103 | WorldVolume(0),LogWorldVolume(0),PhysWorldVolume(0), |
---|
104 | LYSOVolume(0),LogLYSOVolume(0), PhysLYSOVolume(0)//, |
---|
105 | //InterVolume(0),LogInterVolume(0), PhysInterVolume(0), |
---|
106 | //DetecVolume(0),LogDetecVolume(0), PhysDetecVolume(0) |
---|
107 | { |
---|
108 | pttoMaterial = new AXPETMaterial(); |
---|
109 | |
---|
110 | worldXsize = 20. *cm; |
---|
111 | worldYsize = 20. *cm; |
---|
112 | worldZsize = 20. *cm; |
---|
113 | |
---|
114 | lysoIz = 2.0 *mm; |
---|
115 | lysoDz = 0.1 *mm; |
---|
116 | lysoR = 6.0 *mm; |
---|
117 | |
---|
118 | detectorMessenger = new AXPETDetectorMessenger(this); |
---|
119 | fval="Tubs"; |
---|
120 | |
---|
121 | xRot=0.0; |
---|
122 | yRot=0.0; |
---|
123 | zRot=0.0; |
---|
124 | fAbort=0; |
---|
125 | } |
---|
126 | |
---|
127 | AXPETDetectorConstruction::~AXPETDetectorConstruction() |
---|
128 | { delete detectorMessenger; } |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | void AXPETDetectorConstruction::SwitchDetector() |
---|
133 | { |
---|
134 | |
---|
135 | G4RunManager::GetRunManager()->DefineWorldVolume(PhysWorldVolume); |
---|
136 | |
---|
137 | } |
---|
138 | G4VSolid* |
---|
139 | AXPETDetectorConstruction::SelectDetector( const G4String& val ) |
---|
140 | { |
---|
141 | |
---|
142 | G4Box* b1 = new G4Box ( "b1", 1*mm, 0.5*mm, 0.50*mm ); |
---|
143 | G4Box* b2 = new G4Box ( "b2", 0.5*mm, 1*mm, 0.5*mm ); |
---|
144 | |
---|
145 | fval = val ; |
---|
146 | G4double fTrackerR1,fTrackerR2,fPhi,fPhiSegment,fTheta,fThetaSegment ; |
---|
147 | G4double fSemiAxisX,fSemiAxisY,fSemiAxisZ ; |
---|
148 | G4double fTrackerR,fTrackerpDx1,fTrackerpDy1,fTrackerpDz; |
---|
149 | if (val == "Sphere") |
---|
150 | { |
---|
151 | // only solid sphere is supportet for now |
---|
152 | fTrackerR1 = 0*mm ; |
---|
153 | fTrackerR2 = (lysoR-0.01*mm)/2. ; |
---|
154 | fPhi = 0*deg ; |
---|
155 | fPhiSegment = 360*deg ; |
---|
156 | fTheta = 0*deg ; |
---|
157 | fThetaSegment = 180*deg ; |
---|
158 | aVolume = new G4Sphere ("aSphere", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
159 | } |
---|
160 | |
---|
161 | else if (val == "HalfSphere") |
---|
162 | { |
---|
163 | // only solid sphere is supportet for now |
---|
164 | fTrackerR1 = 0. ; |
---|
165 | fTrackerR2 = (lysoR-0.01*mm)/2. ; |
---|
166 | fPhi = 0*deg ; |
---|
167 | fPhiSegment = 180*deg ; |
---|
168 | fTheta = 0*deg ; |
---|
169 | fThetaSegment = 180*deg ; |
---|
170 | aVolume = new G4Sphere ("aHalfSphere", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
171 | |
---|
172 | } |
---|
173 | else if (val == "HollowSphere") |
---|
174 | { |
---|
175 | // only solid sphere is supportet for now |
---|
176 | fTrackerR1 = (lysoR-0.01*mm)/4.; |
---|
177 | fTrackerR2 = (lysoR-0.01*mm)/2. ; |
---|
178 | fPhi = 0*deg ; |
---|
179 | fPhiSegment = 360*deg ; |
---|
180 | fTheta = 0*deg ; |
---|
181 | fThetaSegment = 180*deg ; |
---|
182 | aVolume = new G4Sphere ("aHollowSphere", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
183 | |
---|
184 | } |
---|
185 | else if (val == "HalfHollowSphere") |
---|
186 | { |
---|
187 | // only solid sphere is supportet for now |
---|
188 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
189 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
190 | fPhi = 0*deg ; |
---|
191 | fPhiSegment = 180*deg ; |
---|
192 | fTheta = 0*deg ; |
---|
193 | fThetaSegment = 180*deg ; |
---|
194 | aVolume = new G4Sphere ("aHalfHollowSphere", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
195 | |
---|
196 | } |
---|
197 | else if (val == "Q1Shell") |
---|
198 | { |
---|
199 | // only solid sphere is supportet for now |
---|
200 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
201 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
202 | fPhi = 0*deg ; |
---|
203 | fPhiSegment = 90*deg ; |
---|
204 | fTheta = 0*deg ; |
---|
205 | fThetaSegment = 90*deg ; |
---|
206 | aVolume = new G4Sphere ("aQ1Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
207 | |
---|
208 | } |
---|
209 | else if (val == "Q2Shell") |
---|
210 | { |
---|
211 | // only solid sphere is supportet for now |
---|
212 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
213 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
214 | fPhi = 90*deg ; |
---|
215 | fPhiSegment = 90*deg ; |
---|
216 | fTheta = 0*deg ; |
---|
217 | fThetaSegment = 90*deg ; |
---|
218 | aVolume = new G4Sphere ("aQ2Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
219 | |
---|
220 | } |
---|
221 | else if (val == "Q3Shell") |
---|
222 | { |
---|
223 | // only solid sphere is supportet for now |
---|
224 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
225 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
226 | fPhi = 180*deg ; |
---|
227 | fPhiSegment = 90*deg ; |
---|
228 | fTheta = 0*deg ; |
---|
229 | fThetaSegment = 90*deg ; |
---|
230 | aVolume = new G4Sphere ("aQ3Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
231 | |
---|
232 | } |
---|
233 | else if (val == "Q4Shell") |
---|
234 | { |
---|
235 | // only solid sphere is supportet for now |
---|
236 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
237 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
238 | fPhi = 270*deg ; |
---|
239 | fPhiSegment = 90*deg ; |
---|
240 | fTheta = 0*deg ; |
---|
241 | fThetaSegment = 90*deg ; |
---|
242 | aVolume = new G4Sphere ("aQ4Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
243 | |
---|
244 | } |
---|
245 | else if (val == "Q5Shell") |
---|
246 | { |
---|
247 | // only solid sphere is supportet for now |
---|
248 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
249 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
250 | fPhi = 0*deg ; |
---|
251 | fPhiSegment = 90*deg ; |
---|
252 | fTheta = 90*deg ; |
---|
253 | fThetaSegment = 90*deg ; |
---|
254 | aVolume = new G4Sphere ("aQ5Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
255 | |
---|
256 | } |
---|
257 | else if (val == "Q6Shell") |
---|
258 | { |
---|
259 | // only solid sphere is supportet for now |
---|
260 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
261 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
262 | fPhi = 90*deg ; |
---|
263 | fPhiSegment = 90*deg ; |
---|
264 | fTheta = 90*deg ; |
---|
265 | fThetaSegment = 90*deg ; |
---|
266 | aVolume = new G4Sphere ("aQ5Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
267 | |
---|
268 | } |
---|
269 | else if (val == "Q7Shell") |
---|
270 | { |
---|
271 | // only solid sphere is supportet for now |
---|
272 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
273 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
274 | fPhi = 180*deg ; |
---|
275 | fPhiSegment = 90*deg ; |
---|
276 | fTheta = 90*deg ; |
---|
277 | fThetaSegment = 90*deg ; |
---|
278 | aVolume = new G4Sphere ("aQ7Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
279 | |
---|
280 | } |
---|
281 | else if (val == "Q8Shell") |
---|
282 | { |
---|
283 | // only solid sphere is supportet for now |
---|
284 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
285 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
286 | fPhi = 270*deg ; |
---|
287 | fPhiSegment = 90*deg ; |
---|
288 | fTheta = 90*deg ; |
---|
289 | fThetaSegment = 90*deg ; |
---|
290 | aVolume = new G4Sphere ("aQ8Shell", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
291 | |
---|
292 | } |
---|
293 | |
---|
294 | |
---|
295 | else if (val == "Shell") |
---|
296 | { |
---|
297 | |
---|
298 | // Test for Problem Report with Optical Photons and Sphere or Ellipsoid |
---|
299 | G4Sphere *newSOut = new G4Sphere("Crystal",0.,lysoR-0.01/mm,0,twopi,0,pi/2); |
---|
300 | G4Sphere *newSIn = new G4Sphere("Crystal",0.,lysoR-4.01/mm,0,twopi,0,twopi); |
---|
301 | |
---|
302 | // Box was added in user application in order to avoid problem with Sphere with theta=90 deg |
---|
303 | // Not need anymore, this bug in Sphere was repared in 4.9.2. |
---|
304 | // G4Box* farMirrorBox2 = new G4Box("nearMirrorBox", lysoR-0.01/mm, |
---|
305 | // lysoR-0.01/mm, lysoR-0.01/mm); |
---|
306 | // aVolume = new G4IntersectionSolid("GlassMirror", farMirrorBox2,shell,0,G4ThreeVector(0,0,-lysoR)); |
---|
307 | aVolume = new G4SubtractionSolid("OutsideminInside", newSOut, newSIn); |
---|
308 | |
---|
309 | } |
---|
310 | else if (val == "Ring") |
---|
311 | { |
---|
312 | // only solid sphere is supportet for now |
---|
313 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
314 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
315 | fPhi = 30*deg ; |
---|
316 | fPhiSegment = 120*deg ; |
---|
317 | fTheta = 10*deg ; |
---|
318 | fThetaSegment = 40*deg ; |
---|
319 | aVolume = new G4Sphere ("aRing", fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment); |
---|
320 | |
---|
321 | } |
---|
322 | else if ( val == "Ellipsoid" ) { |
---|
323 | |
---|
324 | fSemiAxisX = (lysoR-0.01*mm)/4. ; |
---|
325 | fSemiAxisY = (lysoR-0.01*mm)/2. ; |
---|
326 | fSemiAxisZ = (lysoR-0.01*mm)/2. ; |
---|
327 | |
---|
328 | aVolume = new G4Ellipsoid("aEllipsoid", |
---|
329 | fSemiAxisX, |
---|
330 | fSemiAxisY, |
---|
331 | fSemiAxisZ, |
---|
332 | -fSemiAxisX,fSemiAxisX); |
---|
333 | |
---|
334 | |
---|
335 | } |
---|
336 | else if (val == "Orb") |
---|
337 | { |
---|
338 | |
---|
339 | fTrackerR = (lysoR-0.01*mm)/2. ; |
---|
340 | aVolume = new G4Orb ( "aOrb", fTrackerR ); |
---|
341 | |
---|
342 | } |
---|
343 | else if (val == "Box") |
---|
344 | { |
---|
345 | |
---|
346 | fTrackerpDx1 = (lysoR-0.01*mm)/2. ; |
---|
347 | fTrackerpDy1 = (lysoR-0.01*mm)/2. ; |
---|
348 | fTrackerpDz = (lysoR-0.01*mm)/2. ; |
---|
349 | |
---|
350 | aVolume = new G4Box ( "aBox", fTrackerpDx1, fTrackerpDy1, fTrackerpDz ); |
---|
351 | } |
---|
352 | else if (val == "Cons") |
---|
353 | { |
---|
354 | |
---|
355 | fTrackerpDz =(lysoR-0.01*mm)/2. ; |
---|
356 | fTrackerR1 =(lysoR-0.01*mm)/4. ; |
---|
357 | fTrackerR2 =(lysoR-0.01*mm)/2. ; |
---|
358 | |
---|
359 | aVolume = new G4Cons ( "aCons", 0.8*fTrackerR1 , fTrackerR1, 0.8*fTrackerR2, fTrackerR2, fTrackerpDz, 10*deg, 220.*deg ); |
---|
360 | |
---|
361 | } |
---|
362 | else if (val == "manyCons") |
---|
363 | { |
---|
364 | aVolume = new G4Cons ( "aCone", 2*mm, 3*mm, 2*mm, 4*mm, |
---|
365 | 3.*mm, 10*deg, 300*deg ); |
---|
366 | // 10*cm, 10*deg, 300*deg ); |
---|
367 | // 0., pi); |
---|
368 | |
---|
369 | |
---|
370 | } |
---|
371 | else if (val == "Tubs") |
---|
372 | { |
---|
373 | |
---|
374 | // only solid Tube is supported. |
---|
375 | |
---|
376 | aVolume = new G4Tubs ( "aTube",0.1,5.9*mm,3.*mm,0.,180*deg) ; |
---|
377 | |
---|
378 | } |
---|
379 | else if (val == "Hype") |
---|
380 | { |
---|
381 | aVolume = new G4Hype ("aHype", 0.7, 1, 40*deg, 40*deg, 4. ); |
---|
382 | } |
---|
383 | else if (val == "Torus") |
---|
384 | { |
---|
385 | |
---|
386 | fPhi = 40*deg ; |
---|
387 | fPhiSegment = 200*deg ; |
---|
388 | |
---|
389 | fTrackerR1 = 1.*mm ; |
---|
390 | fTrackerR2 = 2.*mm ; |
---|
391 | fTrackerR = (lysoR-0.01*mm) ; |
---|
392 | |
---|
393 | aVolume = new G4Torus("aTorus", fTrackerR1, fTrackerR2 ,fTrackerR, fPhi, fPhiSegment) ; |
---|
394 | |
---|
395 | } |
---|
396 | else if (val == "Para") |
---|
397 | { |
---|
398 | aVolume = new G4Para ("aPara", 0.8, 1.0, 1.2, 30*deg, 45*deg, 60*deg); |
---|
399 | } |
---|
400 | else if (val == "Paraboloid") |
---|
401 | { |
---|
402 | aVolume = new G4Paraboloid ("aParaboloid", 1., 0.5, 1.2); |
---|
403 | } |
---|
404 | else if (val == "PolyconeGen") |
---|
405 | { |
---|
406 | G4double rr[]={1,1.20,1.40,1.20}; |
---|
407 | G4double zz[]={-1,-1,1,1}; |
---|
408 | aVolume = new G4Polycone ("aPolycone",0*deg,90*deg, 4, rr,zz); |
---|
409 | } |
---|
410 | else if (val == "PolyconeGenComplex") |
---|
411 | { //has to be apdated |
---|
412 | G4double zPlanes[] = {-11640.*mm, -11640.*mm, -11570.722*mm, -9766.005*mm, |
---|
413 | -4487.828*mm, 4487.828*mm, 9766.005*mm, 11570.722*mm, |
---|
414 | 11640.*mm, 11640.*mm, 11580.*mm, 9750.*mm, |
---|
415 | 4500.*mm, -4500.*mm, -9750.*mm, -11580.*mm, |
---|
416 | -11640.*mm}; |
---|
417 | |
---|
418 | G4double radius[] = {250.*mm, 305.*mm, 305.*mm, 2770.461*mm, |
---|
419 | 4932.*mm, 4932.*mm, 2770.461*mm, 305.*mm, |
---|
420 | 305.*mm, 250.*mm, 250.*mm, 2750.*mm, |
---|
421 | 4900.*mm, 4900.*mm, 2750.*mm, 250.*mm, |
---|
422 | 250.*mm}; |
---|
423 | aVolume = new G4Polycone ("aPolycone",0*deg,360*deg, 16, radius,zPlanes); |
---|
424 | G4VSolid* SolidPumpPort = new G4Tubs("PumpPort temp tube", 0 * mm, 1750 / 2 * mm, (11161 - 4500) / 2 * mm-1*mm, 0, 360 * deg); |
---|
425 | for (int i=0;i<2;i++) |
---|
426 | { |
---|
427 | G4RotationMatrix* Rot = new G4RotationMatrix(); |
---|
428 | Rot->rotateZ(45*(-i-1) * deg ); |
---|
429 | G4double X = std::cos(45*(i+1)*deg)*-(3050+4750)/2*mm; |
---|
430 | G4double Y = std::sin(45*(i+1)*deg)*-(3050+4750)/2*mm; |
---|
431 | aVolume = new G4SubtractionSolid("Main Spectrometer", aVolume, SolidPumpPort, |
---|
432 | Rot, G4ThreeVector(X, Y,(11161+4500)/2*mm - 100 * mm)); |
---|
433 | } |
---|
434 | |
---|
435 | |
---|
436 | |
---|
437 | } |
---|
438 | else if (val == "Polycone") |
---|
439 | { |
---|
440 | G4double rIn[]={1.00,1.20,0,0,1.20,1.20}; |
---|
441 | G4double rOut[]={1.20,1.40,1.40,1.20,1.40,1.60}; |
---|
442 | G4double zPlane[]={-2.00,-1.00,0,1.00,2.00,3.00}; |
---|
443 | aVolume = new G4Polycone ("aPolycone",0*deg,260*deg, 6,zPlane, rIn,rOut); |
---|
444 | } |
---|
445 | else if (val == "PolyhedraGen") |
---|
446 | { |
---|
447 | G4double rr[]={1.00,1.20,1.40,1.20}; |
---|
448 | G4double zz[]={-1.00,-1.00,1.00,1.00}; |
---|
449 | aVolume = new G4Polyhedra ("aPolycone",0*deg,90*deg,8, 4, rr,zz); |
---|
450 | } |
---|
451 | else if (val == "PolyhedraGenComplex") |
---|
452 | { |
---|
453 | G4double rr[]={ 1.00, 1.20, 0, 0,1.40,1.20,1.50,1.50,1.50,1.40, 1.30}; |
---|
454 | G4double zz[]={-1.50,-1.00,-1.00,-0.50, 0,2.00,2.00,1.00,0, -0.50,-1.00}; |
---|
455 | aVolume = new G4Polyhedra ("aPolycone",0*deg,260*deg,8, 11, rr,zz); |
---|
456 | } |
---|
457 | else if (val == "Polyhedra") |
---|
458 | { |
---|
459 | G4double rOut[5]={2.100,0.600,1.500,1.500,3.800}; |
---|
460 | G4double rIn[5]={0,0.500,0,0.700,0.100}; |
---|
461 | G4double zPlane[5]={-0.100,1.000,1.500,2.500,3.000}; |
---|
462 | aVolume = new G4Polyhedra ("aPolycone",0*deg,260*deg,6, 5,zPlane, rIn,rOut); |
---|
463 | } |
---|
464 | |
---|
465 | else if (val == "Trd") |
---|
466 | { |
---|
467 | aVolume = new G4Trd ("aTrd", 0.80, 1.00, 0.70,0.90, 1.00); |
---|
468 | } |
---|
469 | else if (val == "b1Ub2") |
---|
470 | { |
---|
471 | aVolume = new G4UnionSolid("b1Ub2",b1,b2); |
---|
472 | |
---|
473 | } |
---|
474 | else if (val == "b1Ib2") |
---|
475 | { |
---|
476 | aVolume = new G4IntersectionSolid("b1Ib2",b1,b2); |
---|
477 | } |
---|
478 | else if (val == "b1Sb2") |
---|
479 | { |
---|
480 | aVolume = new G4SubtractionSolid("b1Sb2",b1,b2); |
---|
481 | } |
---|
482 | else if (val == "b1Ib1") |
---|
483 | { |
---|
484 | aVolume = new G4IntersectionSolid("b1Ib1",b1,b1); |
---|
485 | } |
---|
486 | else if (val == "b1Ub1") |
---|
487 | { |
---|
488 | aVolume = new G4UnionSolid("b1Ub1",b1,b1); |
---|
489 | } |
---|
490 | else if (val == "b1Sb1") |
---|
491 | { |
---|
492 | aVolume = new G4SubtractionSolid("b1Sb1",b1,b1); |
---|
493 | } |
---|
494 | |
---|
495 | else if ( val == "Tet" ) |
---|
496 | { |
---|
497 | G4ThreeVector anchor = G4ThreeVector( 0, 0, 0); |
---|
498 | G4ThreeVector p2 = G4ThreeVector(1.0, 0.5, 0); |
---|
499 | G4ThreeVector p3 = G4ThreeVector(0.5, 1.0, 0); |
---|
500 | G4ThreeVector p4 = G4ThreeVector(0.5, 0.5, 1.0); |
---|
501 | |
---|
502 | aVolume = new G4Tet("aTet",anchor,p2,p3,p4); |
---|
503 | } |
---|
504 | else if ( val == "Trap") |
---|
505 | { |
---|
506 | fTrackerpDz = 0.80; |
---|
507 | fTheta = 10*deg ; |
---|
508 | fPhi = 40*deg ; |
---|
509 | fTrackerpDy1 = 1.6 ; |
---|
510 | fTrackerpDx1 = 2.4 ; |
---|
511 | G4double fTrackerpDx2 = 1.4 ; |
---|
512 | G4double fTrackerpDy2 = 0.8 ; |
---|
513 | G4double fTrackerpDx3 = 1.6 ; |
---|
514 | G4double fTrackerpDx4 = 1.1 ; |
---|
515 | G4double fAlph = 50*deg ; |
---|
516 | |
---|
517 | aVolume = new G4Trap("aTrap", |
---|
518 | fTrackerpDz, // half z length |
---|
519 | fTheta, // direction between end planes |
---|
520 | fPhi, // defined by polar and azimutal angles. |
---|
521 | fTrackerpDy1, // half y length at -pDz |
---|
522 | fTrackerpDx1, // half x length at -pDz,-pDy |
---|
523 | fTrackerpDx2, // half x length at -pDz,+pDy |
---|
524 | fAlph, // tilt angle at +pDz |
---|
525 | fTrackerpDy2, // half y length at +pDz |
---|
526 | fTrackerpDx3, // half x length at +pDz,-pDy |
---|
527 | fTrackerpDx4, // half x length at +pDz,+pDy |
---|
528 | fAlph // tilt angle at +pDz |
---|
529 | ) ; |
---|
530 | |
---|
531 | |
---|
532 | } |
---|
533 | else if ( val == "EllipticalCone" ) |
---|
534 | { |
---|
535 | aVolume = new G4EllipticalCone("aEllipticalCone", |
---|
536 | 0.5, // xSemiAxis |
---|
537 | 1, // ySemiAxis |
---|
538 | 4.0, // zheight |
---|
539 | 2.5) ; // zTopCut |
---|
540 | |
---|
541 | } |
---|
542 | else if ( val == "EllipticalTube" ) |
---|
543 | { |
---|
544 | aVolume = new G4EllipticalTube("aEllipticalTube" , |
---|
545 | 2, // xSemiAxis |
---|
546 | 4, // ySemiAxis |
---|
547 | 3.5) ; // zheight |
---|
548 | |
---|
549 | } |
---|
550 | |
---|
551 | else if (val == "TwistedBox") |
---|
552 | { |
---|
553 | aVolume = new G4TwistedBox("aTwistedBox",40*deg,0.5,1.0,1.5); |
---|
554 | } |
---|
555 | else if (val == "TwistedTrd") |
---|
556 | { |
---|
557 | aVolume = new G4TwistedTrd("aTwistedTrd",0.5,1.0,0.8,1.5,1.8,20*deg); |
---|
558 | } |
---|
559 | else if (val == "TwistedTrap") |
---|
560 | { |
---|
561 | aVolume = new G4TwistedTrap("aTwistedTrap",40*deg,0.5,1.0,0.8,1.5); |
---|
562 | } |
---|
563 | else if ( val == "TwistedTrap2") |
---|
564 | { |
---|
565 | aVolume = new G4TwistedTrap("aTwistedTrap2", |
---|
566 | 20*deg, // twist angle |
---|
567 | 0.80, // half z length |
---|
568 | 10*deg, // direction between end planes |
---|
569 | 40*deg, // defined by polar and azimutal angles. |
---|
570 | 0.8, // half y length at -pDz |
---|
571 | 1.1, // half x length at -pDz,-pDy |
---|
572 | 1.6, // half x length at -pDz,+pDy |
---|
573 | 0.8, // half y length at +pDz |
---|
574 | 1.1, // half x length at +pDz,-pDy |
---|
575 | 1.6, // half x length at +pDz,+pDy |
---|
576 | -50*deg // tilt angle at +pDz |
---|
577 | ) ; |
---|
578 | } |
---|
579 | else if ( val == "TwistedTubs") |
---|
580 | { |
---|
581 | aVolume = new G4TwistedTubs("aTwistedTubs",10.*deg,1.0,2.,4.,171.*deg); |
---|
582 | |
---|
583 | } |
---|
584 | else if (val == "GenericTrap" ){ |
---|
585 | std::vector<G4TwoVector> vertices; |
---|
586 | vertices.push_back(G4TwoVector( -4.5, -4.5)); |
---|
587 | vertices.push_back(G4TwoVector( -4.5, 4.5)); |
---|
588 | vertices.push_back(G4TwoVector( 4.5, 4.5)); |
---|
589 | vertices.push_back(G4TwoVector( 4.5, -4.5)); |
---|
590 | vertices.push_back(G4TwoVector( -3.5, -3.5)); |
---|
591 | vertices.push_back(G4TwoVector( -3.5, 3.5)); |
---|
592 | vertices.push_back(G4TwoVector( 3.5, 3.5)); |
---|
593 | vertices.push_back(G4TwoVector( 3.5, -2.5)); |
---|
594 | aVolume = new G4GenericTrap("aGenTrd",4.,vertices); |
---|
595 | } |
---|
596 | else if(val == "TessellatedSolid") |
---|
597 | { |
---|
598 | G4double targetSize = 2.; |
---|
599 | G4TessellatedSolid* aVolume1 = new G4TessellatedSolid("aTessellatedSolid"); |
---|
600 | G4TriangularFacet *facet1 = new |
---|
601 | G4TriangularFacet (G4ThreeVector(-targetSize,-targetSize, 0.0), |
---|
602 | G4ThreeVector(+targetSize,-targetSize, 0.0), |
---|
603 | G4ThreeVector( 0.0, 0.0,+targetSize), |
---|
604 | ABSOLUTE); |
---|
605 | G4TriangularFacet *facet2 = new |
---|
606 | G4TriangularFacet (G4ThreeVector(+targetSize,-targetSize, 0.0), |
---|
607 | G4ThreeVector(+targetSize,+targetSize, 0.0), |
---|
608 | G4ThreeVector( 0.0, 0.0,+targetSize), |
---|
609 | ABSOLUTE); |
---|
610 | G4TriangularFacet *facet3 = new |
---|
611 | G4TriangularFacet (G4ThreeVector(+targetSize,+targetSize, 0.0), |
---|
612 | G4ThreeVector(-targetSize,+targetSize, 0.0), |
---|
613 | G4ThreeVector( 0.0, 0.0,+targetSize), |
---|
614 | ABSOLUTE); |
---|
615 | G4TriangularFacet *facet4 = new |
---|
616 | G4TriangularFacet (G4ThreeVector(-targetSize,+targetSize, 0.0), |
---|
617 | G4ThreeVector(-targetSize,-targetSize, 0.0), |
---|
618 | G4ThreeVector( 0.0, 0.0,+targetSize), |
---|
619 | ABSOLUTE); |
---|
620 | G4QuadrangularFacet *facet5 = new |
---|
621 | G4QuadrangularFacet (G4ThreeVector(-targetSize,-targetSize, 0.0), |
---|
622 | G4ThreeVector(-targetSize,+targetSize, 0.0), |
---|
623 | G4ThreeVector(+targetSize,+targetSize, 0.0), |
---|
624 | G4ThreeVector(+targetSize,-targetSize, 0.0), |
---|
625 | ABSOLUTE); |
---|
626 | |
---|
627 | aVolume1->AddFacet((G4VFacet*) facet1); |
---|
628 | aVolume1->AddFacet((G4VFacet*) facet2); |
---|
629 | aVolume1->AddFacet((G4VFacet*) facet3); |
---|
630 | aVolume1->AddFacet((G4VFacet*) facet4); |
---|
631 | aVolume1->AddFacet((G4VFacet*) facet5); |
---|
632 | |
---|
633 | aVolume1->SetSolidClosed(true); |
---|
634 | |
---|
635 | aVolume = aVolume1; |
---|
636 | |
---|
637 | } |
---|
638 | else if (val == "ExtrudedSolid") |
---|
639 | { |
---|
640 | std::vector<G4TwoVector> polygon; |
---|
641 | polygon.push_back(G4TwoVector(-3., -3.0)); |
---|
642 | polygon.push_back(G4TwoVector(-3., 3.0)); |
---|
643 | polygon.push_back(G4TwoVector( 3., 3.0)); |
---|
644 | polygon.push_back(G4TwoVector( 3., -3.0)); |
---|
645 | polygon.push_back(G4TwoVector( 1.5, -3.0)); |
---|
646 | polygon.push_back(G4TwoVector( 1.5, 1.5)); |
---|
647 | polygon.push_back(G4TwoVector(-1.5, 1.5)); |
---|
648 | polygon.push_back(G4TwoVector(-1.5, -3.0)); |
---|
649 | |
---|
650 | std::vector<G4ExtrudedSolid::ZSection> zsections; |
---|
651 | zsections.push_back(G4ExtrudedSolid::ZSection(-4.0, G4TwoVector(-2.0, 1.0), 1.5)); |
---|
652 | zsections.push_back(G4ExtrudedSolid::ZSection( 1.0, G4TwoVector( 0, 0), 0.5)); |
---|
653 | zsections.push_back(G4ExtrudedSolid::ZSection( 1.5, G4TwoVector( 0, 0), 0.7)); |
---|
654 | zsections.push_back(G4ExtrudedSolid::ZSection( 4.0, G4TwoVector( 2.0, 2.0), 0.9)); |
---|
655 | |
---|
656 | aVolume = new G4ExtrudedSolid("aExtrudedSolid", polygon, zsections); |
---|
657 | } |
---|
658 | |
---|
659 | |
---|
660 | else |
---|
661 | { G4cout <<"DetectorConstruction tried to select "<<val<<G4endl; |
---|
662 | G4Exception("DetectorConstruction::SelectDetector() - Invalid shape!"); |
---|
663 | } |
---|
664 | |
---|
665 | return aVolume; |
---|
666 | |
---|
667 | } |
---|
668 | G4VPhysicalVolume* AXPETDetectorConstruction::Construct() |
---|
669 | { |
---|
670 | //*********************************************** |
---|
671 | // Clear all Stores |
---|
672 | //*********************************************** |
---|
673 | |
---|
674 | G4GeometryManager::GetInstance()->OpenGeometry(); |
---|
675 | G4PhysicalVolumeStore::GetInstance()->Clean(); |
---|
676 | G4LogicalVolumeStore::GetInstance()->Clean(); |
---|
677 | G4SolidStore::GetInstance()->Clean(); |
---|
678 | |
---|
679 | pttoMaterial->DefineMaterials(); |
---|
680 | |
---|
681 | air = pttoMaterial->GetMat("AIR"); |
---|
682 | lyso= pttoMaterial->GetMat("LYSO"); |
---|
683 | vacuum= pttoMaterial->GetMat("Galactic"); |
---|
684 | |
---|
685 | |
---|
686 | //*********************************************** |
---|
687 | // Defining the world volume |
---|
688 | //*********************************************** |
---|
689 | |
---|
690 | WorldVolume = new G4Box("World",worldXsize,worldYsize,worldZsize); |
---|
691 | |
---|
692 | LogWorldVolume = new G4LogicalVolume(WorldVolume, |
---|
693 | vacuum, |
---|
694 | "logicWorld", |
---|
695 | 0,0,0); |
---|
696 | |
---|
697 | PhysWorldVolume = new G4PVPlacement(0, G4ThreeVector(), |
---|
698 | "physicalWorld", |
---|
699 | LogWorldVolume, |
---|
700 | 0,false,0); |
---|
701 | |
---|
702 | |
---|
703 | //*********************************************** |
---|
704 | // Defining the lyso-Solid volume |
---|
705 | //*********************************************** |
---|
706 | |
---|
707 | |
---|
708 | LYSOVolume=SelectDetector(fval); |
---|
709 | LogLYSOVolume = new G4LogicalVolume(LYSOVolume, |
---|
710 | lyso, |
---|
711 | "logicLYSO", |
---|
712 | 0,0,0); |
---|
713 | |
---|
714 | G4RotationMatrix *mat=new G4RotationMatrix(); |
---|
715 | if(xRot!=0.)mat->rotateX(xRot*deg); |
---|
716 | if(yRot!=0.)mat->rotateY(xRot*deg); |
---|
717 | if(zRot!=0.)mat->rotateZ(xRot*deg); |
---|
718 | // mat->rotateY(180.*deg); |
---|
719 | // mat->rotateZ(10.*deg); |
---|
720 | G4ThreeVector position=G4ThreeVector(1.0,1.0,1.0); |
---|
721 | |
---|
722 | PhysLYSOVolume = new G4PVPlacement(mat,G4ThreeVector(0.0,0.0,0.0), |
---|
723 | LogLYSOVolume, |
---|
724 | "physicalLYSO", |
---|
725 | LogWorldVolume, |
---|
726 | 0,false,0); |
---|
727 | |
---|
728 | G4cout << "The LYSO crystal is built as "<<fval << G4endl; |
---|
729 | |
---|
730 | |
---|
731 | |
---|
732 | |
---|
733 | //************************************************************************ |
---|
734 | //Al coated surface properties |
---|
735 | //************************************************************************ |
---|
736 | |
---|
737 | const G4int nEntries = 11; |
---|
738 | const G4double refl = 0.85; |
---|
739 | |
---|
740 | G4double PhotonEnergy[nEntries] = {2.478*eV, 2.53*eV, 2.58*eV, 2.636*eV, 2.69*eV, 2.75*eV, 2.816*eV, 2.88*eV, 2.95*eV, 3.022*eV, 3.097*eV}; |
---|
741 | |
---|
742 | G4double Reflectivity[nEntries] = {refl, refl,refl, refl, refl, refl, refl, refl, refl, refl, refl}; |
---|
743 | G4double Efficiency[nEntries] = {0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0}; |
---|
744 | G4double specularlobe[nEntries] = {0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0}; |
---|
745 | G4double specularspike[nEntries] = {0.9, 0.9,0.9, 0.9,0.9, 0.9,0.9, 0.9,0.9, 0.9,0.9}; |
---|
746 | G4double backscatter[nEntries] = {0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0, 0.0,0.0}; |
---|
747 | G4double rindex[nEntries] = {1.39, 1.39,1.39, 1.39,1.39,1.39,1.39, 1.39,1.39, 1.39,1.39}; |
---|
748 | |
---|
749 | |
---|
750 | G4OpticalSurface* alcoated_opsurf= new G4OpticalSurface("alcoated_opsurf"); |
---|
751 | new G4LogicalBorderSurface("alcoated_surf",PhysLYSOVolume,PhysWorldVolume, alcoated_opsurf); |
---|
752 | |
---|
753 | |
---|
754 | G4MaterialPropertiesTable* alcoated_mt = new G4MaterialPropertiesTable(); |
---|
755 | alcoated_mt->AddProperty("RINDEX", PhotonEnergy,rindex, nEntries ); |
---|
756 | alcoated_mt->AddProperty("EFFICIENCY", PhotonEnergy,Efficiency, nEntries ); |
---|
757 | alcoated_mt->AddProperty("REFLECTIVITY",PhotonEnergy,Reflectivity,nEntries); |
---|
758 | alcoated_mt->AddProperty("SPECULARLOBECONSTANT",PhotonEnergy,specularlobe,nEntries); |
---|
759 | alcoated_mt->AddProperty("SPECULARSPIKECONSTANT",PhotonEnergy,specularspike,nEntries); |
---|
760 | alcoated_mt->AddProperty("BACKSCATTERCONSTANT",PhotonEnergy,backscatter,nEntries); |
---|
761 | |
---|
762 | |
---|
763 | alcoated_opsurf->SetType(dielectric_metal); |
---|
764 | alcoated_opsurf->SetModel(unified); |
---|
765 | alcoated_opsurf->SetFinish(groundbackpainted/*polished*/); |
---|
766 | |
---|
767 | |
---|
768 | alcoated_opsurf->SetMaterialPropertiesTable(alcoated_mt); |
---|
769 | |
---|
770 | |
---|
771 | G4VisAttributes* WhiteVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));//red |
---|
772 | WhiteVisAtt->SetVisibility(true); |
---|
773 | WhiteVisAtt->SetForceSolid(true); |
---|
774 | |
---|
775 | G4VisAttributes* LysoVisAtt= new G4VisAttributes(G4Colour(0.0,0.0,1.0));//red |
---|
776 | LysoVisAtt->SetVisibility(true); |
---|
777 | LysoVisAtt->SetForceSolid(true); |
---|
778 | |
---|
779 | G4VisAttributes* DeteVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,0.0));//yellow |
---|
780 | DeteVisAtt->SetVisibility(true); |
---|
781 | DeteVisAtt->SetForceSolid(true); |
---|
782 | |
---|
783 | LogLYSOVolume->SetVisAttributes(LysoVisAtt); |
---|
784 | LogWorldVolume->SetVisAttributes(G4VisAttributes::GetInvisible()); |
---|
785 | |
---|
786 | return PhysWorldVolume; |
---|
787 | |
---|
788 | } |
---|
789 | |
---|