#include #include #include #include #include #include using namespace RAT; #include using namespace std; CuboidPMTConstructor::CuboidPMTConstructor( const std::string& prefix, const PMTConstructorParams& params ) : PMTConstructor( prefix, params ) { } void CuboidPMTConstructor::ConstructLogical() { const bool overlapRegion = fPMTParameters.fPCMirrorOverlapTop != fPMTParameters.fPCMirrorOverlapBottom; const double wall = fPMTParameters.fGlassThickness; // Construct the glass body G4Box* bodySolid = new G4Box( fPrefix + "_body_solid", fPMTParameters.fXWidth / 2.0, fPMTParameters.fYWidth / 2.0, fPMTParameters.fHeight / 2.0 ); // Now construct the solids const double inner1Height = fPMTParameters.fHeight / 2.0 - fPMTParameters.fPCMirrorOverlapTop - wall; G4Box* inner1Solid = new G4Box( fPrefix + "_inner1_solid", fPMTParameters.fXWidth / 2.0 - wall, fPMTParameters.fYWidth / 2.0 - wall, inner1Height / 2.0 ); const double inner2Height = fPMTParameters.fPCMirrorOverlapTop - fPMTParameters.fPCMirrorOverlapBottom; G4Box* inner2Solid = NULL; if( overlapRegion ) inner2Solid = new G4Box( fPrefix + "_inner2_solid", fPMTParameters.fXWidth / 2.0 - wall, fPMTParameters.fYWidth / 2.0 - wall, inner2Height / 2.0 ); const double inner3Height = fPMTParameters.fPCMirrorOverlapBottom + fPMTParameters.fHeight / 2.0 - wall; G4Box* inner3Solid = new G4Box( fPrefix + "_inner3_solid", fPMTParameters.fXWidth / 2.0 - wall, fPMTParameters.fYWidth / 2.0 - wall, inner3Height / 2.0 ); // Construct the dynode volume double dynodeHeight = fPMTParameters.fDynodeTopZCoord + fPMTParameters.fHeight / 2.0 - wall; G4Box* dynodeSolid = new G4Box( fPrefix + "_dynode_solid", fPMTParameters.fDynodeRadius, fPMTParameters.fDynodeRadius, dynodeHeight / 2.0 ); // Construct the logical volumes fBodyLogic = new G4LogicalVolume( bodySolid, fPMTParameters.fGlassMaterial, fPrefix + "_body_logic" ); fInner1Logic = new G4LogicalVolume( inner1Solid, fPMTParameters.fVacuumMaterial, fPrefix + "_inner1_logic" ); if( overlapRegion ) fInner2Logic = new G4LogicalVolume( inner2Solid, fPMTParameters.fVacuumMaterial, fPrefix + "_inner2_logic"); fInner3Logic = new G4LogicalVolume( inner3Solid, fPMTParameters.fVacuumMaterial, fPrefix + "_inner3_logic"); fDynode1Logic = new G4LogicalVolume( dynodeSolid, fPMTParameters.fDynodeMaterial, fPrefix + "_dynode_logic" ); // Place the inner solids in the body solid to produce the physical volumes fInner1Phys = new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, fPMTParameters.fPCMirrorOverlapTop + inner1Height / 2.0 ), fInner1Logic, fPrefix + "_inner1", fBodyLogic, false, 0 ); fInner2Phys = NULL; if( overlapRegion ) fInner2Phys = new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, fPMTParameters.fPCMirrorOverlapBottom + inner2Height / 2.0 ), fInner2Logic, fPrefix + "_inner2", fBodyLogic, false, 0 ); fInner3Phys = new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0,fPMTParameters.fPCMirrorOverlapBottom - inner3Height / 2.0 ), fInner3Logic, fPrefix + "_inner3", fBodyLogic, false, 0 ); new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, fPMTParameters.fDynodeTopZCoord - dynodeHeight / 2.0 ), fDynode1Logic, fPrefix + "_dynode", fInner3Logic, false, 0 ); // Set the colour etc... SetAttributes(); } double CuboidPMTConstructor::GetMaxHeight() { return fPMTParameters.fHeight / 2.0; } double CuboidPMTConstructor::GetMaxDepth() { return -fPMTParameters.fHeight / 2.0; } double CuboidPMTConstructor::GetHexRadius() { return 0.0; } double CuboidPMTConstructor::GetXWidth() { return fPMTParameters.fXWidth; } double CuboidPMTConstructor::GetYWidth() { return fPMTParameters.fYWidth; }