diff --git a/.Detector_Parameters.hh.swp b/.Detector_Parameters.hh.swp new file mode 100644 index 0000000..ea1010b Binary files /dev/null and b/.Detector_Parameters.hh.swp differ diff --git a/CloverDetectorConstruction.cc b/CloverDetectorConstruction.cc index 811d110..3bc0295 100644 --- a/CloverDetectorConstruction.cc +++ b/CloverDetectorConstruction.cc @@ -10,6 +10,7 @@ #include "G4Tubs.hh" #include "G4Sphere.hh" #include "G4Trd.hh" +#include "G4UnionSolid.hh" #include "G4IntersectionSolid.hh" #include "G4SubtractionSolid.hh" @@ -99,7 +100,7 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() // Geometry parameters G4double crystalLength = 8.*cm; G4double crystalRadius = 25.*mm; - G4double crystalZPos = Radius; //14.*cm + crystalLength/2.; + G4double crystalZPos = Radius*mm + crystalLength/2.; //distance to target + distance to center of crystals.; G4double cutXY = 46.0 * mm; G4double worldSizeZ = 2*(crystalLength + crystalZPos); @@ -131,9 +132,14 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() G4double bgoXYInner = 10*mm + 2*(cutXY + 1.0) * mm; G4double bgoZInner = crystalLength/2 + 4 * mm + crystalLength + 15*mm; G4double bgoXYWallThickness = 103.5 * mm; //from schematic - G4double bgoanglecut = 53 * mm; + G4double bgoanglecut0 = 53 * mm ; + G4double zbgo0 = 178 * mm; + G4double bgoanglecut1 = 24.935 * mm; + G4double zbgo1 = 80*mm; + G4double bgoanglecut2 = 10 *mm ; + G4double zbgo2 = 20*mm; // Get materials auto backgroundMaterial = G4Material::GetMaterial("G4_AIR"); @@ -193,13 +199,28 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() G4Box* case2 = new G4Box("case2", (caseXYInner + caseXYWallThickness)/2. , (caseXYInner + caseXYWallThickness)/2., caseZInner + caseZWallThickness*2.); G4SubtractionSolid * casing = new G4SubtractionSolid("casing", case2, case1); - G4Box* bgo1 = new G4Box("bgo1", bgoXYInner/2., bgoXYInner/2., bgoZInner +10*mm); + G4Box* bgo1 = new G4Box("bgo1", bgoXYInner/2., bgoXYInner/2., bgoZInner +zbgo1); - G4Trd* bgo2 = new G4Trd("bgo2", (bgoXYInner+ bgoXYWallThickness)/2. - bgoanglecut ,(bgoXYInner+ bgoXYWallThickness)/2. - , (bgoXYInner + bgoXYWallThickness)/2. - bgoanglecut, (bgoXYInner + bgoXYWallThickness)/2., bgoZInner); + G4Trd* bgo2 = new G4Trd("bgo2", (bgoXYInner+ bgoXYWallThickness)/2. - bgoanglecut1 ,(bgoXYInner+ bgoXYWallThickness)/2. + , (bgoXYInner + bgoXYWallThickness)/2. - bgoanglecut1, (bgoXYInner + bgoXYWallThickness)/2., zbgo0/2); + + G4Trd* bgo3 = new G4Trd("bgo3", (bgoXYInner+ bgoXYWallThickness)/2. - bgoanglecut0 + bgoanglecut2,(bgoXYInner+ bgoXYWallThickness)/2. - bgoanglecut1 + , (bgoXYInner + bgoXYWallThickness)/2. - bgoanglecut0 + bgoanglecut2, (bgoXYInner + bgoXYWallThickness)/2.- bgoanglecut1, zbgo1/2); + G4ThreeVector bgo3_v = G4ThreeVector(0.,0.,-zbgo0 + 50*mm); + + G4RotationMatrix * bgo3_m = new G4RotationMatrix(); + + + G4VSolid* bgo_u = new G4UnionSolid("bgo2 + bgo3",bgo2,bgo3,bgo3_m,bgo3_v); //G4Box* bgo2 = new G4Box("bgo2", (bgoXYInner+ bgoXYWallThickness)/2., (bgoXYInner + bgoXYWallThickness)/2., bgoZInner + bgoZWallThickness*2.); + - G4SubtractionSolid * bgo = new G4SubtractionSolid("bgo", bgo2, bgo1); + G4Trd* bgowindow = new G4Trd("bgowindow", (bgoXYInner+ bgoXYWallThickness)/2. - bgoanglecut0 ,(bgoXYInner+ bgoXYWallThickness)/2. - bgoanglecut0 +bgoanglecut2 + , (bgoXYInner + bgoXYWallThickness)/2. - bgoanglecut0, (bgoXYInner + bgoXYWallThickness)/2. -bgoanglecut0 +bgoanglecut2, zbgo2/2); + + + + G4SubtractionSolid * bgo = new G4SubtractionSolid("bgo", bgo_u, bgo1); // creating the subtraction solid that will form the actual bgo sheild. @@ -223,6 +244,7 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() auto caseLV = new G4LogicalVolume * [fNumOfCrystal/4]; auto bgoLV = new G4LogicalVolume * [fNumOfCrystal/4]; + auto bgowindowLV = new G4LogicalVolume * [fNumOfCrystal/4]; fLogicCrystal[i]->SetVisAttributes(crystalVisAtt); @@ -243,12 +265,15 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() // if(iClover != DetNum){return 0;} - G4ThreeVector case_pos = G4ThreeVector(0,0,60*mm+crystalZPos + zmod); //The crystalZpos is the radius of the detector, - //bgo uses the same position vector and rotation matrix as the case - G4ThreeVector bgo_pos = G4ThreeVector(0,0,60*mm+crystalZPos + zmod); + G4ThreeVector case_pos = G4ThreeVector(0,0,88*mm+crystalZPos); //The crystalZpos is the radius of the detector, + //bgo uses an identical rotation matrix as the case, + //you can also add in zmod if you want to shift the shielding. + G4ThreeVector bgo_pos = G4ThreeVector(0,0,115*mm+crystalZPos); + G4ThreeVector bgowindow_pos = G4ThreeVector(0,0,-63*mm + crystalZPos); //Set rotation matrix settings for clovers. + G4RotationMatrix * bgowindowmat = new G4RotationMatrix(); G4RotationMatrix * bgomat = new G4RotationMatrix(); G4RotationMatrix * rotmat = new G4RotationMatrix(); G4RotationMatrix * crystalmat= new G4RotationMatrix(); @@ -260,6 +285,8 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() if(j == iClover){ // rotation matrix must undo the operations you perform with the position vector. + bgowindowmat->rotateZ(-dPsi*degree); + bgowindowmat->rotateX(-dTheta*degree); bgomat->rotateZ(-dPsi*degree); bgomat->rotateX(-dTheta*degree); @@ -275,13 +302,14 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() pos.rotateX(dTheta*degree); pos.rotateZ(dPsi *degree); - //set rotation for the detector case vector; - case_pos.rotateX(dTheta *degree); case_pos.rotateZ(dPsi*degree); bgo_pos.rotateX(dTheta *degree); bgo_pos.rotateZ(dPsi*degree); + + bgowindow_pos.rotateX(dTheta *degree); + bgowindow_pos.rotateZ(dPsi*degree); } } new G4PVPlacement( crystalmat, // orientation matrix @@ -297,6 +325,7 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() if( jCrystal == 0 ) { caseLV[iClover] = new G4LogicalVolume(casing, G4Material::GetMaterial("G4_Al"), "Case"); bgoLV[iClover] = new G4LogicalVolume(bgo , G4Material::GetMaterial("G4_Al"), "BGO "); + bgowindowLV[iClover] = new G4LogicalVolume(bgowindow, G4Material::GetMaterial("G4_Al"), "BGO WINDOW "); new G4PVPlacement( rotmat , // case orientation case_pos, // case location @@ -315,8 +344,19 @@ G4VPhysicalVolume* CloverDetectorConstruction::DefineVolumes() false, // no boolean operation iClover, // copy number fCheckOverlaps); // checking overlaps + + new G4PVPlacement( bgowindowmat , // bgo orientation + bgowindow_pos, // bgo location + bgowindowLV[i/4], // its logical volume + "Bgowindow", // its name + worldLV, // its mother volume + false, // no boolean operation + iClover, // copy number + fCheckOverlaps); // checking overlaps + caseLV[iClover]->SetVisAttributes(new G4VisAttributes(G4Colour(1.0,1.0,0.0))); bgoLV[iClover]->SetVisAttributes(new G4VisAttributes(G4Colour(0.,1.0,0.0))); + bgowindowLV[iClover]->SetVisAttributes(new G4VisAttributes(G4Colour(0.0,1.0,1.0))); } //Set a i+1%4 for each // diff --git a/Detector_Parameters.hh b/Detector_Parameters.hh index 295f129..f1bd70e 100644 --- a/Detector_Parameters.hh +++ b/Detector_Parameters.hh @@ -31,7 +31,9 @@ const double Clover_Location[Crystal_Num/4][4] = {{0,131.75,326.96,0.}, {12,90.,51.42,0.}, {13,48.25,180.,0.}, {14,129.,180.,0.}, - {15,48.25,107.35,0.}};//, + {15,48.25,107.35,0.} + + };//,