#include #include #include #include #include #include #include #include #include #include #include using namespace std; namespace RAT { void GeoPMTFactoryBase::AssembleFullPMT( DBLinkPtr table, G4Material* motherMaterial ) { string volumeName = table->GetIndex(); GeoPMTBuilderBase::Initialise( volumeName, motherMaterial ); const vector pmtBuildType = table->GetIArray( "pmt_build_type" ); const vector pmtType = table->GetSArray( "pmt_type" ); const vector addConcentrator = table->GetIArray( "add_concentrator" ); const vector concType = table->GetSArray( "concentrator_type" ); const vector addBucket = table->GetIArray( "add_bucket" ); const vector bucketType = table->GetSArray( "bucket_type" ); const vector addPMTBase = table->GetIArray( "add_pmtbase" ); const vector pmtBaseType = table->GetSArray( "pmtbase_type" ); G4VisAttributes* visAttributes = GeoFactory::LoadVisualisation( table ); visAttributes->SetDaughtersInvisible( true ); // Now loop over the PMT Build Types for( unsigned int iBuild = 0; iBuild < pmtBuildType.size(); iBuild++ ) { /// Build the pmt ConstructPMT( pmtBuildType[iBuild], PMTConstructorParams( pmtType[iBuild], visAttributes ) ); /// Build the concentrator if( addConcentrator[iBuild] ) ConstructConc( pmtBuildType[iBuild], ConcentratorConstructorParams( concType[iBuild], motherMaterial, visAttributes ) ); /// Build the bucket if( addBucket[iBuild] && addConcentrator[iBuild] ) ConstructBucket( pmtBuildType[iBuild], BucketConstructorParams( bucketType[iBuild], fConcentrator[ pmtBuildType[iBuild] ]->GetNumPetals(), fConcentrator[ pmtBuildType[iBuild] ]->GetHexRadius() + PMTGeo::kFaceGap, visAttributes ) ); else if( addBucket[iBuild] ) ConstructBucket( pmtBuildType[iBuild], BucketConstructorParams( bucketType[iBuild], visAttributes ) ); /// Build the PMTBase if( addPMTBase[iBuild] ) { if( fPMT[ pmtBuildType[iBuild] ]->GetType() != string( "r1408" ) ) Log::Die("GeoPMTFactoryBase::AssembleFullPMT error: PMT Base is only valid on a r1408 type pmt"); ConstructPMTBase( pmtBuildType[iBuild], PMTBaseConstructorParams( pmtBaseType[iBuild], visAttributes ) ); } GeoPMTBuilderBase::AssembleFullPMT( pmtBuildType[iBuild], visAttributes ); } } void GeoPMTFactoryBase::SetupOpticalModel( DBLinkPtr table ) { const vector pmtBuildType = table->GetIArray( "pmt_build_type" ); const vector greyDisc = table->GetIArray( "grey_disc" ); //const vector discModel = table->GetSArray( "grey_disc_model" ); TODO const vector discModelParams = table->GetSArray( "grey_disc_model_params" ); for( unsigned int iBuild = 0; iBuild < pmtBuildType.size(); iBuild++ ) { if( greyDisc[iBuild] ) GeoPMTBuilderBase::SetupDiscOpticalModel( pmtBuildType[iBuild], string(), discModelParams[iBuild] ); else GeoPMTBuilderBase::SetupFullOpticalModel( pmtBuildType[iBuild] ); } } } //::RAT