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

#include <G4DipBustGenerator.hh>

+ Inheritance diagram for G4DipBustGenerator:

Public Member Functions

 G4DipBustGenerator (const G4String &name="")
 
virtual ~G4DipBustGenerator ()
 
virtual G4ThreeVectorSampleDirection (const G4DynamicParticle *dp, G4double out_energy, G4int Z, const G4Material *mat=0)
 
G4double PolarAngle (const G4double initial_energy, const G4double final_energy, const G4int Z)
 
void PrintGeneratorInformation () const
 
- Public Member Functions inherited from G4VEmAngularDistribution
 G4VEmAngularDistribution (const G4String &name)
 
virtual ~G4VEmAngularDistribution ()
 
virtual G4ThreeVectorSampleDirection (const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
 
const G4StringGetName () const
 

Additional Inherited Members

- Protected Attributes inherited from G4VEmAngularDistribution
G4ThreeVector fLocalDirection
 

Detailed Description

Definition at line 55 of file G4DipBustGenerator.hh.

Constructor & Destructor Documentation

◆ G4DipBustGenerator()

G4DipBustGenerator::G4DipBustGenerator ( const G4String name = "")

Definition at line 57 of file G4DipBustGenerator.cc.

◆ ~G4DipBustGenerator()

G4DipBustGenerator::~G4DipBustGenerator ( )
virtual

Definition at line 61 of file G4DipBustGenerator.cc.

62{}

Member Function Documentation

◆ PolarAngle()

G4double G4DipBustGenerator::PolarAngle ( const G4double  initial_energy,
const G4double  final_energy,
const G4int  Z 
)

Definition at line 103 of file G4DipBustGenerator.cc.

106{
107 G4double c, cosTheta, delta, cofA, signc = 1., a, power = 1./3.;
108 G4double gamma, beta, theta;
109
110 c = 4. - 8.*G4UniformRand();
111 a = c;
112
113 if( c < 0. )
114 {
115 signc = -1.;
116 a = -c;
117 }
118 delta = std::sqrt(a*a+4.);
119 delta += a;
120 delta *= 0.5;
121
122 cofA = -signc*std::pow(delta, power);
123
124 cosTheta = cofA - 1./cofA;
125
126 gamma = 1. + eTkin/electron_mass_c2;
127 beta = std::sqrt(1. - 1./gamma/gamma);
128
129 cosTheta = (cosTheta + beta)/(1 + cosTheta*beta);
130
131 theta = std::acos(cosTheta);
132
133 if( theta < 0. ) theta = 0.;
134 if( theta > pi ) theta = pi;
135 // G4cout <<"theta = "<<theta<<"; ";
136
137 return theta;
138}
double G4double
Definition: G4Types.hh:64
#define G4UniformRand()
Definition: Randomize.hh:53
const G4double pi

◆ PrintGeneratorInformation()

void G4DipBustGenerator::PrintGeneratorInformation ( ) const

Definition at line 140 of file G4DipBustGenerator.cc.

141{
142 G4cout << "\n" << G4endl;
143 G4cout << "Angular Generator based on classical formula from" << G4endl;
144 G4cout << "J.D. Jackson, Classical Electrodynamics, Wiley, New York 1975"
145 << G4endl;
146}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

◆ SampleDirection()

G4ThreeVector & G4DipBustGenerator::SampleDirection ( const G4DynamicParticle dp,
G4double  out_energy,
G4int  Z,
const G4Material mat = 0 
)
virtual

Implements G4VEmAngularDistribution.

Definition at line 65 of file G4DipBustGenerator.cc.

67{
68 G4double c, cosTheta, delta, cofA, signc = 1., a, power = 1./3.;
69
70 G4double eTkin = dp->GetKineticEnergy();
71
72 c = 4. - 8.*G4UniformRand();
73 a = c;
74
75 if( c < 0. )
76 {
77 signc = -1.;
78 a = -c;
79 }
80 delta = std::sqrt(a*a+4.);
81 delta += a;
82 delta *= 0.5;
83
84 cofA = -signc*std::pow(delta, power);
85
86 cosTheta = cofA - 1./cofA;
87
88 G4double tau = eTkin/electron_mass_c2;
89 G4double beta = std::sqrt(tau*(tau + 2.))/(tau + 1.);
90
91 cosTheta = (cosTheta + beta)/(1 + cosTheta*beta);
92
93 G4double sinTheta = std::sqrt((1 - cosTheta)*(1 + cosTheta));
94 G4double phi = twopi*G4UniformRand();
95
96 fLocalDirection.set(sinTheta*std::cos(phi), sinTheta*std::sin(phi),cosTheta);
98
99 return fLocalDirection;
100
101}
void set(double x, double y, double z)
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:72
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const

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