BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
BDSBunchSlowExt Class Reference

A bunch distribution with a linear sweep in momentum in time. More...

#include <BDSBunchSlowExt.hh>

Inheritance diagram for BDSBunchSlowExt:
Inheritance graph
Collaboration diagram for BDSBunchSlowExt:
Collaboration graph

Public Member Functions

virtual void SetOptions (const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const BDSBunchType &distrType, G4Transform3D beamlineTransformIn=G4Transform3D::Identity, const G4double beamlineS=0)
 
virtual void CheckParameters ()
 
virtual BDSParticleCoordsFull GetNextParticleLocal ()
 
void GetDeltas (G4double &dt, G4double &dE) const
 
BDSBunchSlowExtoperator= (const BDSBunchSlowExt &)=delete
 Assignment and copy constructor not implemented nor used.
 
 BDSBunchSlowExt (BDSBunchSlowExt &)=delete
 Assignment and copy constructor not implemented nor used.
 
- Public Member Functions inherited from BDSBunch
 BDSBunch (const G4String &nameIn)
 
virtual void Initialise ()
 Any initialisation - to be used after SetOptions, then CheckParameters.
 
BDSParticleCoordsFullGlobal GetNextParticle ()
 
virtual G4bool ExpectChangingParticleType () const
 A hint of whether we expect to require and extended particle set (ie pions, kaons, muons).
 
virtual BDSParticleCoordsFullGlobal GetNextParticleValid (G4int maxTries=100)
 
virtual void BeginOfRunAction (G4int numberOfEvents, G4bool batchMode)
 
virtual const BDSParticleDefinitionParticleDefinition () const
 Access the beam particle definition.
 
virtual void SetGeneratePrimariesOnly (G4bool generatePrimariesOnlyIn)
 
G4bool UseCurvilinearTransform () const
 Access whether there's a finite S offset and therefore we're using a CL transform.
 
virtual void RecreateAdvanceToEvent (G4int eventOffset)
 
G4bool BeamParticleIsAnIon () const
 Access whether the beam particle is an ion or not.
 
virtual void UpdateIonDefinition ()
 
G4bool ParticleDefinitionHasBeenUpdated () const
 
G4String Name () const
 Distribution name.
 
G4int CurrentBunchIndex () const
 Get the current bunch index for writing to output.
 
void CalculateBunchIndex (G4int eventIndex)
 Calculate which bunch index we should be at given an event index.
 

Protected Attributes

G4double dTStart
 
G4double dTStop
 
G4double dPStart
 
G4double dPStop
 
G4bool applyGradient
 
G4double dT
 
G4double dEStart
 
G4double dE
 
- Protected Attributes inherited from BDSBunch
G4String name
 Name of distribution.
 
G4bool useCurvilinear
 Whether to ignore z and use s and transform for curvilinear coordinates.
 
BDSParticleDefinitionparticleDefinition
 Particle definition for bunch - this class owns it.
 
G4bool particleDefinitionHasBeenUpdated
 
G4bool finiteTilt
 
G4bool generatePrimariesOnly
 
G4double X0
 Centre of distributions.
 
G4double Y0
 Centre of distributions.
 
G4double Z0
 Centre of distributions.
 
G4double S0
 Centre of distributions.
 
G4double T0
 Centre of distributions.
 
G4double Xp0
 Centre of distributions.
 
G4double Yp0
 Centre of distributions.
 
G4double Zp0
 Centre of distributions.
 
G4double E0
 Centre of distributions.
 
G4double P0
 central momentum
 
G4double tilt
 Centre of distributions.
 
G4double sigmaT
 Centre of distributions.
 
G4double sigmaP
 Centre of distributions.
 
G4double sigmaE
 Centre of distributions.
 
G4double sigmaEk
 Centre of distributions.
 
bool useBunchTiming
 Bunch offset in time parameters.
 
G4int currentBunchIndex
 Bunch offset in time parameters.
 
G4int eventsPerBunch
 Bunch offset in time parameters.
 
G4double bunchPeriod
 Bunch offset in time parameters.
 
G4bool finiteSigmaE
 Flags to ignore random number generator in case of no finite E or T.
 
G4bool finiteSigmaT
 Flags to ignore random number generator in case of no finite E or T.
 

Additional Inherited Members

- Static Public Member Functions inherited from BDSBunch
static G4double CalculateZp (G4double xp, G4double yp, G4double Zp0)
 Calculate zp safely based on other components.
 
static void SetEmittances (const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, G4double &emittGeometricX, G4double &emittGeometricY, G4double &emittNormalisedX, G4double &emittNormalisedY)
 
- Protected Member Functions inherited from BDSBunch
BDSParticleCoordsFullGlobal ApplyTransform (const BDSParticleCoordsFull &localIn) const
 
void ApplyTilt (BDSParticleCoordsFull &localIn) const
 Apply a rotation about unitZ for the local coordinates according to member variable tilt.
 
void ApplyBunchTiming (BDSParticleCoordsFullGlobal &localIn) const
 Add on the offset in T for the current bunch number (i*bunchPeriod).
 
BDSParticleCoordsFullGlobal ApplyCurvilinearTransform (const BDSParticleCoordsFull &localIn) const
 Calculate the global coordinates from curvilinear coordinates of a beam line.
 

Detailed Description

A bunch distribution with a linear sweep in momentum in time.

Represents slow extraction beams.

Author
Laurie Nevay

Definition at line 32 of file BDSBunchSlowExt.hh.

Constructor & Destructor Documentation

◆ BDSBunchSlowExt()

BDSBunchSlowExt::BDSBunchSlowExt ( )

Definition at line 33 of file BDSBunchSlowExt.cc.

◆ ~BDSBunchSlowExt()

BDSBunchSlowExt::~BDSBunchSlowExt ( )
virtual

Definition at line 45 of file BDSBunchSlowExt.cc.

Member Function Documentation

◆ CheckParameters()

void BDSBunchSlowExt::CheckParameters ( )
virtual

Check the parameters for the given bunch distribution and exit if they're problematic or unphysical.

Reimplemented from BDSBunch.

Definition at line 80 of file BDSBunchSlowExt.cc.

References BDSBunch::CheckParameters().

Referenced by BDSBunchGaussSlowExtBase::CheckParameters().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDeltas()

void BDSBunchSlowExt::GetDeltas ( G4double &  dt,
G4double &  dE 
) const

Generate the random shift for this call. This function is const but it advances the static (global) random number generator.

Definition at line 100 of file BDSBunchSlowExt.cc.

Referenced by BDSBunchGaussSlowExtBase::GetNextParticleLocal(), and GetNextParticleLocal().

Here is the caller graph for this function:

◆ GetNextParticleLocal()

BDSParticleCoordsFull BDSBunchSlowExt::GetNextParticleLocal ( )
virtual

Each derived class can override this default method of reference position. If S0 > 0 or derived class changes member bool 'curvilinear' z0 will be treated as S and the global z0 be calculated.

Reimplemented from BDSBunch.

Definition at line 87 of file BDSBunchSlowExt.cc.

References BDSBunch::E0, GetDeltas(), BDSBunch::GetNextParticleLocal(), BDSBunch::S0, BDSBunch::T0, BDSBunch::X0, BDSBunch::Xp0, BDSBunch::Y0, BDSBunch::Yp0, BDSBunch::Z0, and BDSBunch::Zp0.

Here is the call graph for this function:

◆ SetOptions()

void BDSBunchSlowExt::SetOptions ( const BDSParticleDefinition beamParticle,
const GMAD::Beam beam,
const BDSBunchType distrType,
G4Transform3D  beamlineTransformIn = G4Transform3D::Identity,
const G4double  beamlineS = 0 
)
virtual

Extract and set the relevant options from the beam definition. The distribution type is explicitly required as this function may be used inside a nested bunch distribution. This argument is for the most part ignored, but there's no way to have a default for it. Also, some classes can cover multiple input distributions so need to know which one they're meant to be.

Reimplemented from BDSBunch.

Definition at line 48 of file BDSBunchSlowExt.cc.

References GMAD::BeamBase::dPStart, GMAD::BeamBase::dPStop, GMAD::BeamBase::dTStart, GMAD::BeamBase::dTStop, BDSBunch::E0, BDS::IsFinite(), BDSBunch::P0, BDSBunch::particleDefinition, and BDSBunch::SetOptions().

Referenced by BDSBunchGaussSlowExtBase::SetOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ applyGradient

G4bool BDSBunchSlowExt::applyGradient
protected

Definition at line 58 of file BDSBunchSlowExt.hh.

◆ dE

G4double BDSBunchSlowExt::dE
protected

Definition at line 61 of file BDSBunchSlowExt.hh.

◆ dEStart

G4double BDSBunchSlowExt::dEStart
protected

Definition at line 60 of file BDSBunchSlowExt.hh.

◆ dPStart

G4double BDSBunchSlowExt::dPStart
protected

Definition at line 56 of file BDSBunchSlowExt.hh.

◆ dPStop

G4double BDSBunchSlowExt::dPStop
protected

Definition at line 57 of file BDSBunchSlowExt.hh.

◆ dT

G4double BDSBunchSlowExt::dT
protected

Definition at line 59 of file BDSBunchSlowExt.hh.

◆ dTStart

G4double BDSBunchSlowExt::dTStart
protected

Definition at line 54 of file BDSBunchSlowExt.hh.

◆ dTStop

G4double BDSBunchSlowExt::dTStop
protected

Definition at line 55 of file BDSBunchSlowExt.hh.


The documentation for this class was generated from the following files: