5 // MyDetectorConstruction.hh, 3/III/1998 - Sara Vanini
6 // T36 calorimeter with parametric volumes insted of replicans
10 //#include "T36EMCalorimeterSD.hh"
11 //#include "T36HADCalorimeterSD.hh"
12 #include "MyDetectorConstruction.hh"
13 //#include "T36ModuleParam.hh"
14 #include "T36LayerParam.hh"
16 #include "G4Material.hh"
19 #include "G4LogicalVolume.hh"
20 #include "G4PVPlacement.hh"
21 #include "G4PVReplica.hh"
22 #include "G4PVParameterised.hh"
23 #include "G4VPVParameterisation.hh"
24 //#include "G4SDManager.hh"
25 //#include "G4RunManager.hh"
26 #include "G4UniformMagField.hh"
27 #include "G4FieldManager.hh"
28 #include "G4TransportationManager.hh"
29 #include "G4VisAttributes.hh"
30 #include "G4Colour.hh"
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
37 MyDetectorConstruction::MyDetectorConstruction()
38 :solidWorld(NULL),logicWorld(NULL),physiWorld(NULL),
39 solidCalor(NULL),logicCalor(NULL),physiCalor(NULL),
40 solidModule(NULL),logicModule(NULL),physiModule(NULL),
41 EMsolidModule(NULL),EMlogicModule(NULL),EMphysiModule(NULL),
42 HADsolidModule(NULL),HADlogicModule(NULL),HADphysiModule(NULL),
43 solidFrontVac(NULL),logicFrontVac(NULL),physiFrontVac(NULL),
45 solidEMWLS(NULL),logicEMWLS(NULL),solidHADWLS(NULL),logicHADWLS(NULL),
46 solidAl(NULL),logicAl(NULL),physiAl(NULL),
47 solidSpace(NULL),logicSpace(NULL),physiSpace(NULL),
48 EMsolidLayer(NULL),EMlogicLayer(NULL),EMphysiLayer(NULL),
49 HADsolidLayer(NULL),HADlogicLayer(NULL),HADphysiLayer(NULL),
51 EMsolidAbsorber(NULL),EMlogicAbsorber(NULL),EMphysiAbsorber(NULL),
52 HADsolidAbsorber(NULL),HADlogicAbsorber(NULL),HADphysiAbsorber(NULL),
53 lastHADsolidAbsorber(NULL),lastHADlogicAbsorber(NULL),lastHADphysiAbsorber(NULL),
54 lastHADphysiAbMedShield(NULL),lastHADphysiAbExShield(NULL),
55 EMsolidAbMedShield(NULL),EMlogicAbMedShield(NULL),EMphysiAbMedShield(NULL),
56 EMsolidAbExShield(NULL),EMlogicAbExShield(NULL),EMphysiAbExShield(NULL),
57 HADsolidAbMedShield(NULL),HADlogicAbMedShield(NULL),HADphysiAbMedShield(NULL),
58 HADsolidAbExShield(NULL),HADlogicAbExShield(NULL),HADphysiAbExShield(NULL),
61 EMsolidGap(NULL),EMlogicGap(NULL),EMphysiGap(NULL),
62 HADsolidGap(NULL),HADlogicGap(NULL),HADphysiGap(NULL),
63 EMsolidSc(NULL),EMlogicSc(NULL),EMphysiSc(NULL),
64 HADsolidSc(NULL),HADlogicSc(NULL),HADphysiSc(NULL),
65 AbsorberMaterial(NULL),GapMaterial(NULL),ScMaterial(NULL),WLSMaterial(NULL),
66 RodMaterial(NULL),defaultMaterial(NULL),SpacerMaterial(NULL),
67 frontPlateMaterial(NULL),MedAbsMaterial(NULL),ExAbsMaterial(NULL),
68 EMsolidRod(NULL),HADsolidRod(NULL),EMlogicRod(NULL),HADlogicRod(NULL),
69 EMsolidSpacer(NULL),HADsolidSpacer(NULL),EMlogicSpacer(NULL),HADlogicSpacer(NULL)
76 // default parameter values of the calorimeter
77 // EMWLSSizeX = 1103.5*mm; //copre tutta la torre
79 // HADWLSSizeX = 887.5*mm; //come input fluka: dal layer 17 per tutta la torre
86 EMModuleSizeZ = 218*mm;
87 HADModuleSizeZ = 211*mm;
88 SpacerThickness = 3.5*mm;
92 AbsorberThickness = 10.*mm;
93 AbMedShieldThickness = 8.*mm;
94 AbExShieldThickness = 1.*mm;
95 GapThickness = 3.5*mm;
98 EMModuleSizeZ = 218*mm;
99 HADModuleSizeZ = 211*mm;
101 ModuleSizeY = 700*mm;
106 MyDetectorConstruction::~MyDetectorConstruction()
110 G4VPhysicalVolume* MyDetectorConstruction::Construct()
113 return ConstructCalorimeter();
117 void MyDetectorConstruction::DefineMaterials()
119 //This function illustrates the possible ways to define materials
121 G4String name, symbol; //a=mass of a mole;
122 G4double a, z, density; //z=mean number of protons;
123 G4int iz, n; //iz=number of protons in an isotope;
124 // n=number of nucleons in an isotope;
126 G4int ncomponents, natoms;
127 G4double abundance, fractionmass;
128 G4double temperature, pressure;
135 G4Element* H = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
138 G4Element* C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
141 G4Element* N = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
144 G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
147 G4Element* Ar = new G4Element(name="Argon" ,symbol="Ar" , z= 18., a);
150 G4Element* Pb = new G4Element(name="Lead" ,symbol="Pb" , z= 82., a);
153 G4Element* Sb = new G4Element(name="Antimony" ,symbol="Sb" , z= 51., a);
157 // define simple materials
160 density = universe_mean_density; //from PhysicalConstants.h
161 pressure = 3.e-18*pascal;
162 temperature = 2.73*kelvin;
163 G4Material* vacuum = new G4Material(name="Galactic", z=1., a=1.01*g/mole, density,
164 kStateGas,temperature,pressure);
166 density = 2.700*g/cm3;
168 G4Material* Al = new G4Material(name="Aluminium", z=13., a, density);
170 // il numero di atomi e` stato normalizzato al numero di atomi della molecola!
171 // posso usare la formula chimica minimale, quindi moltiplicare per un
172 // fattore comune fino ad ottenere interi.
174 density = 1.170*g/cm3;
175 G4Material* WLSMat = new G4Material(name="PMMAWLS", density, ncomponents=3);
176 WLSMat->AddElement(H, natoms=100);
177 WLSMat->AddElement(C, natoms=57);
178 WLSMat->AddElement(O, natoms=57);
180 //N.B. le frazioni di massa sono state normalizzate ad 1 rispetto all`input di fluka!
181 density = 11.3*g/cm3;
182 G4Material* ExLead = new G4Material(name="LeadSB", density, ncomponents=2);
183 ExLead->AddElement(Pb, fractionmass=0.96);
184 ExLead->AddElement(Sb, fractionmass=0.04);
186 density = 11.3*g/cm3;
187 G4Material* MedLead = new G4Material(name="LeadSB0", density, ncomponents=2);
188 MedLead->AddElement(Pb, fractionmass=0.96);
189 MedLead->AddElement(Sb, fractionmass=0.04);
191 density = 0.001225*g/cm3;
192 G4Material* Air = new G4Material(name="Air", density, ncomponents=3);
193 Air->AddElement(N, fractionmass=0.7555795);
194 Air->AddElement(O, fractionmass=0.23158806);
195 Air->AddElement(Ar, fractionmass=0.012832444);
197 density = 1.044*g/cm3;
198 G4Material* SciMat = new G4Material(name="SCSN38", density, ncomponents=2);
199 SciMat->AddElement(H, natoms=1);
200 SciMat->AddElement(C, natoms=1);
203 //G4cout << *(G4Material::GetMaterialTable()) << endl;
205 //default materials of the calorimeter
207 defaultMaterial = Air;
209 RodMaterial = SciMat;
212 WLSMaterial = WLSMat;
213 frontPlateMaterial = Al;
214 MedAbsMaterial = MedLead;
215 ExAbsMaterial = ExLead;
221 G4VPhysicalVolume* MyDetectorConstruction::ConstructCalorimeter()
223 // complete the Calor parameters definition
224 ComputeCalorParameters();
229 solidWorld = new G4Box("World", //its name
230 WorldSizeX/2,WorldSizeY/2,WorldSizeZ/2); //its size
232 logicWorld = new G4LogicalVolume(solidWorld, //its solid
233 defaultMaterial, //vacuum
236 physiWorld = new G4PVPlacement(0, //no rotation
237 G4ThreeVector(), //at (0,0,0)
239 logicWorld, //its logical volume
240 NULL, //its mother volume
241 false, //no boolean operation
247 solidCalor = new G4Box("Calorimeter", //its name
248 ModuleSizeX/2,ModuleSizeY/2,CalorSizeZ/2);//size
250 logicCalor = new G4LogicalVolume(solidCalor, //its solid
251 defaultMaterial, //its material
252 "Calorimeter"); //its name
254 physiCalor = new G4PVPlacement(0, //no rotation
255 G4ThreeVector(ModuleSizeX/2-AlSizeX-SpaSizeX,0.,0.),
256 "Calorimeter", //its name
257 logicCalor, //its logical volume
258 physiWorld, //its mother volume
259 false, //no boolean operation
264 solidModule = new G4Box("Module", //its name
265 ModuleSizeX/2,ModuleSizeY/2,ModuleSizeZ/2);//size
267 logicModule = new G4LogicalVolume(solidModule, //its solid
268 defaultMaterial, //its material
269 "Module"); //its name
272 for(int iMod=0;iMod<NbOfModules;iMod++)
276 -ModuleSizeZ/2*(NbOfModules-1)+iMod*ModuleSizeZ),
288 solidEMWLS = new G4Box("EMWLS", //its name
289 EMWLSSizeX/2,ModuleSizeY/2,EMWLSSizeZ/2);//size
291 logicEMWLS = new G4LogicalVolume(solidEMWLS, //its solid
292 WLSMaterial, //its material
294 //right and left side of module
295 for(int t=0; t<2; t++)
298 new G4PVPlacement(0, //no rotation
299 G4ThreeVector(-ModuleSizeX/2+EMWLSSizeX/2+AlSizeX+SpaSizeX,
300 0.,b*(-ModuleSizeZ/2+EMWLSSizeZ/2)), //
301 logicEMWLS, //its logical volume
303 logicModule, //its mother volume
304 false, //no boolean operation
311 solidHADWLS = new G4Box("HADWLS", //its name
312 HADWLSSizeX/2,ModuleSizeY/2,HADWLSSizeZ/2);//size
314 logicHADWLS = new G4LogicalVolume(solidHADWLS, //its solid
315 WLSMaterial, //its material
316 "HADWLS"); //its name
317 //left and right side of module
318 for(int u=0; u<2; u++)
321 new G4PVPlacement(0, //no rotation
322 G4ThreeVector(ModuleSizeX/2-HADWLSSizeX/2,
323 0.,c*(ModuleSizeZ/2-EMWLSSizeZ-HADWLSSizeZ/2)),
324 logicHADWLS, //its logical volume
326 logicModule, //its mother volume
327 false, //no boolean operation
335 solidAl = new G4Box("AlFrontPlate", //its name
336 AlSizeX/2,ModuleSizeY/2,ModuleSizeZ/2);//size
338 logicAl = new G4LogicalVolume(solidAl, //its solid
339 frontPlateMaterial, //its material
340 "AlFrontPlate"); //its name
342 physiAl = new G4PVPlacement(0, //no rotation
343 G4ThreeVector(-ModuleSizeX/2+AlSizeX/2,0.,0.),
344 logicAl, //its logical volume
345 "AlFrontPlate", //its name
346 logicModule, //its mother volume
347 false, //no boolean operation
351 // front space with vacuum
353 solidSpace = new G4Box("VacFrontSpace", //its name
354 SpaSizeX/2,ModuleSizeY/2,ModuleSizeZ/2);//size
356 logicSpace = new G4LogicalVolume(solidSpace, //its solid
357 defaultMaterial, //its material
358 "VacFrontSpace"); //its name
360 physiSpace = new G4PVPlacement(0, //no rotation
361 G4ThreeVector(-ModuleSizeX/2+AlSizeX+SpaSizeX/2,0.,0.),
362 logicSpace, //its logical vo
363 "VacFrontSpace", //its name
364 logicModule, //its mother volume
365 false, //no boolean operation
372 // *******************************
373 // ******** EMModule *******
374 // *******************************
376 EMsolidModule = new G4Box("EMModule", //its name
377 EMModuleThickness/2,ModuleSizeY/2,EMModuleSizeZ/2);//size
379 EMlogicModule = new G4LogicalVolume(EMsolidModule, //its solid
380 defaultMaterial, //its material
381 "EMModule"); //its name
383 EMphysiModule = new G4PVPlacement(0, //no rotation
384 G4ThreeVector(-ModuleSizeX/2+AlSizeX+SpaSizeX+EMModuleThickness/2,
386 EMlogicModule, //its logical volume
387 "EMModule", //its name
388 logicModule, //its mother volume
389 false, //no boolean operation
394 EMsolidLayer = new G4Box("EMLayer", //its name
395 LayerThickness/2,ModuleSizeY/2,EMModuleSizeZ/2); //size
397 EMlogicLayer = new G4LogicalVolume(EMsolidLayer, //its solid
398 defaultMaterial, //its material
399 "EMLayer"); //its name
401 G4VPVParameterisation * EMLayersParam =
402 new T36LayerParam(LayerThickness,NbOfEMLayers);
404 EMphysiLayer = new G4PVParameterised("EMLayer", //its name
405 EMlogicLayer, //its logical volume
406 EMphysiModule, //its mother
407 kXAxis, //axis of param
408 NbOfEMLayers, //number of param
409 EMLayersParam); //param
414 EMsolidAbsorber = new G4Box("EMAbsorber", //its name
415 AbsorberThickness/2,ModuleSizeY/2,EMModuleSizeZ/2);
417 EMlogicAbsorber = new G4LogicalVolume(EMsolidAbsorber, //its solid
418 defaultMaterial, //its material
419 "EMAbsorber"); //its name
421 EMphysiAbsorber = new G4PVPlacement(0, //no rotation
422 G4ThreeVector(-GapThickness/2,0.,0.), //its position
423 "EMAbsorber", //its name
424 EMlogicAbsorber, //its logical volume
425 EMphysiLayer, //its mother
426 false, //no boulean operat
430 // Pb EMAbsorber Medium Shield
432 EMsolidAbMedShield = new G4Box("EMAbMedShield", //its name
433 AbMedShieldThickness/2,ModuleSizeY/2,EMModuleSizeZ/2);
435 EMlogicAbMedShield = new G4LogicalVolume(EMsolidAbMedShield, //its solid
436 MedAbsMaterial, //its material
437 "EMAbMedShield"); //its name
439 EMphysiAbMedShield = new G4PVPlacement(0, //no rotation
440 G4ThreeVector(0.,0.,0.), //its position
441 "EMAbMedShield", //its name
442 EMlogicAbMedShield, //its logical volume
443 EMphysiAbsorber, //its mother
444 false, //no boulean operat
448 // 2 Pb EMAbsorber External Shields
450 EMsolidAbExShield = new G4Box("EMAbExShield", //its name
451 AbExShieldThickness/2,ModuleSizeY/2,EMModuleSizeZ/2);
453 EMlogicAbExShield = new G4LogicalVolume(EMsolidAbExShield, //its solid
454 ExAbsMaterial, //its material
455 "EMAbExShield"); //its name
458 for(int s=0; s<2; s++)
460 EMphysiAbExShield = new G4PVPlacement(0, //no rotation
461 G4ThreeVector((2*s-1)*(AbsorberThickness/2-AbExShieldThickness/2),0.,0.), //its position
462 "EMAbExShield", //its name
463 EMlogicAbExShield, //its logical volume
464 EMphysiAbsorber, //its mother
465 false, //no boulean operat
474 EMsolidGap = new G4Box("EMGap",
475 GapThickness/2,ModuleSizeY/2,EMModuleSizeZ/2);
477 EMlogicGap = new G4LogicalVolume(EMsolidGap,
481 EMphysiGap = new G4PVPlacement(0, //no rotation
482 G4ThreeVector(AbsorberThickness/2,0.,0.), //its position
484 EMlogicGap, //its logical volume
485 EMphysiLayer, //its mother
486 false, //no boulean operat
493 EMsolidSc = new G4Box("EMSc",
494 ScThickness/2,ScSizeY/2,EMModuleSizeZ/2);
496 EMlogicSc = new G4LogicalVolume(EMsolidSc,
501 for(int i=0; i<+3; i++)
503 EMphysiSc = new G4PVPlacement(0, //no rotation
504 G4ThreeVector(0.,(i-1)*(ScSizeY+2*RodRad),0.), //its position
506 EMlogicSc, //its logical volume
507 EMphysiGap, //its mother
508 false, //no boulean operat
516 EMsolidRod = new G4Tubs("EMRod",
517 0.,RodRad,EMModuleSizeZ/2,0*deg,360*deg);
519 EMlogicRod = new G4LogicalVolume(EMsolidRod,
523 for(int h=0; h<2; h++)
525 new G4PVPlacement(0, //no rotation
526 G4ThreeVector(0.,(2*h-1)*(ScSizeY/2+RodRad),0.), //its position
528 EMlogicRod, //its logical volume
529 EMphysiGap, //its mother
530 false, //no boulean operat
537 EMsolidSpacer = new G4Box("EMSpacer",
538 SpacerThickness/2,SpacerSizeY/2,EMModuleSizeZ/2);
540 EMlogicSpacer = new G4LogicalVolume(EMsolidSpacer,
544 for(int k=0; k<2; k++)
547 new G4PVPlacement(0, //no rotation
548 G4ThreeVector(0.,v*(3*ScSizeY/2+2*RodRad+SpacerSizeY/2),0.), //its position
549 "EMSpacer", //its name
550 EMlogicSpacer, //its logical volume
551 EMphysiGap, //its mother
552 false, //no boulean operat
558 // *******************************
559 // ******** HADModule *******
560 // *******************************
562 HADsolidModule = new G4Box("HADModule", //its name
563 HADModuleThickness/2,ModuleSizeY/2,HADModuleSizeZ/2);//size
565 HADlogicModule = new G4LogicalVolume(HADsolidModule, //its solid
566 defaultMaterial, //its material
567 "HADModule"); //its name
569 HADphysiModule = new G4PVPlacement(0, //no rotation
570 G4ThreeVector(ModuleSizeX/2-HADModuleThickness/2-
571 AbsorberThickness,0.,0.), //at (0,0,0)
572 HADlogicModule, //its logical volume
573 "HADModule", //its name
574 logicModule, //its mother volume
575 false, //no boolean operation
581 HADsolidLayer = new G4Box("HADLayer", //its name
582 LayerThickness/2,ModuleSizeY/2,HADModuleSizeZ/2); //size
584 HADlogicLayer = new G4LogicalVolume(HADsolidLayer, //its solid
585 defaultMaterial, //its material
586 "HADLayer"); //its name
588 G4VPVParameterisation * HADLayersParam =
589 new T36LayerParam(LayerThickness,NbOfHADLayers);
591 HADphysiLayer = new G4PVParameterised("HADLayer", //its name
592 HADlogicLayer, //its logical volume
593 HADphysiModule, //its mother
594 kXAxis, //axis of param
595 NbOfHADLayers, //number of param
596 HADLayersParam); //param
600 HADsolidAbsorber = new G4Box("HADAbsorber", //its name
601 AbsorberThickness/2,ModuleSizeY/2,HADModuleSizeZ/2);
603 HADlogicAbsorber = new G4LogicalVolume(HADsolidAbsorber, //its solid
604 defaultMaterial, //its material
605 "HADAbsorber"); //its name
607 HADphysiAbsorber = new G4PVPlacement(0, //no rotation
608 G4ThreeVector(-GapThickness/2,0.,0.), //its position
609 "HADAbsorber", //its name
610 HADlogicAbsorber, //its logical volume
611 HADphysiLayer, //its mother
612 false, //no boulean operat
617 // Pb HADAbsorber Medium Shield
619 HADsolidAbMedShield = new G4Box("HADAbMedShield", //its name
620 AbMedShieldThickness/2,ModuleSizeY/2,HADModuleSizeZ/2);
622 HADlogicAbMedShield = new G4LogicalVolume(HADsolidAbMedShield, //its solid
623 MedAbsMaterial, //its material
624 "HADAbMedShield"); //its name
626 HADphysiAbMedShield = new G4PVPlacement(0, //no rotation
627 G4ThreeVector(0.,0.,0.), //its position
628 "HADAbMedShield", //its name
629 HADlogicAbMedShield, //its logical volume
630 HADphysiAbsorber, //its mother
631 false, //no boulean operat
635 // 2 Pb HADAbsorber External Shields
637 HADsolidAbExShield = new G4Box("HADAbExShield", //its name
638 AbExShieldThickness/2,ModuleSizeY/2,HADModuleSizeZ/2);
640 HADlogicAbExShield = new G4LogicalVolume(HADsolidAbExShield, //its solid
641 ExAbsMaterial, //its material
642 "HADAbExShield"); //its name
644 for(int hs=0; hs<2; hs++)
646 HADphysiAbExShield = new G4PVPlacement(0, //no rotation
647 G4ThreeVector((2*hs-1)*(AbsorberThickness/2-AbExShieldThickness/2),0.,0.), //its position
648 "HADAbExShield", //its name
649 HADlogicAbExShield, //its logical volume
650 HADphysiAbsorber, //its mother
651 false, //no boulean operat
657 // last Pb HADAbsorber
661 lastHADsolidAbsorber = new G4Box("lastHADAbsorber", //its name
662 AbsorberThickness/2,ModuleSizeY/2,HADModuleSizeZ/2);
664 lastHADlogicAbsorber = new G4LogicalVolume(lastHADsolidAbsorber, //its solid
665 defaultMaterial, //its material
666 "lastHADAbsorber"); //its name
668 lastHADphysiAbsorber = new G4PVPlacement(0, //no rotation
669 G4ThreeVector(ModuleSizeX/2-AbsorberThickness/2,0.,0.), //its position
670 lastHADlogicAbsorber, //its logical volume
671 "lastHADAbsorber", //its name
672 logicModule, //its mother
673 false, //no boulean operat
677 // last Pb HADAbsorber Medium Shield
679 lastHADphysiAbMedShield = new G4PVPlacement(0, //no rotation
680 G4ThreeVector(0.,0.,0.), //its position
681 "lastHADAbMedShield", //its name
682 HADlogicAbMedShield, //its logical volume
683 lastHADphysiAbsorber, //its mother
684 false, //no boulean operat
688 // 2 last Pb HADAbsorber External Shields
690 for(int ls=0; ls<2; ls++)
692 lastHADphysiAbMedShield = new G4PVPlacement(0, //no rotation
693 G4ThreeVector((2*ls-1)*(AbsorberThickness/2-AbExShieldThickness/2),0.,0.), //its position
694 "lastHADAbExShield", //its name
695 HADlogicAbExShield, //its logical volume
696 lastHADphysiAbsorber, //its mother
697 false, //no boulean operat
706 HADsolidGap = new G4Box("HADGap",
707 GapThickness/2,ModuleSizeY/2,HADModuleSizeZ/2);
709 HADlogicGap = new G4LogicalVolume(HADsolidGap,
713 HADphysiGap = new G4PVPlacement(0, //no rotation
714 G4ThreeVector(AbsorberThickness/2,0.,0.), //its position
716 HADlogicGap, //its logical volume
717 HADphysiLayer, //its mother
718 false, //no boulean operat
725 HADsolidSc = new G4Box("HADSc",
726 ScThickness/2,ScSizeY/2,HADModuleSizeZ/2);
728 HADlogicSc = new G4LogicalVolume(HADsolidSc,
733 for(int m=0; m<+3; m++)
735 HADphysiSc = new G4PVPlacement(0, //no rotation
736 G4ThreeVector(0.,(m-1)*(ScSizeY+2*RodRad),0.), //its position
738 HADlogicSc, //its logical volume
739 HADphysiGap, //its mother
740 false, //no boulean operat
748 HADsolidRod = new G4Tubs("HADRod",
749 0.,RodRad,HADModuleSizeZ/2,0*deg,360*deg);
751 HADlogicRod = new G4LogicalVolume(HADsolidRod,
755 for(int q=0; q<2; q++)
757 new G4PVPlacement(0, //no rotation
758 G4ThreeVector(0.,(2*q-1)*(ScSizeY/2+RodRad),0.), //its position
760 HADlogicRod, //its logical volume
761 HADphysiGap, //its mother
762 false, //no boulean operat
769 HADsolidSpacer = new G4Box("HADSpacer",
770 SpacerThickness/2,SpacerSizeY/2,HADModuleSizeZ/2);
772 HADlogicSpacer = new G4LogicalVolume(HADsolidSpacer,
776 for(int z=0; z<2; z++)
779 new G4PVPlacement(0, //no rotation
780 G4ThreeVector(0.,y*(3*ScSizeY/2+2*RodRad+SpacerSizeY/2),0.), //its position
781 "HADSpacer", //its name
782 HADlogicSpacer, //its logical volume
783 HADphysiGap, //its mother
784 false, //no boulean operat
789 // Sensitive EM and HAD Detectors: Absorber and Gap
791 G4SDManager* SDman = G4SDManager::GetSDMpointer();
792 SDman->SetVerboseLevel(1);
794 //for N02: N.B. non basta dichiarare la "madre" volume sensibile, bisogna
795 // dichiarare anche ogni figlio!!!
799 G4String EMcaloSDname = "/mydet/EMcalorimeter";
800 EMcalorimeterSD = new T36EMCalorimeterSD(EMcaloSDname,this);
801 SDman->AddNewDetector( EMcalorimeterSD );
805 EMlogicAbsorber->SetSensitiveDetector(EMcalorimeterSD);
806 if (EMlogicAbExShield)
807 EMlogicAbExShield->SetSensitiveDetector(EMcalorimeterSD);
808 if (EMlogicAbMedShield)
809 EMlogicAbMedShield->SetSensitiveDetector(EMcalorimeterSD);
812 EMlogicGap->SetSensitiveDetector(EMcalorimeterSD);
814 EMlogicSc->SetSensitiveDetector(EMcalorimeterSD);
816 EMlogicRod->SetSensitiveDetector(EMcalorimeterSD);
818 EMlogicSpacer->SetSensitiveDetector(EMcalorimeterSD);
820 if(!HADcalorimeterSD)
822 G4String HADcaloSDname = "/mydet/HADcalorimeter";
823 HADcalorimeterSD = new T36HADCalorimeterSD(HADcaloSDname,this);
824 SDman->AddNewDetector( HADcalorimeterSD );
827 if (HADlogicAbsorber)
828 HADlogicAbsorber->SetSensitiveDetector(HADcalorimeterSD);
829 if (HADlogicAbExShield)
830 HADlogicAbExShield->SetSensitiveDetector(HADcalorimeterSD);
831 if (HADlogicAbMedShield)
832 HADlogicAbMedShield->SetSensitiveDetector(HADcalorimeterSD);
835 HADlogicGap->SetSensitiveDetector(HADcalorimeterSD);
837 HADlogicSc->SetSensitiveDetector(HADcalorimeterSD);
839 HADlogicRod->SetSensitiveDetector(HADcalorimeterSD);
841 HADlogicSpacer->SetSensitiveDetector(HADcalorimeterSD);
843 if (lastHADlogicAbsorber)
844 lastHADlogicAbsorber->SetSensitiveDetector(HADcalorimeterSD);
850 // Visualization attributes
853 logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
854 G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
855 simpleBoxVisAtt->SetVisibility(true);
856 logicCalor->SetVisAttributes(simpleBoxVisAtt);
860 //always return the physical World
865 void MyDetectorConstruction::PrintCalorParameters()
867 G4cout << "\n The calorimeter is made of " << NbOfEMLayers << "EM layers and "
868 << NbOfHADLayers << "HAD layers of: [ "
869 << AbsorberThickness/mm << "mm of " << MedAbsMaterial->GetName()
871 << GapThickness/mm << "mm of " << GapMaterial->GetName() << " ] "
875 void MyDetectorConstruction::SetMagField(G4double fieldValue)
877 //apply a global uniform magnetic field along Z axis
878 G4FieldManager* fieldMgr
879 = G4TransportationManager::GetTransportationManager()->GetFieldManager();
881 if(magField) delete magField; //delete the existing magn field
883 if(fieldValue!=0.) // create a new one if non nul
884 { magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
885 fieldMgr->SetDetectorField(magField);
886 fieldMgr->CreateChordFinder(magField);
889 fieldMgr->SetDetectorField(magField);