#include <G4AdjointPrimaryGenerator.hh>
Public Member Functions | |
G4AdjointPrimaryGenerator () | |
~G4AdjointPrimaryGenerator () | |
void | GenerateAdjointPrimaryVertex (G4Event *anEvt, G4ParticleDefinition *adj_part, G4double E1, G4double E2) |
void | SetSphericalAdjointPrimarySource (G4double radius, G4ThreeVector pos) |
void | SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume (const G4String &volume_name) |
Definition at line 63 of file G4AdjointPrimaryGenerator.hh.
G4AdjointPrimaryGenerator::G4AdjointPrimaryGenerator | ( | ) |
Definition at line 45 of file G4AdjointPrimaryGenerator.cc.
References G4SingleParticleSource::GetAngDist(), G4SingleParticleSource::GetEneDist(), G4AdjointPosOnPhysVolGenerator::GetInstance(), G4SingleParticleSource::GetPosDist(), G4SPSEneDistribution::SetAlpha(), G4SPSAngDistribution::SetAngDistType(), G4SPSEneDistribution::SetEnergyDisType(), and G4SPSPosDistribution::SetPosDisType().
00046 : radius_spherical_source(0.) 00047 { 00048 theSingleParticleSource = new G4SingleParticleSource(); 00049 00050 theSingleParticleSource->GetEneDist()->SetEnergyDisType("Pow"); 00051 theSingleParticleSource->GetEneDist()->SetAlpha(-1.); 00052 theSingleParticleSource->GetPosDist()->SetPosDisType("Point"); 00053 theSingleParticleSource->GetAngDist()->SetAngDistType("planar"); 00054 00055 theG4AdjointPosOnPhysVolGenerator = G4AdjointPosOnPhysVolGenerator::GetInstance(); 00056 }
G4AdjointPrimaryGenerator::~G4AdjointPrimaryGenerator | ( | ) |
void G4AdjointPrimaryGenerator::GenerateAdjointPrimaryVertex | ( | G4Event * | anEvt, | |
G4ParticleDefinition * | adj_part, | |||
G4double | E1, | |||
G4double | E2 | |||
) |
Definition at line 65 of file G4AdjointPrimaryGenerator.cc.
References G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(), G4SingleParticleSource::GeneratePrimaryVertex(), G4SingleParticleSource::GetAngDist(), G4SingleParticleSource::GetEneDist(), G4SingleParticleSource::GetPosDist(), G4SPSPosDistribution::SetCentreCoords(), G4SPSEneDistribution::SetEmax(), G4SPSEneDistribution::SetEmin(), G4SingleParticleSource::SetParticleDefinition(), and G4SPSAngDistribution::SetParticleMomentumDirection().
Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().
00066 { 00067 if (type_of_adjoint_source == "ExternalSurfaceOfAVolume") { 00068 00069 //Generate position and direction relative to the external surface of sensitive volume 00070 //------------------------------------------------------------- 00071 00072 G4double costh_to_normal; 00073 G4ThreeVector pos,direction; 00074 theG4AdjointPosOnPhysVolGenerator->GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(pos, direction,costh_to_normal); 00075 if (costh_to_normal <1.e-4) costh_to_normal =1.e-4; 00076 theSingleParticleSource->GetAngDist()->SetParticleMomentumDirection(-direction); 00077 theSingleParticleSource->GetPosDist()->SetCentreCoords(pos); 00078 } 00079 00080 theSingleParticleSource->GetEneDist()->SetEmin(E1); 00081 theSingleParticleSource->GetEneDist()->SetEmax(E2); 00082 00083 theSingleParticleSource->SetParticleDefinition(adj_part); 00084 theSingleParticleSource->GeneratePrimaryVertex(anEvent); 00085 }
void G4AdjointPrimaryGenerator::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume | ( | const G4String & | volume_name | ) |
Definition at line 103 of file G4AdjointPrimaryGenerator.cc.
References G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume1(), G4SingleParticleSource::GetAngDist(), G4SingleParticleSource::GetPosDist(), G4SPSAngDistribution::SetAngDistType(), and G4SPSPosDistribution::SetPosDisType().
Referenced by G4AdjointPrimaryGeneratorAction::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume().
00104 { 00105 theG4AdjointPosOnPhysVolGenerator->DefinePhysicalVolume1(volume_name); 00106 type_of_adjoint_source ="ExternalSurfaceOfAVolume"; 00107 theSingleParticleSource->GetPosDist()->SetPosDisType("Point"); 00108 theSingleParticleSource->GetAngDist()->SetAngDistType("planar"); 00109 }
void G4AdjointPrimaryGenerator::SetSphericalAdjointPrimarySource | ( | G4double | radius, | |
G4ThreeVector | pos | |||
) |
Definition at line 88 of file G4AdjointPrimaryGenerator.cc.
References G4SingleParticleSource::GetAngDist(), G4SingleParticleSource::GetPosDist(), G4INCL::Math::pi, G4SPSAngDistribution::SetAngDistType(), G4SPSPosDistribution::SetCentreCoords(), G4SPSAngDistribution::SetMaxTheta(), G4SPSAngDistribution::SetMinTheta(), G4SPSPosDistribution::SetPosDisShape(), G4SPSPosDistribution::SetPosDisType(), and G4SPSPosDistribution::SetRadius().
Referenced by G4AdjointPrimaryGeneratorAction::SetSphericalAdjointPrimarySource().
00089 { 00090 radius_spherical_source = radius; 00091 center_spherical_source = center_pos; 00092 type_of_adjoint_source ="Spherical"; 00093 theSingleParticleSource->GetPosDist()->SetPosDisType("Surface"); 00094 theSingleParticleSource->GetPosDist()->SetPosDisShape("Sphere"); 00095 theSingleParticleSource->GetPosDist()->SetCentreCoords(center_pos); 00096 theSingleParticleSource->GetPosDist()->SetRadius(radius); 00097 theSingleParticleSource->GetAngDist()->SetAngDistType("cos"); 00098 theSingleParticleSource->GetAngDist()->SetMaxTheta(pi); 00099 theSingleParticleSource->GetAngDist()->SetMinTheta(halfpi); 00100 }