BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Protected Attributes
BDSBunchComposite Class Reference

A distribution that allows mixing of three different distributions in each primary dimension. More...

#include <BDSBunchComposite.hh>

Inheritance diagram for BDSBunchComposite:
Inheritance graph
Collaboration diagram for BDSBunchComposite:
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 void SetGeneratePrimariesOnly (G4bool generatePrimariesOnlyIn)
 
virtual BDSParticleCoordsFull GetNextParticleLocal ()
 
- Public Member Functions inherited from BDSBunch
 BDSBunch (const G4String &nameIn)
 
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 void Initialise ()
 Any initialisation - to be used after SetOptions, then CheckParameters. More...
 
BDSParticleCoordsFullGlobal GetNextParticle ()
 
virtual G4bool ExpectChangingParticleType () const
 A hint of whether we expect to require and extended particle set (ie pions, kaons, muons). More...
 
virtual BDSParticleCoordsFullGlobal GetNextParticleValid (G4int maxTries=100)
 
virtual void BeginOfRunAction (G4int numberOfEvents)
 
virtual const BDSParticleDefinitionParticleDefinition () const
 Access the beam particle definition. More...
 
virtual void SetGeneratePrimariesOnly (G4bool generatePrimariesOnlyIn)
 
virtual BDSParticleCoordsFull GetNextParticleLocal ()
 
G4bool UseCurvilinearTransform () const
 Access whether there's a finite S offset and therefore we're using a CL transform. More...
 
virtual void RecreateAdvanceToEvent (G4int)
 
G4bool BeamParticleIsAnIon () const
 Access whether the beam particle is an ion or not. More...
 
virtual void UpdateIonDefinition ()
 
G4bool ParticleDefinitionHasBeenUpdated () const
 
G4String Name () const
 

Protected Attributes

BDSBunchxBunch
 
BDSBunchyBunch
 
BDSBunchzBunch
 
- Protected Attributes inherited from BDSBunch
G4String name
 Name of distribution. More...
 
G4bool useCurvilinear
 Whether to ignore z and use s and transform for curvilinear coordinates. More...
 
BDSParticleDefinitionparticleDefinition
 Particle definition for bunch - this class owns it. More...
 
G4bool particleDefinitionHasBeenUpdated
 
G4bool finiteTilt
 
G4bool generatePrimariesOnly
 
G4double X0
 Centre of distributions. More...
 
G4double Y0
 Centre of distributions. More...
 
G4double Z0
 Centre of distributions. More...
 
G4double S0
 Centre of distributions. More...
 
G4double T0
 Centre of distributions. More...
 
G4double Xp0
 Centre of distributions. More...
 
G4double Yp0
 Centre of distributions. More...
 
G4double Zp0
 Centre of distributions. More...
 
G4double E0
 Centre of distributions. More...
 
G4double P0
 central momentum More...
 
G4double tilt
 Centre of distributions. More...
 
G4double sigmaT
 Centre of distributions. More...
 
G4double sigmaP
 Centre of distributions. More...
 
G4double sigmaE
 Centre of distributions. More...
 
G4double sigmaEk
 Centre of distributions. More...
 
G4bool finiteSigmaE
 Flags to ignore random number generator in case of no finite E or T. More...
 
G4bool finiteSigmaT
 Flags to ignore random number generator in case of no finite E or T. More...
 

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. More...
 
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. More...
 
BDSParticleCoordsFullGlobal ApplyCurvilinearTransform (const BDSParticleCoordsFull &localIn) const
 Calculate the global coordinates from curvilinear coordinates of a beam line. More...
 

Detailed Description

A distribution that allows mixing of three different distributions in each primary dimension.

Author
Stewart Boogert

Definition at line 33 of file BDSBunchComposite.hh.

Constructor & Destructor Documentation

◆ BDSBunchComposite()

BDSBunchComposite::BDSBunchComposite ( )

Definition at line 28 of file BDSBunchComposite.cc.

◆ ~BDSBunchComposite()

BDSBunchComposite::~BDSBunchComposite ( )
virtual

Definition at line 35 of file BDSBunchComposite.cc.

Member Function Documentation

◆ CheckParameters()

void BDSBunchComposite::CheckParameters ( )
virtual

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

Reimplemented from BDSBunch.

Definition at line 91 of file BDSBunchComposite.cc.

References BDSBunch::CheckParameters().

Here is the call graph for this function:

◆ GetNextParticleLocal()

BDSParticleCoordsFull BDSBunchComposite::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 98 of file BDSBunchComposite.cc.

References BDSBunch::GetNextParticleLocal(), BDSBunch::ParticleDefinitionHasBeenUpdated(), and BDSBunch::particleDefinitionHasBeenUpdated.

Here is the call graph for this function:

◆ SetGeneratePrimariesOnly()

void BDSBunchComposite::SetGeneratePrimariesOnly ( G4bool  generatePrimariesOnlyIn)
virtual

Set the flag to whether we're only generating primaries only. This sets the member variable generatePrimariesOnly which skips trying to perform a curvilinear transform if true. i.e. if we're generating primaries only, there's no beam line.

Reimplemented from BDSBunch.

Definition at line 83 of file BDSBunchComposite.cc.

References BDSBunch::SetGeneratePrimariesOnly().

Here is the call graph for this function:

◆ SetOptions()

void BDSBunchComposite::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 42 of file BDSBunchComposite.cc.

References BDSBunchFactory::CreateBunch(), BDS::DetermineBunchType(), BDSBunch::name, BDSBunch::SetOptions(), GMAD::BeamBase::xDistrType, GMAD::BeamBase::yDistrType, and GMAD::BeamBase::zDistrType.

Here is the call graph for this function:

Field Documentation

◆ xBunch

BDSBunch* BDSBunchComposite::xBunch
protected

Definition at line 49 of file BDSBunchComposite.hh.

◆ yBunch

BDSBunch* BDSBunchComposite::yBunch
protected

Definition at line 50 of file BDSBunchComposite.hh.

◆ zBunch

BDSBunch* BDSBunchComposite::zBunch
protected

Definition at line 51 of file BDSBunchComposite.hh.


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