/** * @file Phase1CROSSCarrier.cc * @author David Henaff * @author Ibrahin Pinera (updates) * @date 2017 SoLid - Subatech - University of Antwerp */ #include "Phase1CROSSCarrier.hh" #include "SolidMaterials.hh" #include "SolidUtils.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4VisAttributes.hh" #include "G4Transform3D.hh" #include "G4PVPlacement.hh" #include "G4UnitsTable.hh" #include "G4SystemOfUnits.hh" #include "G4Box.hh" #include "G4Tubs.hh" #include "G4TwoVector.hh" #include "G4LogicalVolume.hh" #include "G4VPhysicalVolume.hh" #include "G4SubtractionSolid.hh" #include "G4UnionSolid.hh" #include "G4NistManager.hh" Phase1CROSSCarrier::Phase1CROSSCarrier(G4int verboseLevel, G4TwoVector sourcePositionXY, G4double crossOffSetX) { ////////////////////////////////////////////// ///// DEFINITION OF THE SOURCE POSITIONS ///// ////////////////////////////////////////////// // Allowed Region in X: [-302.5*mm, 302.5*mm] // Allowed Region in Y: [-205.0*mm, 400.0*mm] ////////////////////////////////////////////// // define here source positions in X (left, center, right) // m_sourceDefinedPosX = G4ThreeVector(-302.5*mm, 0.*mm, 302.5*mm); // m_sourceDefinedPosX = G4ThreeVector(-302.5*mm, 15.45*mm, 302.5*mm); // define here source positions in Y (bottom, center, top) // m_sourceDefinedPosY = G4ThreeVector(-205.0*mm, 0.*mm, 205.0*mm); //m_sourceDefinedPosY = G4ThreeVector(-205.0*mm, 33.5*mm, 205.0*mm); // These measurement were taken in january 2018, after module 5 installation and before closing the container for the first cycle of the year. m_sourceDefinedPosX = G4ThreeVector(-304.5*mm, 0*mm, 285.5*mm); // take into account the maximum/minimum position measured with CROSS m_sourceDefinedPosY = G4ThreeVector(-180.0*mm, (0+50.8)*mm, (180+50.8*2)*mm); // take into account the minimum position measured with CROSS //m_sourceDefinedPosY = G4ThreeVector(-180.0*mm, 0*mm, 180*mm); // take into account the minimum position measured with CROSS ////////////////////////////////////////////// m_verboseLevel = verboseLevel; // set the selected source position for the current run G4int iX = sourcePositionXY.x() + 1; G4int iY = sourcePositionXY.y() + 1; m_sourceSelectedPosXY.setX( m_sourceDefinedPosX[iX] ); m_sourceSelectedPosXY.setY( m_sourceDefinedPosY[iY] ); // Cross Carrier // Side Part m_xSidePartCrossCarrier = 40.*mm; m_ySidePartCrossCarrier = 30.*mm; m_zSidePartCrossCarrier = 15.*mm; // Center Part m_xCentralPartCrossCarrier = 55.*mm; m_yCentralPartCrossCarrier = 105.*mm; m_zCentralPartCrossCarrier = 15.*mm; // Hole Part m_xHolePartCrossCarrier = 40.*mm; m_yHolePartCrossCarrier = 75.*mm; m_zHolePartCrossCarrier = m_zCentralPartCrossCarrier + 5.*mm; m_yOffSetHolePartCrossCarrier = 10.*mm; // Side Tube m_innerRadiusSideTubeCrossCarrier = 0.*mm; m_outerRadiusSideTubeCrossCarrier = 6.*mm; m_widthSideTubeCrossCarrier = 925.*mm; m_startAngleSideTubeCrossCarrier = 0.*deg; m_spanningAngleSideTubeCrossCarrier = 360.*deg; // Central Rack m_xRackPartCrossCarrier = 15.*mm; m_yRackPartCrossCarrier = 850.*mm; m_zRackPartCrossCarrier = 15.*mm; // Side Support m_xPosSideSupportCrossCarrier = 425.*mm; m_xLengthSideSupportCrossCarrier = 110.*mm; // m_xLengthSideSupportCrossCarrier = 15.*mm; m_yHeightSideSupportCrossCarrier = 320.*mm; m_zWidthSideSupportCrossCarrier = 200.*mm; m_yTriangularPrismSubSideSupportCrossCarrier = m_yHeightSideSupportCrossCarrier - 190.*mm; m_zTriangularPrismSubSideSupportCrossCarrier = m_zWidthSideSupportCrossCarrier - 70.*mm; // Central Support m_xWidthCentralSupportCrossCarrier = 135.*mm; m_yWidthCentralSupportCrossCarrier = 220.*mm; m_zWidthCentralSupportCrossCarrier = 175.*mm; m_yTriangularPrismSubCentralSupportCrossCarrier = m_yWidthCentralSupportCrossCarrier - 95.*mm; m_zTriangularPrismSubCentralSupportCrossCarrier = m_zWidthCentralSupportCrossCarrier - 40.*mm; m_yRectangleSubCentralSupportCrossCarrier = 50.*mm; m_zRectangleSubCentralSupportCrossCarrier = 75.*mm; // Cross Carrier Support m_xSupportCrossCarrier = 0.*mm; // m_ySupportCrossCarrier = 550.*mm; m_ySupportCrossCarrier = 0.*mm; // m_zSupportCrossCarrier = 39.5*mm; m_zSupportCrossCarrier = 0.5*m_zWidthSideSupportCrossCarrier; // Tube Support Cross Carrier m_innerRadiusSupportTubeCrossCarrier = 0.*mm; m_outerRadiusSupportTubeCrossCarrier = 6.*mm; m_widthSupportTubeCrossCarrier = 960.*mm; m_startAngleSupportTubeCrossCarrier = 0.*deg; m_spanningAngleSupportTubeCrossCarrier = 360.*deg; // Bar Support Cross Carrier m_xBarSupportCrossCarrier = 15.*mm; m_yBarSupportCrossCarrier = 15.*mm; m_zBarSupportCrossCarrier = m_widthSupportTubeCrossCarrier;//960.*mm; // Rack Support Cross Carrier m_xRackSupportCrossCarrier = 40.*mm; m_yRackSupportCrossCarrier = 40.*mm; m_zRackSupportCrossCarrier = m_widthSupportTubeCrossCarrier;//960.*mm; // capsule around source m_sourceCapsuleRadius = 12.5*mm; m_sourceCapsuleHeight = 3.0*mm; // Placement // source offSet from front face m_zOffSetSource = 32.*mm; // Tubs m_xPosTube1SupportCrossCarrier = 0.*mm; m_yPosTube1SupportCrossCarrier = 10.*mm; m_zPosTube1SupportCrossCarrier = 10.*mm; m_xPosTube2SupportCrossCarrier = 0.*mm; m_yPosTube2SupportCrossCarrier = 160.*mm; m_zPosTube2SupportCrossCarrier = m_zPosTube1SupportCrossCarrier; m_xPosTube3SupportCrossCarrier = 0.*mm; m_yPosTube3SupportCrossCarrier = 240.*mm; m_zPosTube3SupportCrossCarrier = 0.5*m_zWidthSideSupportCrossCarrier; m_xPosTube4SupportCrossCarrier = 0.*mm; m_yPosTube4SupportCrossCarrier = 135.*mm; m_zPosTube4SupportCrossCarrier = m_zWidthCentralSupportCrossCarrier - m_zPosTube1SupportCrossCarrier; // Bar m_xPosBarSupportCrossCarrier = 0.*mm; m_yPosBarSupportCrossCarrier = 172.5*mm; m_zPosBarSupportCrossCarrier = 72.5*mm; // Rack m_xPosRackSupportCrossCarrier = 0.*mm; m_yPosRackSupportCrossCarrier = 280.*mm; m_zPosRackSupportCrossCarrier = 140.*mm; // Full Cross Carrier dimensions (logVol) m_xFullCrossCarrier = m_widthSupportTubeCrossCarrier; m_yFullCrossCarrier = 2.*m_yRackPartCrossCarrier; m_zFullCrossCarrier = m_zWidthSideSupportCrossCarrier; m_xOffSetCrossCarrier = 0.*mm; m_yOffSetCrossCarrier = m_yHeightSideSupportCrossCarrier; // top Y of carrier support m_zOffSetCrossCarrier = 0.5*m_zWidthSideSupportCrossCarrier - m_zOffSetSource; // Z center of carrier // These measurement were taken in january 2018, after module 5 installation and before closing the container for the first cycle of the year. // Allowed Region in X: [-304.5*mm, 285.5*mm] m_sourcePosLimitsX = G4TwoVector(-304.5*mm, 285.5*mm); // Allowed Region in Y: [-205.0*mm, 400.0*mm] m_sourcePosLimitsY = G4TwoVector(-180.*mm, 400.0*mm); if( m_verboseLevel > 0 ) { G4cout << G4endl; G4cout << "=== allowed region for source pos ===" << G4endl; G4cout << " limits in X: " << m_sourcePosLimitsX << G4endl; G4cout << " limits in Y: " << m_sourcePosLimitsY << G4endl; G4cout << "=====================================" << G4endl; G4cout << G4endl; } // check if the defined position is allowed if( m_sourceDefinedPosX[0] < m_sourcePosLimitsX[0] || m_sourceDefinedPosX[2] > m_sourcePosLimitsX[1] || m_sourceDefinedPosY[0] < m_sourcePosLimitsY[0] || m_sourceDefinedPosY[2] > m_sourcePosLimitsY[1] ) { G4cout << G4endl; G4cout << "!!! ERROR CROSS-Carrier !!!" << G4endl; G4cout << "!!! Not allowed source position !!!" << G4endl; G4cout << G4endl; exit(1); } // Source location in CROSS carrier coordinates m_xSourcePositionCrossCarrier = -m_sourceSelectedPosXY.x() - crossOffSetX; // the carrier is rotated 180 in X and shifted of 2mm in X G4double ySourcePositionOffSet = 76.2*mm; // centering on the plane center m_ySourcePositionCrossCarrier = m_sourceSelectedPosXY.y() + ySourcePositionOffSet - 0.5*(m_yRackPartCrossCarrier + m_yHeightSideSupportCrossCarrier); m_yOffSetSourceCrossCarrier = 22.5*mm; if( m_verboseLevel > 0 ) { G4cout << G4endl; G4cout << "=== dimensions of the CROSS Carrier ===" << G4endl; G4cout << m_xFullCrossCarrier << " x " << m_yFullCrossCarrier << " x " << m_zFullCrossCarrier << G4endl; G4cout << "======================================" << G4endl; G4cout << G4endl; } } Phase1CROSSCarrier::~Phase1CROSSCarrier() { } G4LogicalVolume *Phase1CROSSCarrier::CrossCarrierConstruction(G4bool isCrossCalibration, G4bool bSourceCapsule) { // Material // Air G4Material * mateAir = G4Material::GetMaterial("Air"); // Aluminium G4Material * mateAl = G4Material::GetMaterial("Aluminium"); // Steel G4Material *mateSteel = G4Material::GetMaterial("G4_STAINLESS-STEEL"); G4NistManager* man = G4NistManager::Instance(); // POM G4Material *matePOM = man->FindOrBuildMaterial("G4_POLYOXYMETHYLENE"); // Carbon Composite G4Material *mateCompositeCarbon = man->FindOrBuildMaterial("G4_C"); //Not sure // PA G4Material *matePA = man->FindOrBuildMaterial("G4_NYLON-6/6"); // PE for source capsule G4Material *matePE = man->FindOrBuildMaterial("G4_POLYETHYLENE"); // Side Cross Support Mixture G4Material *mateSideCrossSupport; mateSideCrossSupport = new G4Material("SideCrossSupportMixture",0.79*(g/cm3),4); mateSideCrossSupport->AddMaterial(mateAl,84.*perCent); mateSideCrossSupport->AddMaterial(mateSteel,14.54*perCent); mateSideCrossSupport->AddMaterial(matePOM,0.73*perCent); mateSideCrossSupport->AddMaterial(mateCompositeCarbon,0.73*perCent); // Central Cross Support Mixture G4Material *mateCentralCrossSupport; mateCentralCrossSupport = new G4Material("CentralCrossSupportMiture", 0.75*(g/cm3), 3); mateCentralCrossSupport->AddMaterial(mateAl,50.94*perCent); mateCentralCrossSupport->AddMaterial(mateSteel,45.32*perCent); mateCentralCrossSupport->AddMaterial(matePA,3.74*perCent); // 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) ; if( m_verboseLevel > 0 ) G4cout << G4endl << "************** Start CROSS carrier construction****************" << G4endl; G4bool forceSolid = true; // construct full CROSS carrier box G4double yOffSet = isCrossCalibration ? 0. : -0.5*m_yHeightSideSupportCrossCarrier; m_yOffSetCrossCarrier += yOffSet; G4VSolid * CrossCarrierBox; if( isCrossCalibration ) { G4Box* CrossCarrierBox1 = new G4Box("CrossCarrierBox1", 0.5*m_xFullCrossCarrier, 0.5*m_yFullCrossCarrier, 0.5*m_zFullCrossCarrier); G4Box* CrossCarrierBox2 = new G4Box("CrossCarrierBox2", m_xFullCrossCarrier, 0.3*m_yFullCrossCarrier, m_zFullCrossCarrier); G4double xCut = 0.; G4double yCut = -0.3*m_yFullCrossCarrier; G4double zCut = m_zFullCrossCarrier + 0.5*m_zRackPartCrossCarrier; CrossCarrierBox = new G4SubtractionSolid("CrossCarrierBox", CrossCarrierBox1, CrossCarrierBox2, 0, G4ThreeVector(xCut, yCut, zCut + m_zOffSetCrossCarrier)); CrossCarrierBox = new G4SubtractionSolid("CrossCarrierBox", CrossCarrierBox, CrossCarrierBox2, 0, G4ThreeVector(xCut, yCut, -zCut + m_zOffSetCrossCarrier)); xCut = m_xFullCrossCarrier + m_xPosSideSupportCrossCarrier - 0.5*m_xLengthSideSupportCrossCarrier; yCut = 0.3*m_yFullCrossCarrier + m_yHeightSideSupportCrossCarrier; zCut = 0.; CrossCarrierBox = new G4SubtractionSolid("CrossCarrierBox", CrossCarrierBox, CrossCarrierBox2, 0, G4ThreeVector(xCut, yCut, zCut + m_zOffSetCrossCarrier)); CrossCarrierBox = new G4SubtractionSolid("CrossCarrierBox", CrossCarrierBox, CrossCarrierBox2, 0, G4ThreeVector(-xCut, yCut, -zCut + m_zOffSetCrossCarrier)); } else { // no CROSS activated // no vertical carrier included CrossCarrierBox = new G4Box("CrossCarrierBox", 0.5*m_xFullCrossCarrier, 0.5*m_yHeightSideSupportCrossCarrier, 0.5*m_zFullCrossCarrier); } G4LogicalVolume* logCrossCarrierAll = new G4LogicalVolume(CrossCarrierBox, mateAir, "logCrossCarrierAll"); logCrossCarrierAll->SetVisAttributes(G4VisAttributes::Invisible); G4VisAttributes *vatAl = new G4VisAttributes(grey); vatAl->SetVisibility(true); vatAl->SetForceSolid(forceSolid); // Build Cross Carrier G4Box* solidCentralPartCrossCarrier = new G4Box("CentralPartCrossCarrier", 0.5*m_xCentralPartCrossCarrier, 0.5*m_yCentralPartCrossCarrier, 0.5*m_zCentralPartCrossCarrier); G4Box* solidHolePartCrossCarrier = new G4Box("HolePartCrossCarrier", 0.5*m_xHolePartCrossCarrier, 0.5*m_yHolePartCrossCarrier, 0.5*m_zHolePartCrossCarrier); G4Box* solidSidePartCrossCarrier = new G4Box("SidePartCrossCarrier", 0.5*m_xSidePartCrossCarrier, 0.5*m_ySidePartCrossCarrier, 0.5*m_zSidePartCrossCarrier); G4UnionSolid* solidUnionCrossCarrier = new G4UnionSolid("UnionCrossCarrier", solidCentralPartCrossCarrier, solidSidePartCrossCarrier, 0, G4ThreeVector(0.5*m_xCentralPartCrossCarrier+0.5*m_xSidePartCrossCarrier, -0.5*m_yCentralPartCrossCarrier+0.5*m_ySidePartCrossCarrier, 0.)); solidUnionCrossCarrier = new G4UnionSolid("solidUnionCrossCarrier", solidUnionCrossCarrier, solidSidePartCrossCarrier, 0, G4ThreeVector(-0.5*m_xCentralPartCrossCarrier-0.5*m_xSidePartCrossCarrier, -0.5*m_yCentralPartCrossCarrier+0.5*m_ySidePartCrossCarrier, 0.)); G4SubtractionSolid * solidCrossCarrierHeadSource = new G4SubtractionSolid("solidCrossCarrierHead", solidUnionCrossCarrier, solidHolePartCrossCarrier, 0, G4ThreeVector(0., 0.5*m_yHolePartCrossCarrier+m_yOffSetHolePartCrossCarrier-0.5*m_yCentralPartCrossCarrier, 0.)); G4LogicalVolume* logCrossCarrierHead = new G4LogicalVolume(solidUnionCrossCarrier, mateAir, "logCrossCarrierHead"); logCrossCarrierHead->SetVisAttributes(G4VisAttributes::Invisible); G4LogicalVolume* logCrossCarrierHeadSource = new G4LogicalVolume(solidCrossCarrierHeadSource, mateAl, "logCrossCarrierHeadSource"); logCrossCarrierHeadSource->SetVisAttributes(vatAl); // Tube and Rack G4Tubs * solidSideTubeCrossCarrier = new G4Tubs("SideTubeCrossCarrier", m_innerRadiusSideTubeCrossCarrier, m_outerRadiusSideTubeCrossCarrier, 0.5*m_widthSideTubeCrossCarrier, m_startAngleSideTubeCrossCarrier, m_spanningAngleSideTubeCrossCarrier); G4Box * solidRackPartCrossCarrier = new G4Box("RackPartCrossCarrier", 0.5*m_xRackPartCrossCarrier, 0.5*m_yRackPartCrossCarrier, 0.5*m_zRackPartCrossCarrier); G4LogicalVolume*logSideTubeCrossCarrier = new G4LogicalVolume(solidSideTubeCrossCarrier, mateCompositeCarbon, "logSideTubeCrossCarrier"); logSideTubeCrossCarrier->SetVisAttributes(vatAl); G4RotationMatrix * matRot = new G4RotationMatrix(); matRot->rotateX(90.*deg); G4LogicalVolume*logRackPartCrossCarrier = new G4LogicalVolume(solidRackPartCrossCarrier, matePOM, "logCentralRackCrossCarrier"); logRackPartCrossCarrier->SetVisAttributes(vatAl); // construct the PE capsule around source if needed G4Tubs * sourceCapsule = new G4Tubs("sourceCapsule", 0., m_sourceCapsuleRadius, 0.5*m_sourceCapsuleHeight, 0.*deg, 360.*deg); G4LogicalVolume * logCrossSourceCapsule = new G4LogicalVolume(sourceCapsule, matePE, "logSourceCapsule"); G4VisAttributes *vatPE = new G4VisAttributes(red); vatPE->SetVisibility(true); vatPE->SetForceSolid(forceSolid); logCrossSourceCapsule->SetVisAttributes(vatPE); // place the Carrier+Tube+Rack only if CROSS is activated // to avoid volume overlaps with the detector if( isCrossCalibration ) { new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), logCrossCarrierHeadSource, "physCrossCarrierHeadSource", logCrossCarrierHead, false, 0); if( bSourceCapsule ) {// construct the PE capsule around source new G4PVPlacement(0, G4ThreeVector(0., -m_yOffSetSourceCrossCarrier, 0.), logCrossSourceCapsule, "physCrossSourceCapsule", logCrossCarrierHead, false, 0); } new G4PVPlacement(0, G4ThreeVector(m_xSourcePositionCrossCarrier, m_yOffSetSourceCrossCarrier+m_ySourcePositionCrossCarrier, m_zOffSetCrossCarrier), logCrossCarrierHead, "physCrossCarrierHead", logCrossCarrierAll, false, 0); if( m_verboseLevel > 0 ) { G4cout << G4endl; G4cout << "=== location of the carrier source holder wrt CROSS Carrier ===" << G4endl; G4cout << m_xSourcePositionCrossCarrier << ", " << m_yOffSetSourceCrossCarrier+m_ySourcePositionCrossCarrier << ", " << m_zOffSetCrossCarrier << G4endl; G4cout << "======================================" << G4endl; G4cout << G4endl; } new G4PVPlacement(matRot, G4ThreeVector(0.5*m_xCentralPartCrossCarrier+0.5*m_xSidePartCrossCarrier+m_xSourcePositionCrossCarrier, 0.5*m_widthSideTubeCrossCarrier+m_ySourcePositionCrossCarrier, m_zOffSetCrossCarrier), logSideTubeCrossCarrier, "physSideTube1CrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(matRot, G4ThreeVector(-0.5*m_xCentralPartCrossCarrier-0.5*m_xSidePartCrossCarrier+m_xSourcePositionCrossCarrier, 0.5*m_widthSideTubeCrossCarrier+m_ySourcePositionCrossCarrier, m_zOffSetCrossCarrier), logSideTubeCrossCarrier, "physSideTube2CrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(0, G4ThreeVector(m_xSourcePositionCrossCarrier, 0.5*m_yRackPartCrossCarrier+m_yCentralPartCrossCarrier-m_ySidePartCrossCarrier+m_ySourcePositionCrossCarrier, m_zOffSetCrossCarrier), logRackPartCrossCarrier, "physCentralRackCrossCarrier", logCrossCarrierAll, false, 0); } // Cross Carrier Support G4RotationMatrix * rotSupport = new G4RotationMatrix(); rotSupport->rotateY(90.*deg); rotSupport->rotateZ(-90.*deg); G4Box* solidBarSupportCrossCarrier = new G4Box("BarSupportCrossCarrier", 0.5*m_xBarSupportCrossCarrier, 0.5*m_yBarSupportCrossCarrier, 0.5*m_zBarSupportCrossCarrier); G4LogicalVolume*logBarSupportCrossCarrier = new G4LogicalVolume(solidBarSupportCrossCarrier, matePOM, "logBarSupportCrossCarrier"); logBarSupportCrossCarrier->SetVisAttributes(vatAl); G4Box* solidRackSupportCrossCarrier = new G4Box("RackSupportCrossCarrier", 0.5*m_xRackSupportCrossCarrier, 0.5*m_yRackSupportCrossCarrier, 0.5*m_zRackSupportCrossCarrier); G4LogicalVolume*logRackSupportCrossCarrier = new G4LogicalVolume(solidRackSupportCrossCarrier, mateAl, "logRackSupportCrossCarrier"); logRackSupportCrossCarrier->SetVisAttributes(vatAl); G4Tubs * solidSupportTubeCrossCarrier = new G4Tubs("SupportTubeCrossCarrier", m_innerRadiusSupportTubeCrossCarrier, m_outerRadiusSupportTubeCrossCarrier, 0.5*m_widthSupportTubeCrossCarrier, m_startAngleSupportTubeCrossCarrier, m_spanningAngleSupportTubeCrossCarrier); G4LogicalVolume*logSupportTubeCrossCarrier = new G4LogicalVolume(solidSupportTubeCrossCarrier, mateCompositeCarbon, "logSupportTubeCrossCarrier"); logSupportTubeCrossCarrier->SetVisAttributes(vatAl); new G4PVPlacement(rotSupport, G4ThreeVector(m_xSupportCrossCarrier + m_xPosTube1SupportCrossCarrier, m_ySupportCrossCarrier + m_yPosTube1SupportCrossCarrier + yOffSet, m_zSupportCrossCarrier - m_zPosTube1SupportCrossCarrier), logSupportTubeCrossCarrier, "physSupportTube1CrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(rotSupport, G4ThreeVector(m_xSupportCrossCarrier + m_xPosTube2SupportCrossCarrier, m_ySupportCrossCarrier + m_yPosTube2SupportCrossCarrier + yOffSet, m_zSupportCrossCarrier - m_zPosTube2SupportCrossCarrier), logSupportTubeCrossCarrier, "physSupportTube2CrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(rotSupport, G4ThreeVector(m_xSupportCrossCarrier + m_xPosTube3SupportCrossCarrier, m_ySupportCrossCarrier + m_yPosTube3SupportCrossCarrier + yOffSet, m_zSupportCrossCarrier - m_zPosTube3SupportCrossCarrier), logSupportTubeCrossCarrier, "physSupportTube3CrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(rotSupport, G4ThreeVector(m_xSupportCrossCarrier+m_xPosTube4SupportCrossCarrier, m_ySupportCrossCarrier+m_yPosTube4SupportCrossCarrier + yOffSet, m_zSupportCrossCarrier-m_zPosTube4SupportCrossCarrier), logSupportTubeCrossCarrier, "physSupportTube4CrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(rotSupport, G4ThreeVector(m_xSupportCrossCarrier+m_xPosBarSupportCrossCarrier, m_ySupportCrossCarrier+m_yPosBarSupportCrossCarrier + yOffSet, m_zSupportCrossCarrier-m_zPosBarSupportCrossCarrier), logBarSupportCrossCarrier, "physSupportBarCrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(rotSupport, G4ThreeVector(m_xSupportCrossCarrier+m_xPosRackSupportCrossCarrier, m_ySupportCrossCarrier+m_yPosRackSupportCrossCarrier + yOffSet, m_zSupportCrossCarrier-m_zPosRackSupportCrossCarrier), logRackSupportCrossCarrier, "physSupportRackCrossCarrier", logCrossCarrierAll, false, 0); G4RotationMatrix *MatRotSub6 = new G4RotationMatrix(); MatRotSub6->rotateX(-atan(m_yTriangularPrismSubCentralSupportCrossCarrier/m_zTriangularPrismSubCentralSupportCrossCarrier)*rad); G4Box *solidSupportCentralCrossCarrierBox = new G4Box("solidSupportCentralCrossCarrierBox",0.5*m_xWidthCentralSupportCrossCarrier,0.5*m_yWidthCentralSupportCrossCarrier,0.5*m_zWidthCentralSupportCrossCarrier); G4Box *solidHoleSupportCentralCrossCarrierBox2 = new G4Box("solidHoleSupportCentralCrossCarrierBox2", m_xWidthCentralSupportCrossCarrier, sin(atan(m_yTriangularPrismSubCentralSupportCrossCarrier/m_zTriangularPrismSubCentralSupportCrossCarrier))*m_zTriangularPrismSubCentralSupportCrossCarrier, sqrt(pow(m_yTriangularPrismSubCentralSupportCrossCarrier,2)+pow(m_zTriangularPrismSubCentralSupportCrossCarrier,2))); G4Box *solidHoleSupportCentralCrossCarrierBox3 = new G4Box("solidHoleSupportCentralCrossCarrierBox3",m_xWidthCentralSupportCrossCarrier,m_yRectangleSubCentralSupportCrossCarrier,m_zRectangleSubCentralSupportCrossCarrier); G4SubtractionSolid * solidSub1CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSupportCentralCrossCarrierBox, solidHoleSupportCentralCrossCarrierBox2, MatRotSub6, G4ThreeVector(0.*mm, -0.5*m_yWidthCentralSupportCrossCarrier, -0.5*m_zWidthCentralSupportCrossCarrier)); G4SubtractionSolid * solidSub2CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub1CentralSupportCrossCarrier, solidHoleSupportCentralCrossCarrierBox3, 0, G4ThreeVector(0.*mm, 0.5*m_yWidthCentralSupportCrossCarrier, 0.5*m_zWidthCentralSupportCrossCarrier)); G4RotationMatrix *MatRotSub7 = new G4RotationMatrix(); MatRotSub7->rotateY(-90.*deg); G4ThreeVector vectorPositionSide(0.*mm,-0.5*m_yHeightSideSupportCrossCarrier,0.5*m_zWidthSideSupportCrossCarrier); G4ThreeVector vectorPositionCenter(0.*mm,-0.5*m_yWidthCentralSupportCrossCarrier,0.5*m_zWidthCentralSupportCrossCarrier); // Subtraction central part G4SubtractionSolid * solidSub3CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub2CentralSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionCenter+G4ThreeVector(m_xPosTube1SupportCrossCarrier, m_yPosTube1SupportCrossCarrier, -m_zPosTube1SupportCrossCarrier)); G4SubtractionSolid * solidSub4CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub3CentralSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionCenter+G4ThreeVector(m_xPosTube2SupportCrossCarrier, m_yPosTube2SupportCrossCarrier, -m_zPosTube2SupportCrossCarrier)); G4SubtractionSolid * solidSub5CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub4CentralSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionCenter+G4ThreeVector(m_xPosTube3SupportCrossCarrier, m_yPosTube3SupportCrossCarrier, -m_zPosTube3SupportCrossCarrier)); G4SubtractionSolid * solidSub6CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub5CentralSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionCenter+G4ThreeVector(m_xPosTube4SupportCrossCarrier, m_yPosTube4SupportCrossCarrier, -m_zPosTube4SupportCrossCarrier)); G4SubtractionSolid * solidSub7CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub6CentralSupportCrossCarrier, solidBarSupportCrossCarrier, MatRotSub7, vectorPositionCenter+G4ThreeVector(m_xPosBarSupportCrossCarrier, m_yPosBarSupportCrossCarrier, -m_zPosBarSupportCrossCarrier)); G4RotationMatrix *MatRotSub = new G4RotationMatrix(); MatRotSub->rotateZ(90.*deg); G4SubtractionSolid * solidSub8CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub7CentralSupportCrossCarrier, solidRackPartCrossCarrier, 0, G4ThreeVector(0., 0., 0.5*m_zWidthCentralSupportCrossCarrier - m_zOffSetSource)); G4RotationMatrix *MatRotSub2 = new G4RotationMatrix(); MatRotSub2->rotateX(90.*deg); G4SubtractionSolid * solidSub9CentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub8CentralSupportCrossCarrier, solidSideTubeCrossCarrier, MatRotSub2, G4ThreeVector(0.5*m_xCentralPartCrossCarrier+0.5*m_xSidePartCrossCarrier, 0, 0.5*m_zWidthCentralSupportCrossCarrier - m_zOffSetSource)); G4SubtractionSolid * solidSubFinalCentralSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub9CentralSupportCrossCarrier, solidSideTubeCrossCarrier, MatRotSub2, G4ThreeVector(-0.5*m_xCentralPartCrossCarrier-0.5*m_xSidePartCrossCarrier, 0, 0.5*m_zWidthCentralSupportCrossCarrier - m_zOffSetSource)); // Subtraction Side Part G4LogicalVolume*logSubFinalCentralSupportCrossCarrier = new G4LogicalVolume(solidSubFinalCentralSupportCrossCarrier, mateCentralCrossSupport, "logCentralSupportCrossCarrier"); logSubFinalCentralSupportCrossCarrier->SetVisAttributes(vatAl); G4RotationMatrix *MatRotSub5 = new G4RotationMatrix(); MatRotSub5->rotateX(45.*deg); G4Box *solidSupportSideCrossCarrierBox = new G4Box("SideSupportCrossCarrier",0.5*m_xLengthSideSupportCrossCarrier,0.5*m_yHeightSideSupportCrossCarrier,0.5*m_zWidthSideSupportCrossCarrier); G4Box *solidSupportSideCrossCarrierBox2 = new G4Box("SideSupportCrossCarrier",m_xLengthSideSupportCrossCarrier,0.5*sqrt(2*m_yTriangularPrismSubSideSupportCrossCarrier*m_yTriangularPrismSubSideSupportCrossCarrier)*mm,0.5*sqrt(2*m_zTriangularPrismSubSideSupportCrossCarrier*m_zTriangularPrismSubSideSupportCrossCarrier)*mm); G4SubtractionSolid * solidSub0SideSupportCrossCarrier = new G4SubtractionSolid("SideSupportCrossCarrier", solidSupportSideCrossCarrierBox, solidSupportSideCrossCarrierBox2, MatRotSub5, G4ThreeVector(0.*mm, -0.5*m_yHeightSideSupportCrossCarrier, -0.5*m_zWidthSideSupportCrossCarrier)); G4SubtractionSolid * solidSub1SideSupportCrossCarrier = new G4SubtractionSolid("SideSupportCrossCarrier", solidSub0SideSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionSide+ G4ThreeVector(m_xPosTube1SupportCrossCarrier, m_yPosTube1SupportCrossCarrier, -m_zPosTube1SupportCrossCarrier)); G4SubtractionSolid * solidSub2SideSupportCrossCarrier = new G4SubtractionSolid("SideSupportCrossCarrier", solidSub1SideSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionSide+ G4ThreeVector(m_xPosTube2SupportCrossCarrier, m_yPosTube2SupportCrossCarrier, -m_zPosTube2SupportCrossCarrier)); G4SubtractionSolid * solidSub3SideSupportCrossCarrier = new G4SubtractionSolid("SideSupportCrossCarrier", solidSub2SideSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionSide+ G4ThreeVector(m_xPosTube3SupportCrossCarrier, m_yPosTube3SupportCrossCarrier, -m_zPosTube3SupportCrossCarrier)); G4SubtractionSolid * solidSub4SideSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub3SideSupportCrossCarrier, solidSupportTubeCrossCarrier, MatRotSub7, vectorPositionSide+ G4ThreeVector(m_xPosTube4SupportCrossCarrier, m_yPosTube4SupportCrossCarrier, -m_zPosTube4SupportCrossCarrier)); G4SubtractionSolid * solidSub5SideSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub4SideSupportCrossCarrier, solidBarSupportCrossCarrier, MatRotSub7, vectorPositionSide+ G4ThreeVector(m_xPosBarSupportCrossCarrier, m_yPosBarSupportCrossCarrier, -m_zPosBarSupportCrossCarrier)); G4SubtractionSolid * solidSubFinalSideSupportCrossCarrier = new G4SubtractionSolid("CentralSupportCrossCarrier", solidSub5SideSupportCrossCarrier, solidRackSupportCrossCarrier, MatRotSub7, vectorPositionSide+ G4ThreeVector(m_xPosRackSupportCrossCarrier, m_yPosRackSupportCrossCarrier, -m_zPosRackSupportCrossCarrier)); G4LogicalVolume*logSideCrossCarrier = new G4LogicalVolume(solidSubFinalSideSupportCrossCarrier, mateSideCrossSupport, "logSideCrossCarrier"); logSideCrossCarrier->SetVisAttributes(vatAl); new G4PVPlacement(0, G4ThreeVector(m_xSourcePositionCrossCarrier, m_ySupportCrossCarrier + yOffSet + 0.5*m_yWidthCentralSupportCrossCarrier, m_zSupportCrossCarrier-0.5*m_zWidthCentralSupportCrossCarrier), logSubFinalCentralSupportCrossCarrier, "physCentralFinalSupportCrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(0, G4ThreeVector(m_xPosSideSupportCrossCarrier, m_ySupportCrossCarrier + yOffSet +0.5*m_yHeightSideSupportCrossCarrier, m_zSupportCrossCarrier-0.5*m_zWidthSideSupportCrossCarrier), logSideCrossCarrier, "physSideSupportCrossCarrier", logCrossCarrierAll, false, 0); new G4PVPlacement(0, G4ThreeVector(-m_xPosSideSupportCrossCarrier, m_ySupportCrossCarrier + yOffSet+0.5*m_yHeightSideSupportCrossCarrier, m_zSupportCrossCarrier-0.5*m_zWidthSideSupportCrossCarrier), logSideCrossCarrier, "physSide2SupportCrossCarrier", logCrossCarrierAll, false, 0); if( m_verboseLevel > 0 ) { G4float totalMass = 0., totalVol = 0.; G4float massSolidSupportTubeCrossCarrier = 4.*logSupportTubeCrossCarrier->GetMass()/g; G4float volSolidSupportTubeCrossCarrier = 4.*solidSupportTubeCrossCarrier->GetCubicVolume()/cm3; totalMass += massSolidSupportTubeCrossCarrier; totalVol += volSolidSupportTubeCrossCarrier; G4float massSolidBarSupportCrossCarrier = logBarSupportCrossCarrier->GetMass()/g; G4float volSolidBarSupportCrossCarrier = solidBarSupportCrossCarrier->GetCubicVolume()/cm3; totalMass += massSolidBarSupportCrossCarrier; totalVol += volSolidBarSupportCrossCarrier; G4float massSolidRackSupportCrossCarrier = logRackSupportCrossCarrier->GetMass()/g; G4float volSolidRackSupportCrossCarrier = solidRackSupportCrossCarrier->GetCubicVolume()/cm3; totalMass += massSolidRackSupportCrossCarrier; totalVol += volSolidRackSupportCrossCarrier; G4float massSolidSubFinalCentralSupportCrossCarrier = logSubFinalCentralSupportCrossCarrier->GetMass()/g; G4float volSolidSubFinalCentralSupportCrossCarrier = solidSubFinalCentralSupportCrossCarrier->GetCubicVolume()/cm3; totalMass += massSolidSubFinalCentralSupportCrossCarrier; totalVol += volSolidSubFinalCentralSupportCrossCarrier; G4float massSolidSubFinalSideSupportCrossCarrier = 2.*logSideCrossCarrier->GetMass()/g; G4float volSolidSubFinalSideSupportCrossCarrier = 2.*solidSubFinalSideSupportCrossCarrier->GetCubicVolume()/cm3; totalMass += massSolidSubFinalSideSupportCrossCarrier; totalVol += volSolidSubFinalSideSupportCrossCarrier; G4float massCrossCarrierHead = 0., massCrossSourceCapsule = 0., massSolidSideTubeCrossCarrier = 0., massSolidRackPartCrossCarrier = 0.; G4float volCrossCarrierHead = 0., volCrossSourceCapsule = 0., volSolidSideTubeCrossCarrier = 0., volSolidRackPartCrossCarrier = 0.; if( isCrossCalibration ) { massCrossCarrierHead = logCrossCarrierHeadSource->GetMass()/g; volCrossCarrierHead = solidCrossCarrierHeadSource->GetCubicVolume()/cm3; totalMass += massCrossCarrierHead; totalVol += volCrossCarrierHead; massSolidSideTubeCrossCarrier = 2.*logSideTubeCrossCarrier->GetMass()/g; volSolidSideTubeCrossCarrier = 2.*solidSideTubeCrossCarrier->GetCubicVolume()/cm3; totalMass += massSolidSideTubeCrossCarrier; totalVol += volSolidSideTubeCrossCarrier; massSolidRackPartCrossCarrier = logRackPartCrossCarrier->GetMass()/g; volSolidRackPartCrossCarrier = solidRackPartCrossCarrier->GetCubicVolume()/cm3; totalMass += massSolidRackPartCrossCarrier; totalVol += volSolidRackPartCrossCarrier; if( bSourceCapsule ) { massCrossSourceCapsule = logCrossSourceCapsule->GetMass()/g; volCrossSourceCapsule = sourceCapsule->GetCubicVolume()/cm3; totalMass += massCrossSourceCapsule; totalVol += volCrossSourceCapsule; } } G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << " part: mass (g)\t volume (cm^3)" << G4endl; G4cout << " SupportTubeCrossCarrier: " << massSolidSupportTubeCrossCarrier << ", \t" << volSolidSupportTubeCrossCarrier << G4endl; G4cout << " BarSupportCrossCarrier: " << massSolidBarSupportCrossCarrier << ", \t" << volSolidBarSupportCrossCarrier << G4endl; G4cout << " RackSupportCrossCarrier: " << massSolidRackSupportCrossCarrier << ", \t" << volSolidRackSupportCrossCarrier << G4endl; G4cout << " SubFinalCentralSupportCrossCarrier: " << massSolidSubFinalCentralSupportCrossCarrier << ", \t" << volSolidSubFinalCentralSupportCrossCarrier << G4endl; G4cout << " SubFinalSideSupportCrossCarrier: " << massSolidSubFinalSideSupportCrossCarrier << ", \t" << volSolidSubFinalSideSupportCrossCarrier << G4endl; if( isCrossCalibration ) { G4cout << " CrossCarrierHead: " << massCrossCarrierHead << ", \t" << volCrossCarrierHead << G4endl; G4cout << " SideTubeCrossCarrier: " << massSolidSideTubeCrossCarrier << ", \t" << volSolidSideTubeCrossCarrier << G4endl; G4cout << " RackPartCrossCarrier: " << massSolidRackPartCrossCarrier << ", \t" << volSolidRackPartCrossCarrier << G4endl; if( bSourceCapsule ) G4cout << " CrossSourceCapsule: " << massCrossSourceCapsule << ", \t" << volCrossSourceCapsule << G4endl; } G4cout << " CROSS carrier total: " << totalMass << ", \t" << totalVol << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } G4cout << G4endl << "************** END CROSS carrier construction****************" << G4endl; return logCrossCarrierAll; }