#include "DoubleDynamite.hh" #include "G4Box.hh" #include "G4PVPlacement.hh" #include "G4SystemOfUnits.hh" #include "G4UserLimits.hh" DoubleDynamite::DoubleDynamite() { materialDefinitions = new MaterialDefinitions(); epiMaterial = materialDefinitions->GetMaterial("Silicon"); subMaterial = materialDefinitions->GetMaterial("Silicon"); backMaterial = materialDefinitions->GetMaterial("Dural"); frontFacePosition = G4ThreeVector(0*mm,0*mm,0*mm); epiXY = subXY = backXY = 10*cm; epiZ = 18*nm; subZ = 735*um; backZ = 5*mm; epi1toEpi2 = 8*mm; dynamiteEpi[0] = dynamiteEpi[1] = 0; dynamiteSub[0] = dynamiteSub[1] = 0; dynamiteBack[0] = dynamiteBack[1] = 0; dynamiteEpiLV[0] = dynamiteEpiLV[1] = 0; dynamiteSubLV[0] = dynamiteSubLV[1] = 0; dynamiteBackLV[0] = dynamiteBackLV[1] = 0; dynamiteEpiPV[0] = dynamiteEpiPV[1] = 0; dynamiteSubPV[0] = dynamiteSubPV[1] = 0; dynamiteBackPV[0] = dynamiteBackPV[1] = 0; constructDD = false; ddMessenger = new DoubleDynamiteMessenger(this); } DoubleDynamite::~DoubleDynamite() { delete dynamiteEpi[0]; delete dynamiteEpi[1]; delete dynamiteSub[0]; delete dynamiteSub[1]; delete dynamiteBack[0]; delete dynamiteBack[1]; delete dynamiteEpiLV[0]; delete dynamiteEpiLV[1]; delete dynamiteSubLV[0]; delete dynamiteSubLV[1]; delete dynamiteBackLV[0]; delete dynamiteBackLV[1]; delete dynamiteEpiPV[0]; delete dynamiteEpiPV[1]; delete dynamiteSubPV[0]; delete dynamiteSubPV[1]; delete dynamiteBackPV[0]; delete dynamiteBackPV[1]; delete ddMessenger; } void DoubleDynamite::ConstructDoubleDynamite(G4LogicalVolume* lv) { G4double ddX = 20*cm; G4double ddY = 30*cm; G4double ddZ = 10*cm; // set the location of the first epi layer relative to the mother volume G4double frontFaceToEpi1 = 2*cm; // Set the mother volume of the whole DD setup G4ThreeVector ddPos = frontFacePosition; ddPos.setZ(ddPos.getZ()-ddZ/2); G4Box* ddMother = new G4Box("ddMother", ddX/2, ddY/2, ddZ/2); G4LogicalVolume* ddMotherLV = new G4LogicalVolume(ddMother, materialDefinitions->GetMaterial("Air"), "ddMother"); G4ProductionCuts* cuts = new G4ProductionCuts ; G4double cut = 0.0001*mm; cuts -> SetProductionCut(cut,"gamma"); cuts -> SetProductionCut(cut,"e-"); cuts -> SetProductionCut(cut,"e+"); if(ddRegion) delete ddRegion; ddRegion = new G4Region("ddRegion"); ddRegion->AddRootLogicalVolume(ddMotherLV); ///ddRegion->SetProductionCuts(cuts); ddMotherLV->SetRegion(ddRegion); G4PVPlacement* ddMotherPV = new G4PVPlacement(0, ddPos, ddMotherLV, "ddMother", lv, false, 0); G4ThreeVector epi1Pos = G4ThreeVector(0,0,-ddZ/2+frontFaceToEpi1); epi1Pos.setZ(epi1Pos.getZ()+epiZ/2); // distance inside box + 1/2 epi thickness dynamiteEpi[0] = new G4Box("ddEpi1", epiXY/2, epiXY/2, epiZ/2); dynamiteEpiLV[0] = new G4LogicalVolume(dynamiteEpi[0], epiMaterial, "ddEpi1"); dynamiteEpiPV[0] = new G4PVPlacement(0, epi1Pos, dynamiteEpiLV[0], "ddEpi1", ddMotherLV, false, 0); G4double uStepMin = 1.0*um; G4double uTrakMin = 1.0*um; G4UserLimits* stepLimitMin = new G4UserLimits(uStepMin,uTrakMin); dynamiteEpiLV[0]->SetUserLimits(stepLimitMin); G4ThreeVector sub1Pos = epi1Pos; sub1Pos.setZ(sub1Pos.getZ()+subZ/2+epiZ/2); dynamiteSub[0] = new G4Box("ddSub1", subXY/2, subXY/2, subZ/2); dynamiteSubLV[0] = new G4LogicalVolume(dynamiteSub[0], subMaterial, "ddSub1"); dynamiteSubPV[0] = new G4PVPlacement(0, sub1Pos, dynamiteSubLV[0], "ddSub1", ddMotherLV, false, 0); G4ThreeVector back1Pos = sub1Pos; back1Pos.setZ(back1Pos.getZ()+subZ/2+backZ/2); dynamiteBack[0] = new G4Box("ddBack1", backXY/2, backXY/2, backZ/2); dynamiteBackLV[0] = new G4LogicalVolume(dynamiteBack[0], backMaterial, "ddBack1"); dynamiteBackPV[0] = new G4PVPlacement(0, back1Pos, dynamiteBackLV[0], "ddBack1", ddMotherLV, false, 0); G4ThreeVector epi2Pos = back1Pos; epi2Pos.setZ(epi2Pos.getZ()+backZ/2+epiZ/2+epi1toEpi2); // distance inside box + 1/2 epi thickness dynamiteEpi[1] = new G4Box("ddEpi2", epiXY/2, epiXY/2, epiZ/2); dynamiteEpiLV[1] = new G4LogicalVolume(dynamiteEpi[1], epiMaterial, "ddEpi2"); dynamiteEpiPV[1] = new G4PVPlacement(0, epi2Pos, dynamiteEpiLV[1], "ddEpi2", ddMotherLV, false, 0); G4ThreeVector sub2Pos = epi2Pos; sub2Pos.setZ(sub2Pos.getZ()+subZ/2+epiZ/2); dynamiteSub[1] = new G4Box("ddSub2", subXY/2, subXY/2, subZ/2); dynamiteSubLV[1] = new G4LogicalVolume(dynamiteSub[1], subMaterial, "ddSub2"); dynamiteSubPV[1] = new G4PVPlacement(0, sub2Pos, dynamiteSubLV[1], "ddSub2", ddMotherLV, false, 0); G4ThreeVector back2Pos = sub2Pos; back2Pos.setZ(back2Pos.getZ()+subZ/2+backZ/2); dynamiteBack[1] = new G4Box("ddBack2", backXY/2, backXY/2, backZ/2); dynamiteBackLV[1] = new G4LogicalVolume(dynamiteBack[1], backMaterial, "ddBack2"); dynamiteBackPV[1] = new G4PVPlacement(0, back2Pos, dynamiteBackLV[1], "ddBack2", ddMotherLV, false, 0); }