File indexing completed on 2025-01-18 09:17:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 #include "XrayFluoDetectorConstruction.hh"
0039 #include "XrayFluoDetectorMessenger.hh"
0040 #include "XrayFluoSD.hh"
0041 #include "G4PhysicalConstants.hh"
0042 #include "G4SystemOfUnits.hh"
0043 #include "G4Material.hh"
0044 #include "G4ThreeVector.hh"
0045 #include "G4Box.hh"
0046 #include "G4Sphere.hh"
0047 #include "G4Tubs.hh"
0048 #include "G4LogicalVolume.hh"
0049 #include "G4PVPlacement.hh"
0050 #include "G4TransportationManager.hh"
0051 #include "G4SDManager.hh"
0052 #include "G4RunManager.hh"
0053 #include "G4VisAttributes.hh"
0054 #include "G4Colour.hh"
0055 #include "G4ios.hh"
0056 #include "G4PVReplica.hh"
0057 #include "G4UserLimits.hh"
0058 #include "G4GeometryManager.hh"
0059 #include "G4PhysicalVolumeStore.hh"
0060 #include "G4LogicalVolumeStore.hh"
0061 #include "G4SolidStore.hh"
0062 #include "XrayFluoNistMaterials.hh"
0063 #include "G4SDManager.hh"
0064
0065
0066
0067
0068
0069
0070
0071 XrayFluoDetectorConstruction::XrayFluoDetectorConstruction()
0072 : aNavigator(0), detectorType(0),sampleGranularity(false), phaseSpaceFlag(false),
0073 DeviceSizeX(0), DeviceSizeY(0),DeviceThickness(0),
0074 solidWorld(0),logicWorld(0),physiWorld(0),
0075 solidHPGe(0),logicHPGe(0),physiHPGe(0),
0076 solidSample (0),logicSample(0),physiSample (0),
0077 solidDia1(0),logicDia1(0),physiDia1(0),
0078 solidDia3(0),logicDia3(0),physiDia3(0),
0079 solidOhmicPos(0),logicOhmicPos(0), physiOhmicPos(0),
0080 solidWindow(0), logicWindow(0), physiWindow(0),
0081 solidOhmicNeg(0),logicOhmicNeg(0), physiOhmicNeg(0),
0082 solidPixel(0),logicPixel(0), physiPixel(0),
0083 OhmicPosMaterial(0), OhmicNegMaterial(0),
0084 pixelMaterial(0),sampleMaterial(0),
0085 Dia1Material(0),Dia3Material(0),
0086 defaultMaterial(0), windowMaterial (0)
0087 {
0088 materials = XrayFluoNistMaterials::GetInstance();
0089
0090 HPGeSD.Put(0);
0091
0092 aNavigator = new G4Navigator();
0093
0094 DefineDefaultMaterials();
0095
0096 NbOfPixelRows = 1;
0097 NbOfPixelColumns = 1;
0098 NbOfPixels = NbOfPixelRows*NbOfPixelColumns;
0099 PixelSizeXY = std::sqrt(40.) * mm;
0100 PixelThickness = 2.7 * mm;
0101
0102 G4cout << "PixelThickness(mm): "<< PixelThickness/mm << G4endl;
0103 G4cout << "PixelSizeXY(cm): "<< PixelSizeXY/cm << G4endl;
0104
0105 ContactSizeXY = PixelSizeXY;
0106 SampleThickness = 4 * mm;
0107 SampleSizeXY = 3. * cm;
0108 Dia1Thickness = 1. *mm;
0109 Dia3Thickness = 1. *mm;
0110 Dia1SizeXY = 3. *cm;
0111 Dia3SizeXY = 3. *cm;
0112
0113
0114 DiaInnerSize = 2.9 * cm;
0115
0116
0117 OhmicNegThickness = 1e-6*cm;
0118 OhmicPosThickness = 1e-6*cm;
0119 windowThickness = 0.008 * cm;
0120 ThetaHPGe = 135. * deg;
0121 PhiHPGe = 225. * deg;
0122
0123 ThetaDia1 = 135. * deg;
0124 PhiDia1 = 90. * deg;
0125 AlphaDia1 = 225. * deg;
0126
0127 AlphaDia3 = 180. * deg;
0128 Dia3Dist = 66.5 * mm;
0129 Dia3InnerSize = 1. * mm;
0130 ThetaDia3 = 180. * deg;
0131 PhiDia3 = 90. * deg;
0132
0133 DistDia = 66.5 * mm;
0134 DistDe =DistDia+ (Dia1Thickness
0135 +PixelThickness)/2+OhmicPosThickness+windowThickness ;
0136
0137 grainDia = 1 * mm;
0138 PixelCopyNb=0;
0139 grainCopyNb=0;
0140 G4String defaultDetectorType = "sili";
0141 ComputeApparateParameters();
0142
0143
0144
0145
0146 if (!phaseSpaceFlag) SetDetectorType(defaultDetectorType);
0147
0148
0149
0150 detectorMessenger = new XrayFluoDetectorMessenger(this);
0151
0152 G4cout << "XrayFluoDetectorConstruction created" << G4endl;
0153 }
0154
0155
0156
0157 XrayFluoDetectorConstruction* XrayFluoDetectorConstruction::instance = 0;
0158
0159 XrayFluoDetectorConstruction* XrayFluoDetectorConstruction::GetInstance()
0160 {
0161 if (instance == 0)
0162 {
0163 instance = new XrayFluoDetectorConstruction;
0164
0165 }
0166 return instance;
0167 }
0168
0169
0170
0171 void XrayFluoDetectorConstruction::SetDetectorType(G4String type)
0172 {
0173 if (type=="sili")
0174 {
0175 detectorType = XrayFluoSiLiDetectorType::GetInstance();
0176 }
0177 else if (type=="hpge")
0178 {
0179 detectorType = XrayFluoHPGeDetectorType::GetInstance();
0180 }
0181
0182
0183
0184
0185 else
0186 {
0187 G4ExceptionDescription execp;
0188 execp << type + "detector type unknown";
0189 G4Exception("XrayFluoDataSet::LoadData()","example-xray_fluorescence06",
0190 FatalException, execp);
0191 }
0192
0193
0194 }
0195
0196 XrayFluoVDetectorType* XrayFluoDetectorConstruction::GetDetectorType() const
0197 {
0198 return detectorType;
0199 }
0200
0201
0202
0203 XrayFluoDetectorConstruction::~XrayFluoDetectorConstruction()
0204
0205 {
0206 delete detectorMessenger;
0207 delete detectorType;
0208 G4cout << "XrayFluoDetectorConstruction deleted" << G4endl;
0209 }
0210
0211
0212
0213 G4VPhysicalVolume* XrayFluoDetectorConstruction::Construct()
0214 {
0215 return ConstructApparate();
0216 }
0217
0218
0219
0220 void XrayFluoDetectorConstruction::DefineDefaultMaterials()
0221 {
0222
0223
0224
0225
0226 sampleMaterial = materials->GetMaterial("Dolorite");
0227 Dia1Material = materials->GetMaterial("G4_Pb");
0228 Dia3Material = materials->GetMaterial("G4_Galactic");
0229 pixelMaterial = materials->GetMaterial("SiLi");
0230
0231 OhmicPosMaterial = materials->GetMaterial("G4_Ni");
0232 OhmicNegMaterial = materials->GetMaterial("G4_Pb");
0233 defaultMaterial = materials->GetMaterial("G4_Galactic");
0234 windowMaterial = materials->GetMaterial("G4_Be");
0235 }
0236
0237 void XrayFluoDetectorConstruction::SetOhmicPosThickness(G4double val)
0238 {
0239
0240 if (!phaseSpaceFlag) {
0241
0242
0243 if (val == 0.0) {
0244 OhmicPosMaterial = materials->GetMaterial("G4_Galactic");
0245 }
0246 else {
0247 OhmicPosThickness = val;
0248
0249 OhmicPosMaterial = materials->GetMaterial("G4_Ni");
0250 }
0251
0252 }
0253 else{
0254 G4cout << "Not available in this configuration" << G4endl;
0255 }
0256
0257 }
0258
0259
0260
0261
0262 G4VPhysicalVolume* XrayFluoDetectorConstruction::ConstructApparate()
0263 {
0264
0265
0266
0267
0268
0269
0270 solidWorld = new G4Box("World",
0271 WorldSizeXY/2,WorldSizeXY/2,WorldSizeZ/2);
0272
0273 logicWorld = new G4LogicalVolume(solidWorld,
0274 defaultMaterial,
0275 "World");
0276 physiWorld = new G4PVPlacement(0,
0277 G4ThreeVector(),
0278 "World",
0279 logicWorld,
0280 0,
0281 false,
0282 0);
0283
0284 aNavigator->SetWorldVolume(physiWorld);
0285
0286
0287
0288
0289 if (!phaseSpaceFlag) {
0290
0291 solidHPGe = 0; physiHPGe = 0; logicHPGe=0;
0292 solidPixel=0; logicPixel=0; physiPixel=0;
0293
0294 if (DeviceThickness > 0.)
0295 {
0296 solidHPGe = new G4Box("HPGeDetector",
0297 DeviceSizeX/2,DeviceSizeY/2,DeviceThickness/2);
0298
0299
0300 logicHPGe = new G4LogicalVolume(solidHPGe,
0301 defaultMaterial,
0302 "HPGeDetector");
0303
0304 zRotPhiHPGe.rotateX(PhiHPGe);
0305 G4double x,y,z;
0306 z = DistDe * std::cos(ThetaHPGe);
0307 y =DistDe * std::sin(ThetaHPGe);
0308 x = 0.*cm;
0309 physiHPGe = new G4PVPlacement(G4Transform3D(zRotPhiHPGe,G4ThreeVector(x,y,z)),
0310 "HPGeDetector",
0311 logicHPGe,
0312 physiWorld,
0313 false,
0314 0);
0315 }
0316
0317
0318
0319
0320
0321 for ( G4int j=0; j < NbOfPixelColumns ; j++ )
0322 { for ( G4int i=0; i < NbOfPixelRows ; i++ )
0323 {
0324 solidPixel=0; logicPixel=0; physiPixel=0;
0325 if (PixelThickness > 0.)
0326 solidPixel = new G4Box("Pixel",
0327 PixelSizeXY/2,PixelSizeXY/2, PixelThickness/2);
0328
0329 logicPixel = new G4LogicalVolume(solidPixel,
0330 pixelMaterial,
0331 "Pixel");
0332
0333
0334
0335
0336
0337
0338
0339 physiPixel = new G4PVPlacement(0,
0340 G4ThreeVector(0,
0341 i*PixelSizeXY,
0342 j*PixelSizeXY ),
0343 "Pixel",
0344 logicPixel,
0345 physiHPGe,
0346 false,
0347 PixelCopyNb);
0348
0349
0350
0351
0352
0353
0354
0355
0356 solidOhmicNeg=0; logicOhmicNeg=0; physiOhmicNeg=0;
0357
0358 if (OhmicNegThickness > 0.)
0359 { solidOhmicNeg = new G4Box("OhmicNeg",
0360 PixelSizeXY/2,PixelSizeXY/2,OhmicNegThickness/2);
0361
0362 logicOhmicNeg = new G4LogicalVolume(solidOhmicNeg,
0363 OhmicNegMaterial,
0364 "OhmicNeg");
0365
0366 physiOhmicNeg = new G4PVPlacement(0,
0367 G4ThreeVector
0368 (0.,
0369 0.,
0370 (PixelThickness+OhmicNegThickness)/2),
0371 "OhmicNeg",
0372 logicOhmicNeg,
0373 physiHPGe,
0374 false,
0375 PixelCopyNb);
0376
0377 }
0378
0379 solidOhmicPos=0; logicOhmicPos=0; physiOhmicPos=0;
0380
0381 if (OhmicPosThickness > 0.)
0382 { solidOhmicPos = new G4Box("OhmicPos",
0383 PixelSizeXY/2,PixelSizeXY/2,OhmicPosThickness/2);
0384
0385 logicOhmicPos = new G4LogicalVolume(solidOhmicPos,
0386 OhmicPosMaterial,
0387 "OhmicPos");
0388
0389 physiOhmicPos = new G4PVPlacement(0,
0390 G4ThreeVector(0.,
0391 0.,
0392 (-PixelThickness-OhmicPosThickness)/2),
0393 "OhmicPos",
0394 logicOhmicPos,
0395 physiHPGe,
0396 false,
0397 PixelCopyNb);
0398
0399 }
0400
0401
0402
0403 solidWindow=0; logicWindow=0; physiWindow=0;
0404
0405 if (windowThickness > 0.)
0406 { solidWindow = new G4Box("Window",
0407 PixelSizeXY/2,PixelSizeXY/2,windowThickness/2);
0408
0409 logicWindow = new G4LogicalVolume(solidWindow,
0410 windowMaterial,
0411 "Window");
0412
0413 physiWindow = new G4PVPlacement(0,
0414 G4ThreeVector(0.,
0415 0.,
0416 ((-PixelThickness-windowThickness)/2)
0417 -OhmicPosThickness),
0418 "OhmicWindow",
0419 logicWindow,
0420 physiHPGe,
0421 false,
0422 PixelCopyNb);
0423
0424 }
0425
0426
0427
0428 PixelCopyNb += PixelCopyNb;
0429 G4cout << "PixelCopyNb: " << PixelCopyNb << G4endl;
0430 }
0431
0432 }
0433
0434 }
0435
0436
0437
0438 if (sampleGranularity) {
0439
0440 solidSample=0; logicSample=0; physiSample=0;
0441 if (SampleThickness > 0.)
0442 {
0443 solidSample = new G4Box("Sample",
0444 SampleSizeXY/2,SampleSizeXY/2,SampleThickness/2);
0445
0446 logicSample= new G4LogicalVolume(solidSample,
0447 defaultMaterial,
0448 "Sample");
0449
0450 physiSample = new G4PVPlacement(0,
0451 G4ThreeVector(),
0452 "Sample",
0453 logicSample,
0454 physiWorld,
0455 false,
0456 0);
0457
0458 }
0459
0460
0461
0462
0463 G4int nbOfGrainsX = ((G4int)(SampleSizeXY/grainDia)) -1 ;
0464
0465
0466
0467
0468
0469
0470 G4double a = (1.-(std::sqrt(3.)/2.));
0471 G4int nbOfGrainsY = (G4int) ( ((SampleSizeXY/(grainDia/2.)) -a)/(2.-a) ) -1;
0472
0473
0474
0475 G4double b = 2. * (std::sqrt(3.) - std::sqrt(2.))/std::sqrt(3.);
0476 G4int nbOfGrainsZ = (G4int) ( ((SampleThickness/(grainDia/2.)) -b)/(2.-b) )-1;
0477
0478 if (SampleThickness > 0.){
0479
0480 solidGrain=0; logicGrain=0; physiGrain=0;
0481 solidGrain = new G4Sphere("Grain",0.,
0482 grainDia/2,0., twopi, 0., pi);
0483
0484 logicGrain = new G4LogicalVolume(solidGrain,
0485 sampleMaterial,
0486 "Grain");
0487 G4ThreeVector grainPosition;
0488 G4double grainInitPositionX = 0;
0489 G4double grainInitPositionY = 0;
0490 G4double grainInitPositionZ = (-1.*SampleThickness/2.+grainDia/2.);
0491 G4double grainStepX = grainDia = 0;
0492 G4double grainStepY = grainDia*(1.-(0.5-(std::sqrt(3.)/4.)));
0493 G4double grainStepZ = grainDia*std::sqrt(2./3.);
0494
0495 for ( G4int k=0; k < nbOfGrainsZ ; k++ ) {
0496 for ( G4int j=0; j < nbOfGrainsY ; j++ ) {
0497 for ( G4int i=0; i < nbOfGrainsX ; i++ ) {
0498
0499
0500
0501
0502
0503 if (k%3 == 0) {
0504 grainInitPositionY = (-1.*SampleSizeXY/2.+grainDia/2.);
0505 if (j%2 ==0) {
0506 grainInitPositionX = (-1.*SampleSizeXY/2.+grainDia/2.);
0507 }
0508
0509 else if ( ((j+1) % 2) == 0 ) {
0510 grainInitPositionX = (-1.*SampleSizeXY/2.+ grainDia);
0511 }
0512
0513 }
0514 else if ( ((k+2) % 3) == 0 ) {
0515
0516 grainInitPositionY = ( (-1.*SampleSizeXY/2.) + (grainDia/2.)*(1. + (1./std::sqrt(3.)) ) );
0517
0518 if (j%2 ==0) {
0519 grainInitPositionX = (-1.*SampleSizeXY/2.+grainDia);
0520 }
0521
0522 else if ( (j+1)%2 == 0 ) {
0523 grainInitPositionX = (-1.*SampleSizeXY/2.+grainDia/2);
0524 }
0525
0526 }
0527
0528 else if ( (k+1)%3 == 0 ) {
0529
0530 grainInitPositionY = (-1.*SampleSizeXY/2.+(grainDia/2.)*(1.+2./std::sqrt(3.)) );
0531
0532 if (j%2 ==0) {
0533 grainInitPositionX = (-1.*SampleSizeXY/2.+grainDia/2.);
0534 }
0535
0536 else if ( (j+1)%2 == 0 ) {
0537 grainInitPositionX = (-1.*SampleSizeXY/2.+grainDia);
0538 }
0539
0540 }
0541
0542 physiGrain = new G4PVPlacement(0,
0543 G4ThreeVector( grainInitPositionX + i*grainStepX,
0544 grainInitPositionY + j*grainStepY,
0545 grainInitPositionZ + k*grainStepZ),
0546 "Grain",
0547 logicGrain,
0548 physiSample,
0549 false,
0550 grainCopyNb);
0551
0552 grainCopyNb = grainCopyNb +1;
0553 }
0554 }
0555 }
0556 }
0557 }
0558 else {
0559
0560 solidSample=0; logicSample=0; physiSample=0;
0561 if (SampleThickness > 0.)
0562 {
0563 solidSample = new G4Box("Sample",
0564 SampleSizeXY/2,SampleSizeXY/2,SampleThickness/2);
0565
0566 logicSample= new G4LogicalVolume(solidSample,
0567 sampleMaterial,
0568 "Sample");
0569
0570 physiSample = new G4PVPlacement(0,
0571 G4ThreeVector(),
0572 "Sample",
0573 logicSample,
0574 physiWorld,
0575 false,
0576 0);
0577
0578 }
0579 }
0580
0581 if (!phaseSpaceFlag) {
0582
0583
0584 solidDia1 = 0; physiDia1 = 0; logicDia1=0;
0585
0586 if (Dia1Thickness > 0.)
0587 {
0588 solidDia1 = new G4Tubs("Diaphragm1",
0589 DiaInnerSize/2,
0590 Dia1SizeXY/2,
0591 Dia1Thickness/2,
0592 0,
0593 360*deg);
0594
0595
0596 logicDia1 = new G4LogicalVolume(solidDia1,
0597 Dia1Material,
0598 "Diaphragm1");
0599
0600 zRotPhiDia1.rotateX(AlphaDia1);
0601 G4double x,y,z;
0602 z = DistDia * std::cos(ThetaDia1);
0603 y =DistDia * std::sin(ThetaDia1);
0604 x = 0.*cm;
0605 physiDia1 = new G4PVPlacement(G4Transform3D(zRotPhiDia1,G4ThreeVector(x,y,z)),
0606 "Diaphragm1",
0607 logicDia1,
0608 physiWorld,
0609 false,
0610 0);
0611 }
0612
0613
0614
0615 solidDia3 = 0; physiDia3 = 0; logicDia3 =0;
0616
0617 if (Dia3Thickness > 0.)
0618 {
0619 solidDia3 = new G4Tubs("Diaphragm3",
0620 Dia3InnerSize/2,
0621 Dia3SizeXY/2,
0622 Dia3Thickness/2,
0623 0,
0624 360*deg);
0625
0626
0627 logicDia3 = new G4LogicalVolume(solidDia3,
0628 Dia3Material,
0629 "Diaphragm3");
0630
0631 zRotPhiDia3.rotateX(AlphaDia3);
0632 G4double x,y,z;
0633 z = Dia3Dist * std::cos(ThetaDia3);
0634 y =Dia3Dist * std::sin(ThetaDia3);
0635 x = 0.*cm;
0636 physiDia3 = new G4PVPlacement(G4Transform3D(zRotPhiDia3,G4ThreeVector(x,y,z)), "Diaphragm3",
0637 logicDia3,
0638 physiWorld,
0639 false,
0640 0);
0641 }
0642 }
0643
0644
0645
0646
0647
0648 logicWorld->SetVisAttributes (G4VisAttributes::GetInvisible());
0649 G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
0650 G4VisAttributes * yellow= new G4VisAttributes( G4Colour(255/255. ,255/255. ,51/255. ));
0651 G4VisAttributes * red= new G4VisAttributes( G4Colour(255/255. , 0/255. , 0/255. ));
0652 G4VisAttributes * blue= new G4VisAttributes( G4Colour(0/255. , 0/255. , 255/255. ));
0653 G4VisAttributes * grayc= new G4VisAttributes( G4Colour(128/255. , 128/255. , 128/255. ));
0654 G4VisAttributes * lightGray= new G4VisAttributes( G4Colour(178/255. , 178/255. , 178/255. ));
0655 G4VisAttributes * green= new G4VisAttributes( G4Colour(0/255. , 255/255. , 0/255. ));
0656
0657 yellow->SetVisibility(true);
0658 yellow->SetForceSolid(true);
0659 red->SetVisibility(true);
0660 red->SetForceSolid(true);
0661 blue->SetVisibility(true);
0662 green->SetVisibility(true);
0663 green->SetForceSolid(true);
0664 grayc->SetVisibility(true);
0665 grayc->SetForceSolid(true);
0666 lightGray->SetVisibility(true);
0667 lightGray->SetForceSolid(true);
0668 simpleBoxVisAtt->SetVisibility(true);
0669 if (!phaseSpaceFlag) {
0670 logicPixel->SetVisAttributes(red);
0671 logicHPGe->SetVisAttributes(blue);
0672
0673 logicDia1->SetVisAttributes(lightGray);
0674 logicDia3->SetVisAttributes(lightGray);
0675
0676 logicOhmicNeg->SetVisAttributes(yellow);
0677 logicOhmicPos->SetVisAttributes(yellow);
0678
0679 logicWindow->SetVisAttributes(green);
0680
0681 }
0682 logicSample->SetVisAttributes(simpleBoxVisAtt);
0683
0684 if (sampleGranularity) logicSample->SetVisAttributes(simpleBoxVisAtt);
0685
0686
0687
0688 if (sampleGranularity) logicGrain->SetVisAttributes(grayc);
0689
0690
0691
0692 PrintApparateParameters();
0693
0694 return physiWorld;
0695 }
0696
0697
0698
0699 void XrayFluoDetectorConstruction::ConstructSDandField()
0700 {
0701 if (!phaseSpaceFlag)
0702 {
0703
0704
0705
0706
0707 if (HPGeSD.Get() == 0)
0708 {
0709 XrayFluoSD* SD = new XrayFluoSD ("HPGeSD",this);
0710 HPGeSD.Put( SD );
0711 }
0712 G4SDManager::GetSDMpointer()->AddNewDetector(HPGeSD.Get());
0713 if (logicPixel)
0714 SetSensitiveDetector(logicPixel,HPGeSD.Get());
0715 }
0716 return;
0717 }
0718
0719
0720
0721 void XrayFluoDetectorConstruction::PrintApparateParameters()
0722 {
0723 G4cout << "-----------------------------------------------------------------------"
0724 << G4endl
0725 << "The sample is a box whose size is: "
0726 << G4endl
0727 << SampleThickness/cm
0728 << " cm * "
0729 << SampleSizeXY/cm
0730 << " cm * "
0731 << SampleSizeXY/cm
0732 << " cm"
0733 << G4endl
0734 <<" Material: " << logicSample->GetMaterial()->GetName()
0735 <<G4endl;
0736 if (!phaseSpaceFlag) {
0737 G4cout <<"The Detector is a slice " << DeviceThickness/(1.e-6*m) << " micron thick of " << pixelMaterial->GetName()
0738 <<G4endl
0739 << "The Anode is a slice " << OhmicPosThickness/mm << "mm thick of "<< OhmicPosMaterial->GetName()
0740 <<G4endl;
0741 }
0742 G4cout <<"-------------------------------------------------------------------------"
0743 << G4endl;
0744 }
0745
0746
0747 void XrayFluoDetectorConstruction::UpdateGeometry()
0748 {
0749 G4GeometryManager::GetInstance()->OpenGeometry();
0750 G4PhysicalVolumeStore::Clean();
0751 G4LogicalVolumeStore::Clean();
0752 G4SolidStore::Clean();
0753
0754 if (sampleRegion)
0755 sampleRegion->RemoveRootLogicalVolume(logicSample);
0756
0757 zRotPhiHPGe.rotateX(-1.*PhiHPGe);
0758 zRotPhiDia1.rotateX(-1.*AlphaDia1);
0759 zRotPhiDia3.rotateX(-1.*AlphaDia3);
0760
0761
0762 G4RunManager::GetRunManager()->ReinitializeGeometry();
0763 }
0764
0765
0766
0767 void XrayFluoDetectorConstruction::DeleteGrainObjects()
0768 {
0769 if (sampleGranularity) {
0770 delete solidGrain;
0771 delete logicGrain;
0772 delete physiGrain;
0773 }
0774
0775 }
0776
0777
0778
0779 G4ThreeVector XrayFluoDetectorConstruction::GetDetectorPosition() const
0780 {
0781 G4double z = DistDe * std::cos(ThetaHPGe);
0782 G4double y = DistDe * std::sin(ThetaHPGe);
0783 G4double x = 0.*cm;
0784
0785 G4ThreeVector position(x,y,z);
0786
0787 return position;
0788
0789 }
0790
0791
0792
0793 void XrayFluoDetectorConstruction::SetSampleMaterial(G4String newMaterial)
0794 {
0795 G4cout << "Material Change in Progress " << newMaterial << G4endl;
0796 sampleMaterial = materials->GetMaterial(newMaterial);
0797 logicSample->SetMaterial(sampleMaterial);
0798 PrintApparateParameters();
0799
0800 }
0801
0802
0803
0804
0805
0806
0807
0808
0809
0810
0811
0812
0813