Geant4_10
GammaRayTelDetectorConstruction.cc
Go to the documentation of this file.
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 //
27 // $Id: GammaRayTelDetectorConstruction.cc 66508 2012-12-19 10:16:45Z gcosmo $
28 // ------------------------------------------------------------
29 // GEANT 4 class implementation file
30 // CERN Geneva Switzerland
31 //
32 //
33 // ------------ GammaRayTelDetectorConstruction ------
34 // by F.Longo, R.Giannitrapani & G.Santin (13 nov 2000)
35 //
36 // ************************************************************
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
39 
42 
43 #include "GammaRayTelTrackerSD.hh"
45 
48 
49 #include "G4PhysicalConstants.hh"
50 #include "G4SystemOfUnits.hh"
51 #include "G4Material.hh"
52 #include "G4Box.hh"
53 #include "G4LogicalVolume.hh"
54 #include "G4PVPlacement.hh"
55 #include "G4PVReplica.hh"
56 #include "G4UniformMagField.hh"
57 #include "G4FieldManager.hh"
59 #include "G4SDManager.hh"
60 #include "G4RunManager.hh"
61 
62 #include "G4VisAttributes.hh"
63 #include "G4Colour.hh"
64 
65 #include "G4ios.hh"
66 #include "G4RegionStore.hh"
67 
68 
69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
70 
72  :solidWorld(0),logicWorld(0),physiWorld(0),
73  solidPayload(0),logicPayload(0),physiPayload(0),
74  solidTKR(0),logicTKR(0),physiTKR(0),
75  solidCAL(0),logicCAL(0),physiCAL(0),
76  solidACT(0),logicACT(0),physiACT(0),
77  solidACL1(0),logicACL1(0),physiACL1(0),
78  solidACL2(0),logicACL2(0),physiACL2(0),
79  solidTKRDetectorX(0),logicTKRDetectorX(0),physiTKRDetectorX(0),
80  solidTKRDetectorY(0),logicTKRDetectorY(0),physiTKRDetectorY(0),
81  solidCALLayerX(0),logicCALLayerX(0),physiCALLayerX(0),
82  solidCALLayerY(0),logicCALLayerY(0),physiCALLayerY(0),
83  solidCALDetectorX(0),logicCALDetectorX(0),physiCALDetectorX(0),
84  solidCALDetectorY(0),logicCALDetectorY(0),physiCALDetectorY(0),
85  solidPlane(0),logicPlane(0),physiPlane(0),
86  solidConverter(0),logicConverter(0),physiConverter(0),
87  trackerSD(0),calorimeterSD(0),anticoincidenceSD(0)
88  // aTKRRegion(0), aCALRegion(0)
89 {
90  // default parameter values of the payload
91 
92  ConverterThickness = 300.*micrometer;
93  TKRSiliconThickness = 400.*micrometer;
94  TKRSiliconTileXY = 9.*cm;
95  TKRSiliconPitch = 200.*micrometer;
96  TKRLayerDistance = 3.*cm;
97  SiliconGuardRing = 1.5*mm;
98  TKRViewsDistance = 1.*mm;
99  NbOfTKRLayers = 15;
100  NbOfTKRTiles = 4;
101  CALBarThickness = 1.5*cm;
102  NbOfCALBars = 12;
103  NbOfCALLayers = 5;
104  ACDThickness = 1.*cm;
105  NbOfACDTopTiles = 1;
106  NbOfACDLateralTiles = 2;
107 
108  TilesSeparation = 100.*micrometer;
109  ACDTKRDistance = 5.*cm;
110  CALTKRDistance = 1.5*cm;
111 
112  ComputePayloadParameters();
113 
114  // create commands for interactive definition of the payload
115  detectorMessenger = new GammaRayTelDetectorMessenger(this);
116 
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
120 
122 { delete detectorMessenger;}
123 
124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
125 
127 {
128  DefineMaterials();
129  return ConstructPayload();
130 }
131 
132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
133 
134 void GammaRayTelDetectorConstruction::DefineMaterials()
135 {
136 
137  G4String name, symbol;
138  G4double a, z, density;
139 
140  G4int ncomponents, natoms;
141  G4double fractionmass;
142  G4double temperature, pressure;
143 
144  //
145  // define Elements
146  //
147 
148  a = 1.01*g/mole;
149  G4Element* H = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
150 
151  a = 12.01*g/mole;
152  G4Element* C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
153 
154  a = 14.006*g/mole;
155  G4Element* N = new G4Element(name="Nitrogen" ,symbol="N" , z= 7., a);
156 
157  a = 15.99*g/mole;
158  G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
159 
160  a = 26.98*g/mole;
161  G4Element* Alumin = new G4Element(name="Aluminum" ,symbol="Al" , z= 13., a);
162 
163  a = 28.09*g/mole;
164  G4Element* Silicon = new G4Element(name="Silicon", symbol="Si", z=14., a);
165 
166  a= 55.845*g/mole;
167  G4Element* Iron = new G4Element(name="Iron", symbol="Fe", z=26.,a);
168 
169  a = 126.904*g/mole;
170  G4Element* I = new G4Element(name="Iodine" ,symbol="I" , z= 53., a);
171 
172  a = 132.905*g/mole;
173  G4Element* Cs = new G4Element(name="Cesium" ,symbol="Cs" , z= 55., a);
174 
175  a = 207.19*g/mole;
176  G4Element* Lead = new G4Element(name="Lead", symbol="Pb", z=82., a);
177 
178  //
179  // define simple materials
180  //
181 
182  density = 19.3*g/cm3;
183  a = 183.84*g/mole;
184  G4Material* W = new G4Material(name="Tungsten", z=74., a, density);
185 
186 
187  //
188  // define a material from elements. case 1: chemical molecule
189  //
190 
191  density = 1.032*g/cm3;
192  G4Material* Sci = new G4Material(name="Scintillator", density, ncomponents=2);
193  Sci->AddElement(C, natoms=9);
194  Sci->AddElement(H, natoms=10);
195 
196  density = 4.53*g/cm3;
197  G4Material* CsI = new G4Material(name="CesiumIodide", density, ncomponents=2);
198  CsI->AddElement(Cs, natoms=5);
199  CsI->AddElement(I, natoms=5);
200 
201  //
202  // define a material from elements. case 2: mixture by fractional mass
203  //
204 
205  density = 1.290*mg/cm3;
206  G4Material* Air = new G4Material(name="Air" , density, ncomponents=2);
207  Air->AddElement(N, fractionmass=0.7);
208  Air->AddElement(O, fractionmass=0.3);
209 
210  density = 2.700*g/cm3;
211  G4Material* Al = new G4Material(name="Aluminum", density, ncomponents=1);
212  Al->AddElement(Alumin, fractionmass=1.);
213 
214  density = 2.333*g/cm3;
215  G4Material* Si = new G4Material(name="Silicon", density, ncomponents=1);
216  Si->AddElement(Silicon, fractionmass=1.);
217 
218  density = 7.87*g/cm3;
219  G4Material* Fe = new G4Material(name="Iron", density, ncomponents=1);
220  Fe->AddElement(Iron, fractionmass=1.);
221 
222  density = 11.35*g/cm3;
223  G4Material* Pb = new G4Material(name="Lead", density, ncomponents=1);
224  Pb->AddElement(Lead, fractionmass=1.);
225 
226  //
227  // examples of vacuum
228  //
229 
230  density = universe_mean_density; //from PhysicalConstants.h
231  pressure = 3.e-18*pascal;
232  temperature = 2.73*kelvin;
233  G4Material* vacuum = new G4Material(name="Galactic", z=1., a=1.01*g/mole, density,kStateGas,temperature,pressure);
234 
235  density = 1.e-5*g/cm3;
236  pressure = 2.e-2*bar;
237  temperature = STP_Temperature; //from PhysicalConstants.h
238  G4Material* beam = new G4Material(name="Beam", density, ncomponents=1,
239  kStateGas,temperature,pressure);
240  beam->AddMaterial(Air, fractionmass=1.);
241 
243 
244  //default materials of the payload
245 
246  ConverterMaterial = W;
247  defaultMaterial = vacuum;
248  ACDMaterial = Sci;
249  CALMaterial = CsI;
250  TKRMaterial = Si;
251 
252 }
253 
254 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
255 
256 G4VPhysicalVolume* GammaRayTelDetectorConstruction::ConstructPayload()
257 {
258  // complete the Payload parameters definition
259  ComputePayloadParameters();
260 
261  //
262  // World
263  //
264 
265  solidWorld = new G4Box("World",
266  WorldSizeXY/2,WorldSizeXY/2,WorldSizeZ/2);
267 
268  logicWorld = new G4LogicalVolume(solidWorld,
269  defaultMaterial,
270  "World");
271 
272  physiWorld = new G4PVPlacement(0,G4ThreeVector(),"World",logicWorld,
273  0,false,0);
274 
275  //
276  // Payload
277  //
278 
279  /* solidPayload=0; logicPayload=0; physiPayload=0;
280  solidTKR=0;logicTKR=0;physiTKR=0;
281  solidCAL=0;logicCAL=0;physiCAL=0;
282  solidACT=0;logicACT=0;physiACT=0;
283  solidACL1=0;logicACL1=0;physiACL1=0;
284  solidACL2=0;logicACL2=0;physiACL2=0;
285  solidConverter=0;logicConverter=0;physiConverter=0;
286  solidTKRDetectorX=0;logicTKRDetectorX=0;
287  solidTKRDetectorY=0;logicTKRDetectorY=0;
288  physiTKRDetectorX=0;physiTKRDetectorY=0;
289  solidCALDetectorX=0;logicCALDetectorX=0;physiCALDetectorX=0;
290  solidCALDetectorY=0;logicCALDetectorY=0;physiCALDetectorY=0;
291  solidPlane=0;logicPlane=0;physiPlane=0;
292  aCALRegion=0; aTKRRegion=0;
293  */
294  //
295  // Payload
296  //
297 
298  solidPayload = new G4Box("Payload",
299  PayloadSizeXY/2,
300  PayloadSizeXY/2,
301  PayloadSizeZ/2);
302 
303  logicPayload = new G4LogicalVolume(solidPayload,
304  defaultMaterial,
305  "Payload");
306 
307  physiPayload = new G4PVPlacement(0,
308  G4ThreeVector(),
309  "Payload",
310  logicPayload,
311  physiWorld,
312  false,
313  0);
314  //
315  // Calorimeter (CAL)
316  //
317 
318  solidCAL = new G4Box("CAL",
319  CALSizeXY/2,CALSizeXY/2,CALSizeZ/2);
320 
321  logicCAL = new G4LogicalVolume(solidCAL,
322  defaultMaterial,
323  "CAL");
324  physiCAL = new G4PVPlacement(0,
325  G4ThreeVector(0,0,
326  -PayloadSizeZ/2+CALSizeZ/2),
327  "CAL",
328  logicCAL,
329  physiPayload,
330  false,
331  0);
332  //
333  // Tracker (TKR)
334  //
335 
336  solidTKR = new G4Box("TKR",
337  TKRSizeXY/2,TKRSizeXY/2,TKRSizeZ/2);
338 
339  logicTKR = new G4LogicalVolume(solidTKR,
340  defaultMaterial,
341  "TKR");
342  physiTKR = new G4PVPlacement(0,
343  G4ThreeVector(0,0,
344  -PayloadSizeZ/2+CALSizeZ+
345  CALTKRDistance+TKRSizeZ/2),
346  "TKR",
347  logicTKR,
348  physiPayload,
349  false,
350  0);
351 
352 
353  //
354  // Anticoincidence Top (ACT)
355  //
356 
357  solidACT = new G4Box("ACT",
358  ACTSizeXY/2,ACTSizeXY/2,ACTSizeZ/2);
359 
360  logicACT = new G4LogicalVolume(solidACT,ACDMaterial,"ACT");
361 
362  physiACT = new G4PVPlacement(0,
363  G4ThreeVector(0,0,
364  -PayloadSizeZ/2+CALSizeZ+
365  CALTKRDistance+TKRSizeZ+
366  ACDTKRDistance+ACTSizeZ/2),
367  "ACT",
368  logicACT,
369  physiPayload,
370  false,
371  0);
372 
373  //
374  // Anticoincidence Lateral Side (ACL)
375  //
376 
377  solidACL1 = new G4Box("ACL1",
378  ACL1SizeX/2,ACL1SizeY/2,ACL1SizeZ/2);
379 
380  logicACL1 = new G4LogicalVolume(solidACL1,ACDMaterial,"ACL");
381 
382  physiACL1 = new G4PVPlacement(0,
383  G4ThreeVector(-PayloadSizeXY/2+ACL1SizeX/2,
384  -PayloadSizeXY/2+ACL1SizeY/2,
385  -PayloadSizeZ/2+ACL1SizeZ/2),
386  "ACL1",
387  logicACL1,
388  physiPayload,
389  false,
390  0);
391 
392  physiACL1 = new G4PVPlacement(0,
393  G4ThreeVector(PayloadSizeXY/2-ACL1SizeX/2,
394  PayloadSizeXY/2-ACL1SizeY/2,
395  -PayloadSizeZ/2+ACL1SizeZ/2),
396  "ACL1",
397  logicACL1,
398  physiPayload,
399  false,
400  1);
401 
402  solidACL2 = new G4Box("ACL2",
403  ACL2SizeX/2,ACL2SizeY/2,ACL2SizeZ/2);
404 
405  logicACL2 = new G4LogicalVolume(solidACL2,
406  ACDMaterial,
407  "ACL2");
408 
409 
410  physiACL2 = new G4PVPlacement(0,
411  G4ThreeVector(-PayloadSizeXY/2+ACL2SizeX/2,
412  PayloadSizeXY/2-ACL2SizeY/2,
413  -PayloadSizeZ/2+ACL2SizeZ/2),
414  "ACL2",
415  logicACL2,
416  physiPayload,
417  false,
418  0);
419 
420  physiACL2 = new G4PVPlacement(0,
421  G4ThreeVector(PayloadSizeXY/2-ACL2SizeX/2,
422  -PayloadSizeXY/2+ACL2SizeY/2,
423  -PayloadSizeZ/2+ACL2SizeZ/2),
424  "ACL2",
425  logicACL2,
426  physiPayload,
427  false,
428  1);
429 
430 
431  // Tracker Structure (Plane + Converter + TKRDetectorX + TKRDetectorY)
432 
433  solidPlane = new G4Box("Plane",
434  TKRSizeXY/2,TKRSizeXY/2,TKRSupportThickness/2);
435 
436  logicPlane = new G4LogicalVolume(solidPlane,
437  defaultMaterial,
438  "Plane");
439 
440  solidTKRDetectorY = new G4Box
441  ("TKRDetectorY",TKRSizeXY/2,TKRSizeXY/2,TKRSiliconThickness/2);
442 
443  logicTKRDetectorY = new G4LogicalVolume(solidTKRDetectorY,
444  TKRMaterial,
445  "TKRDetector Y");
446 
447 
448  solidTKRDetectorX = new G4Box
449  ("TKRDetectorX",TKRSizeXY/2,TKRSizeXY/2,TKRSiliconThickness/2);
450 
451  logicTKRDetectorX = new G4LogicalVolume(solidTKRDetectorX,
452  TKRMaterial,
453  "TKRDetector X");
454 
455 
456  solidConverter = new G4Box
457  ("Converter",TKRSizeXY/2,TKRSizeXY/2,ConverterThickness/2);
458 
459  logicConverter = new G4LogicalVolume(solidConverter,
460  ConverterMaterial,
461  "Converter");
462 
463  G4int i=0;
464 
465  for (i = 0; i < NbOfTKRLayers; i++)
466  {
467 
468  physiTKRDetectorY =
469  new G4PVPlacement(0,G4ThreeVector(0.,0.,-TKRSizeZ/2
470  +TKRSiliconThickness/2
471  +(i)*TKRLayerDistance),
472  "TKRDetectorY",
473  logicTKRDetectorY,
474  physiTKR,
475  false,
476  i);
477 
478  physiTKRDetectorX =
479  new G4PVPlacement(0,G4ThreeVector(0.,0.,
480  -TKRSizeZ/2+
481  TKRSiliconThickness/2 +
482  TKRViewsDistance+
483  TKRSiliconThickness+
484  (i)*TKRLayerDistance),
485  "TKRDetectorX",
486  logicTKRDetectorX,
487  physiTKR,
488  false,
489  i);
490 
491 
492  physiConverter =
493  new G4PVPlacement(0,G4ThreeVector(0.,0.,
494  -TKRSizeZ/2+
495  2*TKRSiliconThickness +
496  TKRViewsDistance+
497  ConverterThickness/2+
498  (i)*TKRLayerDistance),
499  "Converter",
500  logicConverter,
501  physiTKR,
502  false,
503  i);
504 
505 
506 
507  physiPlane =
508  new G4PVPlacement(0,G4ThreeVector(0.,0.,
509  -TKRSizeZ/2+
510  2*TKRSiliconThickness +
511  TKRViewsDistance+
512  ConverterThickness+
513  TKRSupportThickness/2+
514  (i)*TKRLayerDistance),
515  "Plane",
516  logicPlane,
517  physiTKR,
518  false,
519  i);
520 
521  }
522 
523 
524 
525  G4VSolid * solidTKRActiveTileX = new
526  G4Box("Active Tile X", TKRActiveTileXY/2,
527  TKRActiveTileXY/2,TKRActiveTileZ/2);
528 
529 
530  G4VSolid * solidTKRActiveTileY = new
531  G4Box("Active Tile Y", TKRActiveTileXY/2,
532  TKRActiveTileXY/2,TKRActiveTileZ/2);
533 
534 
535  G4LogicalVolume* logicTKRActiveTileX =
536  new G4LogicalVolume(solidTKRActiveTileX, TKRMaterial,
537  "Active Tile X",0,0,0);
538 
539 
540  G4LogicalVolume* logicTKRActiveTileY =
541  new G4LogicalVolume(solidTKRActiveTileY, TKRMaterial,
542  "Active Tile Y",0,0,0);
543 
544 
545  G4int j=0;
546  G4int k=0;
547 
548  G4double x=0.;
549  G4double y=0.;
550  G4double z=0.;
551 
552  for (i=0;i< NbOfTKRTiles; i++)
553  {
554  for (j=0;j< NbOfTKRTiles; j++)
555  {
556  k = i*NbOfTKRTiles + j;
557 
558 
559  x = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
560  TKRActiveTileXY/2+(i)*((2*SiliconGuardRing)+
561  TilesSeparation+TKRActiveTileXY);
562  y = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
563  TKRActiveTileXY/2+(j)*((2*SiliconGuardRing)+TilesSeparation+
564  TKRActiveTileXY);
565  z = 0.;
566 
567  new G4PVPlacement(0,
568  G4ThreeVector(x,y,z),
569  "Active Tile Y",
570  logicTKRActiveTileY,
571  physiTKRDetectorY,
572  false,
573  k);
574 
575 
576  x = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
577  TKRActiveTileXY/2+(j)*((2*SiliconGuardRing)+
578  TilesSeparation+TKRActiveTileXY);
579  y = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
580  TKRActiveTileXY/2+(i)*((2*SiliconGuardRing)+
581  TilesSeparation+TKRActiveTileXY);
582  z = 0.;
583 
584  new G4PVPlacement(0,
585  G4ThreeVector(x,y,z),
586  "Active Tile X",
587  logicTKRActiveTileX,
588  physiTKRDetectorX,
589  false,
590  k);
591 
592  }
593  }
594 
595 
596  // Calorimeter Structure (CALLayerX + CALLayerY)
597 
598 
599  solidCALLayerX = new G4Box("CALLayerX",
600  CALSizeXY/2,CALSizeXY/2,CALBarThickness/2);
601 
602  logicCALLayerX = new G4LogicalVolume(solidCALLayerX,
603  CALMaterial,
604  "CALLayerX");
605 
606  solidCALLayerY = new G4Box("CALLayerY",
607  CALSizeXY/2,CALSizeXY/2,CALBarThickness/2);
608 
609  logicCALLayerY = new G4LogicalVolume(solidCALLayerY,
610  CALMaterial,
611  "CALLayerY");
612 
613  for (i = 0; i < NbOfCALLayers; i++)
614  {
615 
616  physiCALLayerY =
617  new G4PVPlacement(0,G4ThreeVector(0,0,
618  -CALSizeZ/2+
619  CALBarThickness/2 +
620  (i)*2*CALBarThickness),
621  "CALLayerY",
622  logicCALLayerY,
623  physiCAL,
624  false,
625  i);
626 
627  physiCALLayerX =
628  new G4PVPlacement(0,G4ThreeVector(0,0,
629  -CALSizeZ/2+
630  CALBarThickness/2 +
631  CALBarThickness +
632  (i)*2*CALBarThickness),
633  "CALLayerX",
634  logicCALLayerX,
635  physiCAL,
636  false,
637  i);
638 
639  }
640 
641  // Calorimeter Structure (CALDetectorX + CALDetectorY)
642 
643  solidCALDetectorX = new G4Box("CALDetectorX",
644  CALBarX/2,CALBarY/2,CALBarThickness/2);
645 
646  logicCALDetectorX = new G4LogicalVolume(solidCALDetectorX,
647  CALMaterial,
648  "CALDetectorX");
649 
650  solidCALDetectorY = new G4Box("CALDetectorY",
651  CALBarY/2,CALBarX/2,CALBarThickness/2);
652 
653  logicCALDetectorY = new G4LogicalVolume(solidCALDetectorY,
654  CALMaterial,
655  "CALDetectorY");
656 
657  for (i = 0; i < NbOfCALBars; i++)
658  {
659 
660  physiCALDetectorY =
661  new G4PVPlacement(0,
662  G4ThreeVector(-CALSizeXY/2+ CALBarY/2 +
663  (i)*CALBarY, 0, 0),
664  "CALDetectorY",
665  logicCALDetectorY,
666  physiCALLayerY,
667  false,
668  i);
669 
670  physiCALDetectorX =
671  new G4PVPlacement(0,
672  G4ThreeVector(0,-CALSizeXY/2+ CALBarY/2 +
673  (i)*CALBarY, 0),
674  "CALDetectorX",
675  logicCALDetectorX,
676  physiCALLayerX,
677  false,
678  i);
679 
680  }
681 
682 
683  // Cuts by Regions
684 
685  /*
686  G4String regName[] = {"Calorimeter","Tracker"};
687  if (aCALRegion) delete aCALRegion;
688 
689  aCALRegion = new G4Region(regName[0]);
690  logicCAL->SetRegion(aCALRegion);
691  aCALRegion->AddRootLogicalVolume(logicCAL);
692 
693  if (aTKRRegion) delete aTKRRegion;
694 
695  aTKRRegion = new G4Region(regName[1]);
696  logicTKR->SetRegion(aTKRRegion);
697  aTKRRegion->AddRootLogicalVolume(logicTKR);
698  */
699 
700  //Sensitive Detector Manager
701 
703 
704  //
705  // Sensitive Detectors - Tracker
706  //
707 
708 
709  if(!trackerSD)
710  {
711  trackerSD = new GammaRayTelTrackerSD("TrackerSD");
712  SDman->AddNewDetector( trackerSD );
713  }
714 
715 
716  G4String ROgeometryName = "TrackerROGeom";
717  G4VReadOutGeometry* trackerRO =
718  new GammaRayTelTrackerROGeometry(ROgeometryName);
719 
720  trackerRO->BuildROGeometry();
721  trackerSD->SetROgeometry(trackerRO);
722 
723  if (logicTKRActiveTileX)
724  logicTKRActiveTileX->SetSensitiveDetector(trackerSD); // ActiveTileX
725  if (logicTKRActiveTileY)
726  logicTKRActiveTileY->SetSensitiveDetector(trackerSD); // ActiveTileY
727 
728  //
729  // Sensitive Detectors: Calorimeter
730  //
731 
732 
733 
734  if(!calorimeterSD)
735  {
736  calorimeterSD = new GammaRayTelCalorimeterSD("CalorimeterSD");
737  SDman->AddNewDetector( calorimeterSD );
738  }
739 
740  if (logicCALDetectorX)
741  logicCALDetectorX->SetSensitiveDetector(calorimeterSD); // BarX
742  if (logicCALDetectorY)
743  logicCALDetectorY->SetSensitiveDetector(calorimeterSD); // BarY
744 
745  //
746  // Sensitive Detectors: Anticoincidence
747  //
748 
749  if(!anticoincidenceSD)
750  {
751  anticoincidenceSD = new GammaRayTelAnticoincidenceSD
752  ("AnticoincidenceSD");
753  SDman->AddNewDetector( anticoincidenceSD );
754  }
755 
756  if (logicACT)
757  logicACT->SetSensitiveDetector(anticoincidenceSD); // ACD top
758  if (logicACL1)
759  logicACL1->SetSensitiveDetector(anticoincidenceSD); // ACD lateral side
760  if (logicACL2)
761  logicACL2->SetSensitiveDetector(anticoincidenceSD); // ACD lateral side
762 
763  //
764  // Visualization attributes
765  //
766 
767  // Invisible Volume
771  logicTKRActiveTileX->SetVisAttributes(G4VisAttributes::Invisible);
772  logicTKRActiveTileY->SetVisAttributes(G4VisAttributes::Invisible);
778 
779  // Some visualization styles
780 
781  G4VisAttributes* VisAtt1= new G4VisAttributes(G4Colour(0.3,0.8,0.1));
782  VisAtt1->SetVisibility(true);
783  VisAtt1->SetForceSolid(TRUE);
784 
785  G4VisAttributes* VisAtt2= new G4VisAttributes(G4Colour(0.2,0.3,0.8));
786  VisAtt2->SetVisibility(true);
787  VisAtt2->SetForceSolid(FALSE);
788 
789  G4VisAttributes* VisAtt3= new G4VisAttributes(G4Colour(0.8,0.2,0.3));
790  VisAtt3->SetVisibility(true);
791  VisAtt3->SetForceWireframe(TRUE);
792 
793  // Visible Volumes
794 
795  logicCALDetectorX->SetVisAttributes(VisAtt1);
796  logicCALDetectorY->SetVisAttributes(VisAtt1);
797  logicTKRDetectorX->SetVisAttributes(VisAtt2);
798  logicTKRDetectorY->SetVisAttributes(VisAtt2);
799  logicACT->SetVisAttributes(VisAtt3);
800  logicACL1->SetVisAttributes(VisAtt3);
801  logicACL2->SetVisAttributes(VisAtt3);
802 
803 
804  //
805  //always return the physical World
806  //
808  return physiWorld;
809 }
810 
811 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
812 
814 {
815  G4cout << "\n------------------------------------------------------------"
816  << "\n---> The Tracker is " << NbOfTKRLayers << " layers of: "
817  << ConverterThickness/mm << "mm of " << ConverterMaterial->GetName()
818  << "\n------------------------------------------------------------\n";
819 }
820 
821 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
822 
823 
824 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
825 
827 {
828  // search the material by its name
829  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
830  if (pttoMaterial)
831  {
832  ConverterMaterial = pttoMaterial;
833  logicConverter->SetMaterial(pttoMaterial);
835  }
836 }
837 
839 {
840  ConverterThickness = val;
841 }
842 
843 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
844 
846 {
847  TKRSiliconThickness = val;
848 }
849 
850 
852 {
853  TKRSiliconPitch = val;
854 }
855 
856 
858 {
859  TKRSiliconTileXY = val;
860 }
861 
862 
864 {
865  NbOfTKRLayers = val;
866 }
867 
868 
870 {
871  NbOfTKRTiles = val;
872 }
873 
875 {
876  TKRLayerDistance = val;
877 }
878 
880 {
881  TKRViewsDistance = val;
882 }
883 
884 
885 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
886 
888 {
889  NbOfCALLayers = val;
890 }
891 
893 {
894  NbOfCALBars = val;
895 }
896 
898 {
899  CALBarThickness = val;
900 }
901 
902 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
903 
905 {
906  ACDThickness = val;
907 }
908 
909 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
910 
912 {
913  //apply a global uniform magnetic field along Z axis
914  G4FieldManager* fieldMgr
916 
917  if(magField) delete magField; //delete the existing magn field
918 
919  if(fieldValue!=0.) // create a new one if non nul
920  { magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
921  fieldMgr->SetDetectorField(magField);
922  fieldMgr->CreateChordFinder(magField);
923  } else {
924  magField = 0;
925  fieldMgr->SetDetectorField(magField);
926  }
927 }
928 
929 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
930 
932 {
933  // delete payloadSD;
934  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructPayload());
937 
938 
939 }
940 
941 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
942 
943 
944 
945 
946 
947 
948 
949 
950 
951 
952 
953 
954 
955 
956 
957 
958 
G4String symbol
Definition: TRTMaterials.hh:40
void SetForceWireframe(G4bool)
G4Material * Air
Definition: TRTMaterials.hh:57
void UpdateMaterialList(G4VPhysicalVolume *currentWorld=0)
tuple a
Definition: test.py:11
CLHEP::Hep3Vector G4ThreeVector
G4bool SetDetectorField(G4Field *detectorField)
void AddMaterial(G4Material *material, G4double fraction)
Definition: G4Material.cc:450
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
int universe_mean_density
Definition: hepunit.py:307
Definition: G4Box.hh:63
const G4String & GetName() const
Definition: G4Material.hh:176
void SetVisibility(G4bool)
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:564
const XML_Char * name
Definition: expat.h:151
tuple x
Definition: test.py:50
float STP_Temperature
Definition: hepunit.py:302
void SetForceSolid(G4bool)
int G4int
Definition: G4Types.hh:78
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
static G4RegionStore * GetInstance()
Double_t y
Definition: plot.C:279
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
G4GLOB_DLL std::ostream G4cout
void PhysicsHasBeenModified()
#define FALSE
Definition: globals.hh:52
#define pascal
G4Material * Si
Definition: TRTMaterials.hh:78
void SetROgeometry(G4VReadOutGeometry *value)
#define TRUE
Definition: globals.hh:55
static G4TransportationManager * GetTransportationManager()
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
G4FieldManager * GetFieldManager() const
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
static const G4VisAttributes Invisible
tuple z
Definition: test.py:28
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
Definition: HEPEvtcom.cc:77
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:345
double G4double
Definition: G4Types.hh:76
void CreateChordFinder(G4MagneticField *detectorMagField)
void SetMaterial(G4Material *pMaterial)
int micrometer
Definition: hepunit.py:34
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
G4Material * Al
Definition: TRTMaterials.hh:74