43 #include "PrimaryGeneratorAction.hh"
44 #include "DetectorConstruction.hh"
45 #include "PrimaryGeneratorMessenger.hh"
65 void PrimaryGeneratorAction::InitializeMe()
78 fRMax2 = 2.5*2.5*
mm*
mm;
111 if(0.0 < fSigmaX) { x = G4RandGauss::shoot(fX0,fSigmaX); }
112 if(0.0 < fSigmaY) { y = G4RandGauss::shoot(fY0,fSigmaY); }
113 }
while (x*x + y*y > fRMax2);
124 if(1.0 > fMinCosTheta) {
126 ux = std::sqrt((1.0 - uz)*(1.0 + uz)) ;
127 }
else if (fSigmaTheta > 0.0) {
128 ux = G4RandGauss::shoot(0.0,fSigmaTheta);
129 uz = std::sqrt((1.0 - ux)*(1.0 + ux));
134 ux *= std::cos(phi) ;
135 uy *= std::sin(phi) ;
143 if(fGauss ==
"flatE") {
145 }
else if(0.0 < fSigmaE) {
146 kinEnergy = fEnergy + G4RandGauss::shoot(0.0,fSigmaE);
153 G4cout <<
"Event# " << fCounter
154 <<
" Beam particle is generated by PrimaryGeneratorAction "
156 G4cout <<
"ParticleName= " << particleName
158 << std::setprecision(5)
159 <<
" KinEnergy(GeV)= "