#include #include #include #include #include #include #include #include #include #include #include using namespace RAT; #include using namespace std; PMTConstructor::PMTConstructor( const std::string& prefix, const PMTConstructorParams& params ) : fPMTParameters( params ), fBodyLogic( NULL ), fInner1Logic( NULL ), fInner2Logic ( NULL ), fInner3Logic( NULL ), fDynode1Logic( NULL ), fDynode2Logic( NULL ), fDynode3Logic( NULL ), fInner1Phys( NULL ), fInner2Phys( NULL ), fInner3Phys( NULL ) { fPrefix = prefix + std::string( "_pmt"); } void PMTConstructor::SetAttributes() { // ------------ Vis Attributes ------------- if( fPMTParameters.fVisAttributes->IsDaughtersInvisible() ) { fBodyLogic->SetVisAttributes( fPMTParameters.fVisAttributes ); fDynode1Logic->SetVisAttributes( fPMTParameters.fVisAttributes ); if( fDynode2Logic ) fDynode2Logic->SetVisAttributes( fPMTParameters.fVisAttributes ); if( fDynode3Logic ) fDynode3Logic->SetVisAttributes( fPMTParameters.fVisAttributes ); fInner1Logic->SetVisAttributes( fPMTParameters.fVisAttributes ); if( fInner2Logic ) fInner2Logic->SetVisAttributes( fPMTParameters.fVisAttributes ); fInner3Logic->SetVisAttributes( fPMTParameters.fVisAttributes ); } else { // PMT glass fBodyLogic->SetVisAttributes( fPMTParameters.fVisAttributes ); // dynode is medium gray fDynode1Logic->SetVisAttributes( new G4VisAttributes( G4Color( 0.5, 0.5, 0.5, 1.0 ) ) ); if( fDynode2Logic ) fDynode2Logic->SetVisAttributes( new G4VisAttributes( G4Color( 0.5, 0.5, 0.5, 1.0 ) ) ); if( fDynode3Logic ) fDynode3Logic->SetVisAttributes( new G4VisAttributes( G4Color( 0.5, 0.5, 0.5, 1.0 ) ) ); // (surface of) interior vacuum is clear orangish gray on top (PC), // silvery blue on bottom (mirror) fInner1Logic->SetVisAttributes( new G4VisAttributes( G4Color( 0.7, 0.5, 0.3, 0.27 ) ) ); if( fInner2Logic ) fInner2Logic->SetVisAttributes( new G4VisAttributes( G4Color( 0.6, 0.7, 0.8, 0.67 ) ) ); fInner3Logic->SetVisAttributes( new G4VisAttributes( G4Color( 0.6, 0.7, 0.8, 0.67 ) ) ); } } void PMTConstructor::ConstructPhysical( G4PVPlacement* bodyPhys ) { // ------------ Physical Surfaces------------- new G4LogicalBorderSurface( fPrefix + "_photocathode_surface1", fInner1Phys, bodyPhys, fPMTParameters.fPhotocathodeSurface ); new G4LogicalBorderSurface( fPrefix + "_photocathode_surface2", bodyPhys, fInner1Phys, fPMTParameters.fPhotocathodeSurface ); if( fInner2Phys != NULL ) // Then overlap region, mirror is outer surface { new G4LogicalBorderSurface( fPrefix + "_photocathode_mirror_surface1", fInner2Phys, bodyPhys, fPMTParameters.fPhotocathodeSurface ); new G4LogicalBorderSurface( fPrefix + "_photocathode_mirror_surface1", bodyPhys, fInner2Phys, fPMTParameters.fMirrorSurface ); } new G4LogicalBorderSurface( fPrefix + "_mirror_surface1", fInner3Phys, bodyPhys, fPMTParameters.fMirrorSurface ); new G4LogicalBorderSurface( fPrefix + "_mirror_surface2", bodyPhys, fInner3Phys, fPMTParameters.fMirrorSurface ); } G4LogicalVolume* PMTConstructor::GetLogicalVolume() { if( fBodyLogic == NULL ) Log::Die("PMTConstruction::GetLogicalVolume: Construct has not been called."); return fBodyLogic; } string PMTConstructor::GetModelType() { return fPMTParameters.fModelType; } string PMTConstructor::GetModelParams() { return fPMTParameters.fModelParams; }