#include <PrimaryGeneratorAction2.hh>
Definition at line 47 of file PrimaryGeneratorAction2.hh.
◆ PrimaryGeneratorAction2()
PrimaryGeneratorAction2::PrimaryGeneratorAction2 |
( |
G4ParticleGun * |
gun | ) |
|
◆ ~PrimaryGeneratorAction2()
PrimaryGeneratorAction2::~PrimaryGeneratorAction2 |
( |
| ) |
|
◆ GeneratePrimaries()
void PrimaryGeneratorAction2::GeneratePrimaries |
( |
G4Event * |
anEvent | ) |
|
Definition at line 63 of file PrimaryGeneratorAction2.cc.
67 G4double sinAlpha = std::sqrt(1. - cosAlpha*cosAlpha);
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
G4ParticleGun * particleGun
virtual void GeneratePrimaryVertex(G4Event *evt)
static const double twopi
void SetParticleEnergy(G4double aKineticEnergy)
◆ InitFunction()
void PrimaryGeneratorAction2::InitFunction |
( |
| ) |
|
|
private |
Definition at line 85 of file PrimaryGeneratorAction2.cc.
96 { 0.000, 0.077, 0.380, 2.044, 5.535, 15.077, 12.443, 14.766,
97 17.644, 18.518, 17.772, 14.776, 8.372, 3.217, 0.194, 0.000 };
104 x[j] = xx[j];
f[j] = ff[j];
111 for (
G4int j=0; j<nPoints-1; j++) {
112 a[j] = (
f[j+1] -
f[j])/(
x[j+1] -
x[j]);
120 Fc[j] =
Fc[j-1] + 0.5*(
f[j] +
f[j-1])*(
x[j] -
x[j-1]);
std::vector< G4double > a
std::vector< G4double > x
std::vector< G4double > Fc
std::vector< G4double > f
◆ InverseCumul()
G4double PrimaryGeneratorAction2::InverseCumul |
( |
| ) |
|
Definition at line 148 of file PrimaryGeneratorAction2.cc.
158 while ((
Fc[j] > y_rndm) && (j > 0)) j--;
166 x_rndm += sign*std::sqrt(delta) -
b;
167 }
else if (
f[j] > 0.) {
168 x_rndm += (y_rndm -
Fc[j])/
f[j];
std::vector< G4double > a
std::vector< G4double > x
std::vector< G4double > Fc
std::vector< G4double > f
◆ RejectAccept()
G4double PrimaryGeneratorAction2::RejectAccept |
( |
| ) |
|
Definition at line 126 of file PrimaryGeneratorAction2.cc.
131 G4double x_rndm = 0., y_rndm = 0., f_inter = -1.;
133 while (y_rndm > f_inter) {
139 while ((
x[j] > x_rndm) && (j > 0)) j--;
141 f_inter =
f[j] +
a[j]*(x_rndm -
x[j]);
std::vector< G4double > a
std::vector< G4double > x
std::vector< G4double > f
std::vector<G4double> PrimaryGeneratorAction2::a |
|
private |
std::vector<G4double> PrimaryGeneratorAction2::f |
|
private |
◆ Fc
std::vector<G4double> PrimaryGeneratorAction2::Fc |
|
private |
◆ fMax
◆ nPoints
G4int PrimaryGeneratorAction2::nPoints |
|
private |
◆ particleGun
std::vector<G4double> PrimaryGeneratorAction2::x |
|
private |
The documentation for this class was generated from the following files: