#include #include #include #include #include #include #include #include #include using namespace RAT; using namespace CLHEP; using namespace std; PanelT21::PanelT21( const std::string& prefix, const G4ThreeVector& position, const G4ThreeVector& zAxis, const G4ThreeVector& xAxis, G4Material* panelMaterial, G4VisAttributes* visAttributes ) : PanelBase( prefix, position, zAxis, xAxis, panelMaterial, visAttributes ) { SetPMTList(); SetCutList(); } void PanelT21::ConstructPanel() { // Construct the Panel Envelope, for T21 it is a regular Dodecagon + a smaller regular hexagon double panelRadius = 4.0 * fPMTRadius / cos( pi / 6.0 ); double z[] = { fPanelDepth, fPanelHeight }; double rInner[] = { 0, 0 }; double rOuter[] = { panelRadius, panelRadius }; G4Polyhedra *panelSolid1 = new G4Polyhedra( fPrefix + "_t21panel1", pi / 6.0 * rad, twopi, 6, 2, z, rInner, rOuter ); // Second Panel Part panelRadius = ( 2.0 * tan( pi / 6.0 * rad ) + ( 2.0 - cos( twopi / 6.0 * rad ) ) / cos( pi / 6.0 * rad ) ) * fPMTRadius; rOuter[0] = panelRadius; rOuter[1] = panelRadius; G4Polyhedra *panelSolid2 = new G4Polyhedra( fPrefix + "_t21panel2", pi / 6.0 * rad, twopi, 6, 2, z, rInner, rOuter ); // Extra offset is needed as boolean solid will fail without double panelOffset = 2.0 * fPMTb + 2.0 * fPMTc; G4VSolid* panelSolid = new G4UnionSolid( fPrefix + "_t21_solid", panelSolid1, panelSolid2, 0, panelOffset * G4ThreeVector( 1.0, 0.0, 0.0 ) ); fPanelLogical = new G4LogicalVolume( panelSolid, fPanelMaterial, fPrefix + "_t21_logic" ); fPanelLogical->SetVisAttributes( fVisAttributes ); fPMTRotation = 0.0; } void PanelT21::SetPMTList() { fPMTs.clear(); fPMTs.push_back( PanelPMT( G4ThreeVector( 0.0, 0.0, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( fPMTb + fPMTc, fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 0.0, 2.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( -fPMTb - fPMTc, fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( -fPMTb - fPMTc, -fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 0.0, -2.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( fPMTb + fPMTc, -fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 2.0 * fPMTb + 2.0 * fPMTc, 0.0, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 2.0 * fPMTb + 2.0 * fPMTc, 2.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( fPMTb + fPMTc, 3.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 0.0, 4.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( -fPMTb - fPMTc, 3.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( -2.0 * fPMTb - 2.0 * fPMTc, 2.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( -2.0 * fPMTb - 2.0 * fPMTc, 0.0, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( -2.0 * fPMTb - 2.0 * fPMTc, -2.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( -fPMTb - fPMTc, -3.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 0.0, -4.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( fPMTb + fPMTc, -3.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 2.0 * fPMTb + 2.0 * fPMTc, -2.0 * fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 3.0 * fPMTb + 3.0 * fPMTc, fPMTRadius, 0.0 ) ) ); fPMTs.push_back( PanelPMT( G4ThreeVector( 3.0 * fPMTb + 3.0 * fPMTc, -fPMTRadius, 0.0 ) ) ); } void PanelT21::SetCutList() { fEdgeCoords.clear(); fEdgeCoords.push_back( G4ThreeVector( 4.0 * fPMTb + 4.0 * fPMTc, 0.0, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 4.0 * fPMTb + 4.0 * fPMTc, 2.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 3.0 * fPMTb + 3.0 * fPMTc, 3.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 2.0 * fPMTb + 2.0 * fPMTc, 4.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 1.0 * fPMTb + 1.0 * fPMTc, 5.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 0.0, 6.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -1.0 * fPMTb - 1.0 * fPMTc, 5.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -2.0 * fPMTb - 2.0 * fPMTc, 4.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -3.0 * fPMTb - 3.0 * fPMTc, 3.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -3.0 * fPMTb - 3.0 * fPMTc, 1.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -3.0 * fPMTb - 3.0 * fPMTc, -1.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -3.0 * fPMTb - 3.0 * fPMTc, -3.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -2.0 * fPMTb - 2.0 * fPMTc, -4.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( -1.0 * fPMTb - 1.0 * fPMTc, -5.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 0.0, -6.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 1.0 * fPMTb + 1.0 * fPMTc, -5.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 2.0 * fPMTb + 2.0 * fPMTc, -4.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 3.0 * fPMTb + 3.0 * fPMTc, -3.0 * fPMTRadius, 0.0 ) ); fEdgeCoords.push_back( G4ThreeVector( 4.0 * fPMTb + 4.0 * fPMTc, -2.0 * fPMTRadius, 0.0 ) ); }