22#include "BDSBunchType.hh"
23#include "BDSParticleCoords.hh"
24#include "BDSParticleCoordsFull.hh"
25#include "BDSParticleCoordsFullGlobal.hh"
26#include "BDSParticleDefinition.hh"
29#include "G4Transform3D.hh"
50 explicit BDSBunch(
const G4String& nameIn);
65 G4Transform3D beamlineTransformIn = G4Transform3D::Identity,
132 static G4double
CalculateZp(G4double xp, G4double yp, G4double
Zp0);
139 G4double& emittGeometricX,
140 G4double& emittGeometricY,
141 G4double& emittNormalisedX,
142 G4double& emittNormalisedY);
A vector of BDSBeamlineElement instances - a beamline.
The base class for bunch distribution generators.
BDSParticleCoordsFullGlobal ApplyCurvilinearTransform(const BDSParticleCoordsFull &localIn) const
Calculate the global coordinates from curvilinear coordinates of a beam line.
G4double mass2
Cache of mass squared as required to convert from p to E.
G4double sigmaE
Centre of distributions.
virtual void BeginOfRunAction(G4int numberOfEvents, G4bool batchMode)
const BDSBeamline * beamline
A reference to the fully constructed beamline that's lazily instantiated.
G4bool ParticleDefinitionHasBeenUpdated() const
virtual G4bool ExpectChangingParticleType() const
A hint of whether we expect to require and extended particle set (ie pions, kaons,...
bool useBunchTiming
Bunch offset in time parameters.
G4double Yp0
Centre of distributions.
G4double T0
Centre of distributions.
G4bool finiteSigmaE
Flags to ignore random number generator in case of no finite E or T.
G4double tilt
Centre of distributions.
BDSParticleCoordsFullGlobal ApplyTransform(const BDSParticleCoordsFull &localIn) const
virtual void RecreateAdvanceToEvent(G4int eventOffset)
void ApplyTilt(BDSParticleCoordsFull &localIn) const
Apply a rotation about unitZ for the local coordinates according to member variable tilt.
G4double S0
Centre of distributions.
G4int currentBunchIndex
Bunch offset in time parameters.
G4double P0
central momentum
G4bool particleDefinitionHasBeenUpdated
G4bool generatePrimariesOnly
virtual void SetGeneratePrimariesOnly(G4bool generatePrimariesOnlyIn)
G4double sigmaP
Centre of distributions.
G4bool useCurvilinear
Whether to ignore z and use s and transform for curvilinear coordinates.
G4Transform3D beamlineTransform
Transform that beam line starts with that will also be applied to coordinates.
void ApplyBunchTiming(BDSParticleCoordsFullGlobal &localIn) const
Add on the offset in T for the current bunch number (i*bunchPeriod).
G4double sigmaT
Centre of distributions.
G4double Z0
Centre of distributions.
virtual const BDSParticleDefinition * ParticleDefinition() const
Access the beam particle definition.
void CalculateBunchIndex(G4int eventIndex)
Calculate which bunch index we should be at given an event index.
virtual BDSParticleCoordsFull GetNextParticleLocal()
G4double bunchPeriod
Bunch offset in time parameters.
G4int CurrentBunchIndex() const
Get the current bunch index for writing to output.
G4double X0
Centre of distributions.
G4double Zp0
Centre of distributions.
G4bool BeamParticleIsAnIon() const
Access whether the beam particle is an ion or not.
virtual void Initialise()
Any initialisation - to be used after SetOptions, then CheckParameters.
G4double Xp0
Centre of distributions.
G4double E0
Centre of distributions.
G4double sigmaEk
Centre of distributions.
static void SetEmittances(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, G4double &emittGeometricX, G4double &emittGeometricY, G4double &emittNormalisedX, G4double &emittNormalisedY)
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)
G4String Name() const
Distribution name.
virtual void UpdateIonDefinition()
G4double beamlineS
Beamline initial S position.
BDSParticleCoordsFullGlobal GetNextParticle()
G4bool finiteSigmaT
Flags to ignore random number generator in case of no finite E or T.
static G4double CalculateZp(G4double xp, G4double yp, G4double Zp0)
Calculate zp safely based on other components.
BDSParticleDefinition * particleDefinition
Particle definition for bunch - this class owns it.
virtual BDSParticleCoordsFullGlobal GetNextParticleValid(G4int maxTries=100)
G4String name
Name of distribution.
G4int eventsPerBunch
Bunch offset in time parameters.
G4bool UseCurvilinearTransform() const
Access whether there's a finite S offset and therefore we're using a CL transform.
virtual void CheckParameters()
A set of particle coordinates in both local and global.
A set of particle coordinates including energy and weight.
Wrapper for particle definition.
G4bool IsAnIon() const
Accessor.
Loader to use any HepMC3 compatible file.
Loader to read a specific sampler from a BDSIM ROOT output file.
Improve type-safety of native enum data type in C++.
Parser namespace for GMAD language. Combination of Geant4 and MAD.