36 #include "PrimaryGeneratorAction.hh"
67 G4double sinAlpha = std::sqrt(1. - cosAlpha*cosAlpha);
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 fX[j] = xx[j];
fY[j] = yy[j];
110 fSlp.resize(fNPoints);
111 for (
G4int j=0; j<fNPoints-1; j++) {
117 fYC.resize(fNPoints);
131 G4double Xrndm = 0., Yrndm = 0., Yinter = -1.;
133 while (Yrndm > Yinter) {
139 while ((
fX[j] > Xrndm) && (j > 0)) j--;
141 Yinter =
fY[j] +
fSlp[j]*(Xrndm -
fX[j]);
158 while ((
fYC[j] > Yrndm) && (j > 0)) j--;
166 Xrndm += sign*std::sqrt(delta) - b;
167 }
else if (
fY[j] > 0.) {
168 Xrndm += (Yrndm -
fYC[j])/
fY[j];
G4ParticleGun * fParticleGun
std::vector< ExP01TrackerHit * > a
static constexpr double keV
std::vector< G4double > fY
void GeneratePrimaries(G4Event *)
std::vector< G4double > fYC
static constexpr double twopi
Definition of the PrimaryGeneratorAction2 class.
std::vector< G4double > fX
std::vector< G4double > fSlp
virtual void GeneratePrimaryVertex(G4Event *evt)
void SetParticleEnergy(G4double aKineticEnergy)
~PrimaryGeneratorAction2()
PrimaryGeneratorAction2(G4ParticleGun *)
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)