#include #include using namespace CLHEP; #include #include #include using namespace RAT; #include using namespace std; ConcentratorAgedOpticalModel::ConcentratorAgedOpticalModel( const G4String name, G4Region* const region, const std::string params, G4LogicalVolume* const volume ) : ConcentratorOpticalModel( name, region, params, volume ) { fProcessName = "ConcentratorAgedOpticalModel"; // First load the overall model, Optics[something]... DBLinkPtr concModelTable = DB::Get()->GetLink( "CONC_OPTICAL_PARAMETERS", params ); try { fDegredationBorder = concModelTable->GetD( "degradation_border" ); // Now the wavelength dependent degradation factors vector upVal1, upVal2, lwVal1, lwVal2; upVal1 = concModelTable->GetDArray( "upper_degradation_value1" ); upVal2 = concModelTable->GetDArray( "upper_degradation_value2" ); lwVal1 = concModelTable->GetDArray( "lower_degradation_value1" ); lwVal2 = concModelTable->GetDArray( "lower_degradation_value2" ); fUpperDegredation = new G4MaterialPropertyVector(); { vector::reverse_iterator j = upVal2.rbegin(); for( vector::reverse_iterator k = upVal1.rbegin(); k != upVal1.rend(); ++k ) { fUpperDegredation->InsertValues( twopi * hbarc/( (*k) * nanometer ), *j ); ++j; } } fLowerDegredation = new G4MaterialPropertyVector(); { vector::reverse_iterator j = lwVal2.rbegin(); for( vector::reverse_iterator k = lwVal1.rbegin(); k != lwVal1.rend(); ++k ) { fLowerDegredation->InsertValues( twopi * hbarc/( (*k) * nanometer ), *j ); ++j; } } } catch( RAT::DBNotFoundError &e ) { RAT::Log::Die( "ConcentratorAgedOpticalModel::ConcentratorAgedOpticalModel: Cannot Find CONC_OPTICAL_PARAMETERS Parameters" ); } } void ConcentratorAgedOpticalModel::GetReflectionProb( const G4ThreeVector& position, const G4double localTheta, const G4double energy, EPolarisation polarisation, G4double& specularR, G4double& diffuseR ) { ConcentratorOpticalModel::GetReflectionProb( position, localTheta, energy, polarisation, specularR, diffuseR ); if( position.z() > fDegredationBorder ) { specularR = specularR * ( 1.0 - fUpperDegredation->Value( energy ) ); diffuseR += specularR * fUpperDegredation->Value( energy ); } else { specularR = specularR * ( 1.0 - fLowerDegredation->Value( energy ) ); diffuseR += specularR * fLowerDegredation->Value( energy ); } }