Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AdjointPrimaryGenerator Class Reference

#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)
 

Detailed Description

Definition at line 63 of file G4AdjointPrimaryGenerator.hh.

Constructor & Destructor Documentation

◆ G4AdjointPrimaryGenerator()

G4AdjointPrimaryGenerator::G4AdjointPrimaryGenerator ( )

Definition at line 45 of file G4AdjointPrimaryGenerator.cc.

46 : radius_spherical_source(0.)
47{
48 theSingleParticleSource = new G4SingleParticleSource();
49
50 theSingleParticleSource->GetEneDist()->SetEnergyDisType("Pow");
51 theSingleParticleSource->GetEneDist()->SetAlpha(-1.);
52 theSingleParticleSource->GetPosDist()->SetPosDisType("Point");
53 theSingleParticleSource->GetAngDist()->SetAngDistType("planar");
54
55 theG4AdjointPosOnPhysVolGenerator = G4AdjointPosOnPhysVolGenerator::GetInstance();
56}
static G4AdjointPosOnPhysVolGenerator * GetInstance()
void SetEnergyDisType(G4String)
G4SPSAngDistribution * GetAngDist()
G4SPSPosDistribution * GetPosDist()
G4SPSEneDistribution * GetEneDist()

◆ ~G4AdjointPrimaryGenerator()

G4AdjointPrimaryGenerator::~G4AdjointPrimaryGenerator ( )

Definition at line 59 of file G4AdjointPrimaryGenerator.cc.

60{
61 delete theSingleParticleSource;
62}

Member Function Documentation

◆ GenerateAdjointPrimaryVertex()

void G4AdjointPrimaryGenerator::GenerateAdjointPrimaryVertex ( G4Event anEvt,
G4ParticleDefinition adj_part,
G4double  E1,
G4double  E2 
)

Definition at line 65 of file G4AdjointPrimaryGenerator.cc.

66{
67 if (type_of_adjoint_source == "ExternalSurfaceOfAVolume") {
68
69 //Generate position and direction relative to the external surface of sensitive volume
70 //-------------------------------------------------------------
71
72 G4double costh_to_normal;
73 G4ThreeVector pos,direction;
74 theG4AdjointPosOnPhysVolGenerator->GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(pos, direction,costh_to_normal);
75 if (costh_to_normal <1.e-4) costh_to_normal =1.e-4;
76 theSingleParticleSource->GetAngDist()->SetParticleMomentumDirection(-direction);
77 theSingleParticleSource->GetPosDist()->SetCentreCoords(pos);
78 }
79
80 theSingleParticleSource->GetEneDist()->SetEmin(E1);
81 theSingleParticleSource->GetEneDist()->SetEmax(E2);
82
83 theSingleParticleSource->SetParticleDefinition(adj_part);
84 theSingleParticleSource->GeneratePrimaryVertex(anEvent);
85}
double G4double
Definition: G4Types.hh:64
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector &p, G4ThreeVector &direction)
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
void SetCentreCoords(G4ThreeVector)
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
void GeneratePrimaryVertex(G4Event *evt)

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume()

void G4AdjointPrimaryGenerator::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume ( const G4String volume_name)

Definition at line 103 of file G4AdjointPrimaryGenerator.cc.

104{
105 theG4AdjointPosOnPhysVolGenerator->DefinePhysicalVolume1(volume_name);
106 type_of_adjoint_source ="ExternalSurfaceOfAVolume";
107 theSingleParticleSource->GetPosDist()->SetPosDisType("Point");
108 theSingleParticleSource->GetAngDist()->SetAngDistType("planar");
109}
void DefinePhysicalVolume1(const G4String &aName)

Referenced by G4AdjointPrimaryGeneratorAction::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume().

◆ SetSphericalAdjointPrimarySource()

void G4AdjointPrimaryGenerator::SetSphericalAdjointPrimarySource ( G4double  radius,
G4ThreeVector  pos 
)

Definition at line 88 of file G4AdjointPrimaryGenerator.cc.

89{
90 radius_spherical_source = radius;
91 center_spherical_source = center_pos;
92 type_of_adjoint_source ="Spherical";
93 theSingleParticleSource->GetPosDist()->SetPosDisType("Surface");
94 theSingleParticleSource->GetPosDist()->SetPosDisShape("Sphere");
95 theSingleParticleSource->GetPosDist()->SetCentreCoords(center_pos);
96 theSingleParticleSource->GetPosDist()->SetRadius(radius);
97 theSingleParticleSource->GetAngDist()->SetAngDistType("cos");
98 theSingleParticleSource->GetAngDist()->SetMaxTheta(pi);
99 theSingleParticleSource->GetAngDist()->SetMinTheta(halfpi);
100}

Referenced by G4AdjointPrimaryGeneratorAction::SetSphericalAdjointPrimarySource().


The documentation for this class was generated from the following files: