19#include "BDSBunchSquare.hh"
21#include "BDSException.hh"
22#include "BDSParticleCoordsFull.hh"
24#include "parser/beam.h"
26#include "Randomize.hh"
27#include "CLHEP/Units/PhysicalConstants.h"
29BDSBunchSquare::BDSBunchSquare():
38 correlatedZWithT(false)
41BDSBunchSquare::~BDSBunchSquare()
47 G4Transform3D beamlineTransformIn,
48 const G4double beamlineSIn)
58 correlatedZWithT = beam.
zFromT;
82 G4double x =
X0 + envelopeX * (1-2*G4RandFlat::shoot());
83 G4double y =
Y0 + envelopeY * (1-2*G4RandFlat::shoot());
84 G4double xp =
Xp0 + envelopeXp * (1-2*G4RandFlat::shoot());
85 G4double yp =
Yp0 + envelopeYp * (1-2*G4RandFlat::shoot());
87 G4double dt = envelopeT * (1.-2.*G4RandFlat::shoot());
91 {dz = dt * CLHEP::c_light;}
93 {dz = envelopeZ * (1.-2*G4RandFlat::shoot());}
96 G4double E =
E0 + envelopeE * (1 - 2*G4RandFlat::shoot());
virtual BDSParticleCoordsFull GetNextParticleLocal()
virtual void SetOptions(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const BDSBunchType &distrType, G4Transform3D beamlineTransformIn=G4Transform3D::Identity, const G4double beamlineS=0)
virtual void CheckParameters()
The base class for bunch distribution generators.
G4double Yp0
Centre of distributions.
G4double T0
Centre of distributions.
G4double S0
Centre of distributions.
G4double Z0
Centre of distributions.
G4double X0
Centre of distributions.
G4double Zp0
Centre of distributions.
G4double Xp0
Centre of distributions.
G4double E0
Centre of distributions.
G4double Y0
Centre of distributions.
virtual void SetOptions(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const BDSBunchType &distrType, G4Transform3D beamlineTransformIn=G4Transform3D::Identity, const G4double beamlineS=0)
static G4double CalculateZp(G4double xp, G4double yp, G4double Zp0)
Calculate zp safely based on other components.
virtual void CheckParameters()
General exception with possible name of object and message.
A set of particle coordinates including energy and weight.
Wrapper for particle definition.
Improve type-safety of native enum data type in C++.
double envelopeZ
for the circle/square/box beam distribution
double envelopeE
for the circle/square/box beam distribution
double envelopeYp
for the circle/square/box beam distribution
bool zFromT
for the circle/square/box beam distribution
double envelopeX
for the circle/square/box beam distribution
double envelopeXp
for the circle/square/box beam distribution
double envelopeY
for the circle/square/box beam distribution
double envelopeT
for the circle/square/box beam distribution