/** * @file Phase1AlFrame.cc * @author Ibrahin Pinera * @date 2016 SoLid - University of Antwerp */ #include "SolidMaterials.hh" #include "Phase1AlFrame.hh" #include "Phase1PEReflector.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4ThreeVector.hh" #include "G4VisAttributes.hh" #include "G4Transform3D.hh" #include "G4Box.hh" #include "G4SubtractionSolid.hh" #include "G4Tubs.hh" #include "G4UnitsTable.hh" #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include "G4PVPlacement.hh" #include Phase1AlFrame::Phase1AlFrame(G4int verboseLevel, G4int nCubesX, G4int nCubesY, G4double fibersGapX, G4double fibersGapY, G4double holesSeparationX, G4double holesSeparationY) { m_verboseLevel = verboseLevel; m_nHolesX = nCubesX; m_nHolesY = nCubesY; m_fibersGapX = fibersGapX; m_fibersGapY = fibersGapY; m_holesSeparationX = holesSeparationX; // between fibers in same cube in X direction m_holesSeparationY = holesSeparationY; // between fibers in same cube in Y direction //x-dimension --> Width //y-dimension --> Length //z-dimension --> Thickness m_frameInternalLength = 90.64*cm; // inner horizontal measure m_frameInternalHeight = 90.64*cm; // inner vertical measure m_frameExternalLength = 105.64*cm; // outer horizontal measure m_frameExternalHeight = 100.64*cm; // outer vertical measure m_frameWidth = 5.0*cm; // square section bars m_frameThickness = 4.0*mm; // internal bars thickness m_holesDiam = 8.0*mm; m_holesOffsetZ1 = 3.75*mm; // from center of Al frame to -Z hole m_holesOffsetZ2 = 11.25*mm; // from center of Al frame to +Z hole // from external +X of Al frame (150.6*mm from design) m_holesOffsetX = 150.6*mm; // from external bottom of Al frame (102.7*mm from design) m_holesOffsetY = 102.7*mm; // grooves for fibers access m_frameExtGrooveLength = 265.*mm; m_frameExtGrooveWidth = 34.*mm; m_frameExtGrooveSeparation = 10.*mm; // Al groove covers m_frameExtGrooveCoverWidth = 48.*mm; m_frameExtGrooveCoverLength = 835.*mm; m_frameExtGrooveCoverThickness = 5.*mm; //external full size of the frame m_frameFullLength = m_frameExternalLength + 2.*m_frameExtGrooveCoverThickness; m_frameFullHeight = m_frameExternalHeight + 2.*m_frameExtGrooveCoverThickness; m_frameInnerOffSetX = -0.5*m_frameWidth; // since vertical +X bar is twice wider if( m_verboseLevel > 0 ) { G4cout << "==============================================" << G4endl; G4cout << "external size of the Al frame: "; G4cout << m_frameExternalLength << " x " << m_frameExternalHeight << " x " << m_frameWidth << G4endl; G4cout << "internal size of the Al frame: "; G4cout << m_frameInternalLength << " x " << m_frameInternalHeight << " x " << m_frameWidth << G4endl; G4cout << "external size of the Al frame + side Al covers: "; G4cout << m_frameFullLength << " x " << m_frameFullHeight << " x " << m_frameWidth << G4endl; G4cout << "Al frame hollow bars thickness: "; G4cout << m_frameThickness << G4endl; G4cout << "diam of fibers holes: "; G4cout << m_holesDiam << G4endl; G4cout << "==============================================" << G4endl; } } Phase1AlFrame::~Phase1AlFrame() { } G4LogicalVolume *Phase1AlFrame::AlFrameConstruction(G4double holesOffsetX, G4double holesOffsetY) { G4Material * mate; // make colours ********************************************************* G4Colour white (1.0, 1.0, 1.0) ; G4Colour white_t (1.0, 1.0, 1.0, .95) ; G4Colour grey (0.5, 0.5, 0.5) ; G4Colour lgrey (.75, .75, .75) ; G4Colour red (1.0, 0.0, 0.0, 0.5) ; G4Colour blue (0.0, 0.0, 1.0) ; G4Colour blue_t (0.0, 0.0, 1.0, .75) ; G4Colour cyan (0.0, 1.0, 1.0, 0.5) ; G4Colour magenta (1.0, 0.0, 1.0) ; G4Colour yellow (1.0, 1.0, 0.0, 0.5) ; G4Colour lblue (0.0, 0.0, .75) ; G4Colour black (0.0, 0.0, 0.0) ; G4Colour green (0.0, 1.0, 0.0) ; G4Colour lgreen (0.0, .75, 0.0) ; // G4bool forceSolid = false; G4bool forceSolid = true; m_holesOffsetX = holesOffsetX; m_holesOffsetY = holesOffsetY; // construct the frame box G4Box* frameOuter = new G4Box("frameOuter", 0.5*m_frameFullLength, 0.5*m_frameFullHeight, 0.5*m_frameWidth); // inner cut-out G4Box* frameInner = new G4Box("frameInner", 0.5*m_frameInternalLength, 0.5*m_frameInternalHeight, 0.5*m_frameWidth+0.5*mm); G4SubtractionSolid * frameBox = new G4SubtractionSolid("frameBox", frameOuter, frameInner, 0, G4ThreeVector(m_frameInnerOffSetX, 0., 0.)); // construct the Al frame G4Box* AlFrame_outer = new G4Box("AlFrame_outer", 0.5*m_frameExternalLength, 0.5*m_frameExternalHeight, 0.5*m_frameWidth); // inner cut-out G4Box* AlFrame_inner = new G4Box("AlFrame_inner", 0.5*m_frameInternalLength, 0.5*m_frameInternalHeight, 0.5*m_frameWidth+0.5*mm); G4SubtractionSolid * AlFrame_solid = new G4SubtractionSolid("AlFrame_solid", AlFrame_outer, AlFrame_inner, 0, G4ThreeVector(m_frameInnerOffSetX, 0., 0.)); // for cutting of the Al bars G4Box* AlFrame_cutOuter = new G4Box("AlFrame_cutOuter", 0.5*(m_frameExternalLength - 2.*m_frameThickness), 0.5*(m_frameExternalHeight - 2.*m_frameThickness), 0.5*(m_frameWidth - 2.*m_frameThickness)); G4Box* AlFrame_cutInner = new G4Box("AlFrame_cutInner", 0.5*(m_frameInternalLength + 2.*m_frameThickness), 0.5*(m_frameInternalHeight + 2.*m_frameThickness), 0.5*m_frameWidth); G4SubtractionSolid * AlFrame_cut = new G4SubtractionSolid("AlFrame_cut", AlFrame_cutOuter, AlFrame_cutInner, 0, G4ThreeVector(m_frameInnerOffSetX, 0., 0.)); G4SubtractionSolid * AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_solid, AlFrame_cut, 0, G4ThreeVector(0., 0., 0.)); //Frame Holes for fibers G4double holesLength = m_frameThickness + 4.0*cm; G4Tubs* AlFrame_hole = new G4Tubs("AlFrame_hole", 0., 0.5*m_holesDiam, holesLength, 0.*deg, 360.*deg); G4RotationMatrix* rotHole = new G4RotationMatrix(); rotHole->rotateY(90.*deg); //Holes in the Y direction (for horizontal fibers) G4double XPos = 0.; G4double YPos = 0.; G4double ZPos = 0.; G4double offSetX = -0.5*(m_nHolesX - 1)*m_fibersGapX; G4double offSetY = -0.5*(m_nHolesY - 1)*m_fibersGapY; for (int y=0; y<2*m_nHolesY; y++) { if( y%2 == 0 ) { YPos = 0.5*y*m_fibersGapY + 0.5*m_holesSeparationY; ZPos = -m_holesOffsetZ2; }else{ YPos -= m_holesSeparationY; ZPos = m_holesOffsetZ1; } //holes on the internal side of right vertical bar XPos = 0.5*m_frameInternalLength + m_frameInnerOffSetX + 0.5*m_frameThickness; AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, AlFrame_hole, rotHole, G4ThreeVector(XPos, YPos + offSetY, ZPos)); frameBox = new G4SubtractionSolid("frameBox", frameBox, AlFrame_hole, rotHole, G4ThreeVector(XPos, YPos + offSetY, ZPos)); //holes on the internal side of left vertical bar XPos = -0.5*m_frameInternalLength + m_frameInnerOffSetX - 0.5*m_frameThickness; AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, AlFrame_hole, rotHole, G4ThreeVector(XPos, YPos + offSetY, ZPos)); frameBox = new G4SubtractionSolid("frameBox", frameBox, AlFrame_hole, rotHole, G4ThreeVector(XPos, YPos + offSetY, ZPos)); } rotHole = new G4RotationMatrix(); rotHole->rotateX(90.*deg); //Holes in the X direction (for vertical fibers) XPos = 0.; YPos = 0.; ZPos = 0.; for (int x=0; x<2*m_nHolesX; x++) { if( x%2 == 0 ) { XPos = 0.5*x*m_fibersGapX + 0.5*m_holesSeparationX + m_frameInnerOffSetX; ZPos = m_holesOffsetZ2; }else{ XPos -= m_holesSeparationX; ZPos = -m_holesOffsetZ1; } //holes on the internal side of bottom horizontal bar YPos = -0.5*m_frameInternalHeight - 0.5*m_frameThickness; AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, AlFrame_hole, rotHole, G4ThreeVector(XPos + offSetX, YPos, ZPos)); frameBox = new G4SubtractionSolid("frameBox", frameBox, AlFrame_hole, rotHole, G4ThreeVector(XPos + offSetX, YPos, ZPos)); //holes on the internal side of left vertical bar YPos = 0.5*m_frameInternalHeight + 0.5*m_frameThickness; AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, AlFrame_hole, rotHole, G4ThreeVector(XPos + offSetX, YPos, ZPos)); frameBox = new G4SubtractionSolid("frameBox", frameBox, AlFrame_hole, rotHole, G4ThreeVector(XPos + offSetX, YPos, ZPos)); } mate = G4Material::GetMaterial("Air"); logAlFrame = new G4LogicalVolume(frameBox, mate, "logAlFrame", 0, 0, 0); logAlFrame->SetVisAttributes(G4VisAttributes::Invisible); //Grooves in the Y direction (in horizontal bars) G4Box* grooveBox = new G4Box("grooveBox", 0.5*m_frameExtGrooveLength, m_frameThickness, 0.5*m_frameExtGrooveWidth); YPos = 0.5*m_frameExternalHeight - 0.5*m_frameThickness; ZPos = 0.; for (int x=0; x<3; x++) { //grooves on the external side of top horizontal bar XPos = (x-1)*(m_frameExtGrooveLength + m_frameExtGrooveSeparation) + m_frameInnerOffSetX; AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, grooveBox, 0, G4ThreeVector(XPos, YPos, ZPos)); //grooves on the external side of bottom horizontal bar AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, grooveBox, 0, G4ThreeVector(XPos, -YPos, ZPos)); } //Grooves in the X direction (in vertical bars) XPos = -0.5*m_frameExternalLength + 0.5*m_frameThickness; rotHole = new G4RotationMatrix(); rotHole->rotateZ(90.*deg); for (int y=0; y<3; y++) { //grooves on the external side of left vertical bar YPos = (y-1)*(m_frameExtGrooveLength + m_frameExtGrooveSeparation); AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, grooveBox, rotHole, G4ThreeVector(XPos, YPos, ZPos)); //grooves on the external side of right vertical bar AlFrame_hollow = new G4SubtractionSolid("AlFrame_hollow", AlFrame_hollow, grooveBox, rotHole, G4ThreeVector(-XPos, YPos, ZPos)); } mate = G4Material::GetMaterial("Aluminium"); logFrameAlBars = new G4LogicalVolume(AlFrame_hollow, mate, "logFrameAlFrame", 0, 0, 0); //Set Color G4VisAttributes* vatAl= new G4VisAttributes(grey); vatAl->SetVisibility(true); vatAl->SetForceSolid(forceSolid); logFrameAlBars->SetVisAttributes(vatAl); physFrameAlBars = new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), logFrameAlBars, "physFrameAlBars", logAlFrame, false, 0); //construct the groove covers G4Box* grooveCoverBox = new G4Box("grooveCoverBox", 0.5*m_frameExtGrooveCoverLength, 0.5*m_frameExtGrooveCoverThickness, 0.5*m_frameExtGrooveCoverWidth); logFrameAlCovers = new G4LogicalVolume(grooveCoverBox, mate, "logFrameAlCovers", 0, 0, 0); logFrameAlCovers->SetVisAttributes(vatAl); //Grooves cover in the Y direction (for horizontal bars) XPos = m_frameInnerOffSetX; YPos = 0.5*m_frameExternalHeight + 0.5*m_frameExtGrooveCoverThickness; physFrameAlCovers = new G4PVPlacement(0, G4ThreeVector(XPos, YPos, ZPos), logFrameAlCovers, "physFrameAlCovers", logAlFrame, false, 0); physFrameAlCovers = new G4PVPlacement(0, G4ThreeVector(XPos, -YPos, ZPos), logFrameAlCovers, "physFrameAlCovers", logAlFrame, false, 0); //Grooves cover in the X direction (for vertical bars) XPos = -0.5*m_frameExternalLength - 0.5*m_frameExtGrooveCoverThickness; YPos = 0.; physFrameAlCovers = new G4PVPlacement(rotHole, G4ThreeVector(XPos, YPos, ZPos), logFrameAlCovers, "physFrameAlCovers", logAlFrame, false, 0); physFrameAlCovers = new G4PVPlacement(rotHole, G4ThreeVector(-XPos, YPos, ZPos), logFrameAlCovers, "physFrameAlCovers", logAlFrame, false, 0); if( m_verboseLevel > 0 ) { G4float AlBars_mass = logFrameAlBars->GetMass()/g; G4float AlBars_vol = AlFrame_hollow->GetCubicVolume()/cm3; G4float sideAlcover_mass = logFrameAlCovers->GetMass()/g; G4float sideAlcover_vol = grooveCoverBox->GetCubicVolume()/cm3; G4float total_mass = AlBars_mass + 4.*sideAlcover_mass; G4float total_vol = AlBars_vol + 4.*sideAlcover_vol; G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << " part: mass (g)\t volume (cm^3)" << G4endl; G4cout << " Al frame bars: " << AlBars_mass << ", \t" << AlBars_vol << G4endl; G4cout << " each side Al cover: " << sideAlcover_mass << ", \t" << sideAlcover_vol << G4endl; G4cout << " four side Al covers: " << 4.*sideAlcover_mass << ", \t" << 4.*sideAlcover_vol << G4endl; G4cout << " entire Al frame: " << total_mass << ", \t" << total_vol << G4endl; G4cout << " 50 frames total: " << 50.*total_mass << ", \t" << 50.*total_vol << G4endl; G4cout << " 60 frames total: " << 60.*total_mass << ", \t" << 60.*total_vol << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } return logAlFrame; }