/** * @file Phase1PlanesModule.cc * @author Ibrahin Pinera * @date 2017 SoLid - University of Antwerp */ #include "Phase1PlanesModule.hh" #include "SolidMaterials.hh" #include "SolidUtils.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4ThreeVector.hh" #include "G4VisAttributes.hh" #include "G4Transform3D.hh" #include "G4Box.hh" #include "G4Trd.hh" #include "G4PVPlacement.hh" #include "G4UnitsTable.hh" #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include "G4SubtractionSolid.hh" #include "G4UnionSolid.hh" #include "G4Tubs.hh" #include Phase1PlanesModule::Phase1PlanesModule(G4int verboseLevel, G4int nPlanesPerModule, G4double gapZ, Phase1Plane * planeConstruction) { m_verboseLevel = verboseLevel; m_nPlanesPerModule = nPlanesPerModule; m_gapZ = gapZ; m_planeFullWidth = planeConstruction->GetFullWidth(); m_planeFullLength = planeConstruction->GetFullLength(); m_planeFullHeight = planeConstruction->GetFullHeight(); logPlane = planeConstruction->PlaneConstruction(); // m_moduleFullWidth = m_nPlanesPerModule * (m_planeFullWidth + m_gapZ); m_moduleFullWidth = 10. * (m_planeFullWidth + m_gapZ); //Al support for a module m_postWidth = 45.*mm; // m_horPostWidth = 85.*mm; m_horPostWidth = 2.*m_postWidth; m_verPostLength = 800.*mm; m_horPostLength = 921.*mm; // m_horPostLength = planeConstruction->GetAlFrameLength() - m_horPostWidth; m_topPostLength = m_moduleFullWidth; //support feet m_footLength = 70.*mm; m_footWidth = 80.*mm; m_foot1TopHeight = 30.8*mm; m_foot1BottomHeight = 30.*mm; m_foot1Height = m_foot1TopHeight + m_foot1BottomHeight; m_foot2Height = 35.*mm; m_supportFullLength = m_horPostLength + m_postWidth + m_horPostWidth; m_supportFullHeight = m_verPostLength + m_postWidth + m_foot1Height; m_supportFullWidth = m_topPostLength; m_moduleFullLength = m_planeFullLength + m_postWidth; m_moduleFullHeight = m_planeFullHeight + m_postWidth + m_foot1Height; m_moduleOffSetX = planeConstruction->GetOffSetX() + 0.5*m_postWidth; m_moduleOffSetY = planeConstruction->GetOffSetY() + 0.5*(m_postWidth + m_foot1Height); if( m_verboseLevel > 0 ) { G4cout << "=== dimensions of the detector full module ===" << G4endl; G4cout << m_moduleFullLength << " x " << m_moduleFullHeight << " x " << m_moduleFullWidth << G4endl; G4cout << "========================================" << G4endl; } } Phase1PlanesModule::~Phase1PlanesModule() { } G4LogicalVolume *Phase1PlanesModule::PlanesModuleConstruction() { 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) ; // construct full Plane box G4Box* moduleBox1 = new G4Box("moduleBox1", 0.5*m_moduleFullLength, 0.5*m_moduleFullHeight, 0.5*m_moduleFullWidth); G4Box* supporBoxCut2 = new G4Box("supporBoxCut2", m_postWidth, m_foot1Height, 0.5*m_moduleFullWidth + 0.5*mm); G4SubtractionSolid* moduleBox = new G4SubtractionSolid("moduleBox", moduleBox1, supporBoxCut2, 0, G4ThreeVector(-0.5*m_moduleFullLength + m_supportFullLength - m_postWidth, -0.5*m_moduleFullHeight - m_foot2Height, 0.)); mate = G4Material::GetMaterial("Air"); logPlanesModule = new G4LogicalVolume(moduleBox, mate, "logPlanesModule", 0, 0, 0); logPlanesModule->SetVisAttributes(G4VisAttributes::Invisible); // construc the Al support for the module logModuleSupport = SupportConstruction(); G4double posX = 0.5*(-m_moduleFullLength + m_supportFullLength); G4double posY = 0.5*(-m_moduleFullHeight + m_supportFullHeight); G4double posZ = 0.; physModuleSupport = new G4PVPlacement(0, G4ThreeVector(posX, posY, posZ), logModuleSupport, "physModuleSupport", logPlanesModule, false, 0); //======================================================================== // Place full planes (including detector modules and fibres) in the Module //======================================================================== G4cout << G4endl << "**************Planes in module construction****************" << G4endl; G4cout << "*** planes positions inside module ***" << G4endl; printf("%5s \t %10s \t %10s \t %10s \t %10s \n", "plane", "width", "Zcenter", "-Zpos", "+Zpos"); posX = 0.5*m_postWidth; posY = 0.5*(m_postWidth + m_foot1Height); posZ = -0.5*m_moduleFullWidth + 0.5*(m_planeFullWidth + m_gapZ); for(int planeID = 0; planeID < m_nPlanesPerModule; planeID++) { physPlane = new G4PVPlacement(0, G4ThreeVector(posX, posY, posZ), logPlane, "physPlane", logPlanesModule, false, planeID); printf("%5d \t %10.4f \t %10.4f \t %10.4f \t %10.4f \n", planeID, m_planeFullWidth, posZ, posZ - 0.5*(m_planeFullWidth), posZ + 0.5*(m_planeFullWidth) ); posZ += m_gapZ + m_planeFullWidth; } if( m_verboseLevel > 0 ) { G4float supportMass = logModuleSupport->GetMass()/g; mate = G4Material::GetMaterial("Aluminium"); G4float supportVol = supportMass / (mate->GetDensity()/(g/cm3)); G4float moduleMass = logPlanesModule->GetMass()/g; G4float moduleVol = m_planeFullLength*m_planeFullHeight*m_moduleFullWidth/cm3; G4float totalMass = supportMass + moduleMass; G4float totalVol = supportVol + moduleVol; G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << " part: mass (g)\t volume (cm^3)" << G4endl; G4cout << " Al support: " << supportMass << ", \t" << supportVol << G4endl; G4cout << " module Planes: " << moduleMass << ", \t" << moduleVol << G4endl; G4cout << "ALL module total: " << totalMass << ", \t" << totalVol << G4endl; G4cout << " total 5 Modules: " << 5.*totalMass << ", \t" << 5.*totalVol << G4endl; G4cout << " total 6 Modules: " << 6.*totalMass << ", \t" << 6.*totalVol << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } G4cout << G4endl << "************** END Planes in module construction****************" << G4endl; return logPlanesModule; } G4LogicalVolume* Phase1PlanesModule::SupportConstruction() { G4Material * mate; G4Colour blue2 (0.0, 0.3, 0.5) ; G4Box* supporBoxOuter = new G4Box("supporBoxOuter", 0.5*m_supportFullLength, 0.5*m_supportFullHeight, 0.5*m_supportFullWidth); G4Box* supporBoxCut = new G4Box("supporBoxCut", 0.5*m_supportFullLength, 0.5*m_supportFullHeight, 0.5*m_supportFullWidth + 0.5*mm); G4Box* supporBoxCut2 = new G4Box("supporBoxCut2", m_postWidth + 0.5*mm, m_foot1Height, 0.5*m_supportFullWidth + 0.5*mm); G4SubtractionSolid* supporBox = new G4SubtractionSolid("supporBox", supporBoxOuter, supporBoxCut, 0, G4ThreeVector(m_postWidth, m_postWidth + m_foot1Height, 0.)); supporBox = new G4SubtractionSolid("supporBox", supporBox, supporBoxCut2, 0, G4ThreeVector(0.5*m_supportFullLength - m_postWidth+0.5*mm, -0.5*m_supportFullHeight - m_foot2Height, 0.)); mate = G4Material::GetMaterial("Air"); G4LogicalVolume* logSupport = new G4LogicalVolume(supporBox, mate, "logSupport", 0, 0, 0); logSupport->SetVisAttributes(G4VisAttributes::Invisible); G4VisAttributes* vatAl = new G4VisAttributes(blue2); vatAl->SetVisibility(true); vatAl->SetForceSolid(true); G4LogicalVolume* logVerPost = AlExtrusionConstruction(1, m_verPostLength, m_postWidth, vatAl); G4LogicalVolume* logTopPost = AlExtrusionConstruction(1, m_topPostLength, m_postWidth, vatAl); G4LogicalVolume* logBottomPostX = AlExtrusionConstruction(1, m_horPostLength, m_postWidth, vatAl); G4LogicalVolume* logBottomPostZout = AlExtrusionConstruction(2, m_topPostLength, m_postWidth, vatAl); G4LogicalVolume* logBottomPostZin = AlExtrusionConstruction(2, (m_topPostLength - 2.*m_postWidth), m_postWidth, vatAl); G4double xPos = -0.5*(m_supportFullLength - m_postWidth); G4double yPos = 0.5*(m_supportFullHeight - m_postWidth); G4double zPos = 0.; G4RotationMatrix* rotPost = new G4RotationMatrix(); new G4PVPlacement(0, G4ThreeVector(xPos, yPos, zPos), logTopPost, "physTopPost", logSupport, false, 0); rotPost->rotateX(90.*deg); yPos = 0.5*(m_supportFullHeight - m_verPostLength) - m_postWidth; zPos = 0.5*(m_supportFullWidth - m_postWidth); new G4PVPlacement(rotPost, G4ThreeVector(xPos, yPos, -zPos), logVerPost, "physVerPost", logSupport, false, 0); new G4PVPlacement(rotPost, G4ThreeVector(xPos, yPos, zPos), logVerPost, "physVerPost", logSupport, false, 1); rotPost = new G4RotationMatrix(); rotPost->rotateY(90.*deg); xPos = -0.5*(m_supportFullLength - m_horPostLength) + m_postWidth; yPos = -0.5*(m_supportFullHeight - m_postWidth) + m_foot1Height; new G4PVPlacement(rotPost, G4ThreeVector(xPos, yPos, -zPos), logBottomPostX, "physBottomPostX", logSupport, false, 0); new G4PVPlacement(rotPost, G4ThreeVector(xPos, yPos, zPos), logBottomPostX, "physBottomPostX", logSupport, false, 1); xPos = 0.5*(m_supportFullLength - m_horPostWidth); zPos = 0.; new G4PVPlacement(0, G4ThreeVector(-xPos + m_postWidth, yPos, zPos), logBottomPostZin, "physBottomPostZin", logSupport, false, 0); new G4PVPlacement(0, G4ThreeVector(xPos, yPos, zPos), logBottomPostZout, "physBottomPostZout", logSupport, false, 0); // construct the support feet1 (at -X) G4LogicalVolume* logSupportFoot1 = SupportFoot1Construction(); logSupportFoot1->SetVisAttributes(vatAl); xPos = 0.5*(-m_supportFullLength + m_horPostWidth) + m_postWidth; yPos = -0.5*(m_supportFullHeight + m_foot1TopHeight) + m_foot1Height; zPos = 0.5*(m_supportFullWidth - m_footWidth); new G4PVPlacement(0, G4ThreeVector(xPos, yPos, -zPos), logSupportFoot1, "physSupportFoot", logSupport, false, 0); new G4PVPlacement(0, G4ThreeVector(xPos, yPos, zPos), logSupportFoot1, "physSupportFoot", logSupport, false, 0); // construct the support feet2 (at +X) G4LogicalVolume* logSupportFoot2 = SupportFoot2Construction(); logSupportFoot2->SetVisAttributes(vatAl); xPos = 0.5*(m_supportFullLength - m_horPostWidth); yPos = -0.5*(m_supportFullHeight + m_foot2Height) + m_foot1Height; new G4PVPlacement(0, G4ThreeVector(xPos, yPos, -zPos), logSupportFoot2, "physSupportFoot", logSupport, false, 0); new G4PVPlacement(0, G4ThreeVector(xPos, yPos, zPos), logSupportFoot2, "physSupportFoot", logSupport, false, 0); return logSupport; } G4LogicalVolume* Phase1PlanesModule::SupportFoot1Construction() { G4double l1 = 12.*mm; G4double l2 = 14.*mm; G4double width = 40.*mm; G4double d1 = 12.*mm; G4double d2 = 14.*mm; G4Box* footTop = new G4Box("footTop", 0.5*m_footLength, 0.5*m_foot1TopHeight, 0.5*m_footWidth); G4Box* footLR = new G4Box("footLR", 0.5*l1, 0.5*m_foot1BottomHeight, 0.5*width); G4Box* footCenter = new G4Box("footCenter", 0.5*l2, 0.5*m_foot1BottomHeight, 0.5*m_footWidth); G4Tubs* footTopHole = new G4Tubs("footTopHole", 0., 0.5*d2, m_foot1TopHeight + 5.*mm, 0.*deg, 360.*deg); G4Tubs* footBotHole = new G4Tubs("footBotHole", 0., 0.5*d1, l2 + 5.*mm, 0.*deg, 360.*deg); G4RotationMatrix* rotHole = new G4RotationMatrix(); rotHole->rotateX(90.*deg); // construct the top piece G4SubtractionSolid* top = new G4SubtractionSolid("top", footTop, footTopHole, rotHole, G4ThreeVector(-21.*mm, 0., -30.*mm)); top = new G4SubtractionSolid("top", top, footTopHole, rotHole, G4ThreeVector(-21.*mm, 0., 30.*mm)); top = new G4SubtractionSolid("top", top, footTopHole, rotHole, G4ThreeVector(21.*mm, 0., -30.*mm)); top = new G4SubtractionSolid("top", top, footTopHole, rotHole, G4ThreeVector(21.*mm, 0., 30.*mm)); // construct the left/right pieces rotHole = new G4RotationMatrix(); rotHole->rotateY(90.*deg); G4SubtractionSolid* leftright = new G4SubtractionSolid("leftright", footLR, footBotHole, rotHole, G4ThreeVector(0., -2.*mm, 0.)); // construct the bottom center piece G4SubtractionSolid* center = new G4SubtractionSolid("center", footCenter, footBotHole, rotHole, G4ThreeVector(0., -2.*mm, 0.)); G4double yPos = -0.5*(m_foot1TopHeight + m_foot1BottomHeight); // construct the entire foot G4UnionSolid* foot = new G4UnionSolid("foot", top, leftright, 0, G4ThreeVector(0.5*(-m_footLength + l1), yPos, 0.)); foot = new G4UnionSolid("foot", foot, leftright, 0, G4ThreeVector(0.5*(m_footLength - l1), yPos, 0.)); foot = new G4UnionSolid("foot", foot, center, 0, G4ThreeVector(0., yPos, 0.)); G4Material* mate = G4Material::GetMaterial("Aluminium"); G4LogicalVolume *logFoot = new G4LogicalVolume(foot, mate, "logFoot", 0, 0, 0); return logFoot; } G4LogicalVolume* Phase1PlanesModule::SupportFoot2Construction() { G4double l1 = 40.*mm; G4double l2 = 5.*mm; G4Box* footTop = new G4Box("footTop", 0.5*m_footLength, 0.5*m_foot2Height, 0.5*m_footWidth); G4Trd* footHole = new G4Trd("footHole", 0.5*l1, 0.5*l2, 0.6*m_footWidth, 0.6*m_footWidth, 0.25*m_foot2Height + 0.1*mm); G4RotationMatrix* rotHole = new G4RotationMatrix(); rotHole->rotateX(90.*deg); G4SubtractionSolid* footBox = new G4SubtractionSolid("footBox", footTop, footHole, rotHole, G4ThreeVector(0., -0.25*m_foot2Height - 0.1*mm, 0.)); G4Material* mate = G4Material::GetMaterial("Aluminium"); G4LogicalVolume *logFoot = new G4LogicalVolume(footBox, mate, "logFoot", 0, 0, 0); return logFoot; }