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

A halo distribution based on both twiss parameters and sigmas. More...

#include <BDSBunchHalo.hh>

Inheritance diagram for BDSBunchHalo:
Inheritance graph
Collaboration diagram for BDSBunchHalo:
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 ()
 
BDSBunchHalooperator= (const BDSBunchHalo &)=delete
 Assignment and copy constructor not implemented nor used.
 
 BDSBunchHalo (BDSBunchHalo &)=delete
 Assignment and copy constructor not implemented nor used.
 
- 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
 

Private Attributes

G4double haloNSigmaXInner
 
G4double haloNSigmaXOuter
 
G4double haloNSigmaYInner
 
G4double haloNSigmaYOuter
 
G4double haloXCutInner
 
G4double haloYCutInner
 
G4double haloXCutOuter
 
G4double haloYCutOuter
 
G4double haloXpCutInner
 
G4double haloYpCutInner
 
G4double haloXpCutOuter
 
G4double haloYpCutOuter
 
G4double haloPSWeightParameter
 
G4String weightFunction
 
G4double emitInnerX
 
G4double emitInnerY
 
G4double emitOuterX
 
G4double emitOuterY
 
G4double xMax
 
G4double yMax
 
G4double xpMax
 
G4double ypMax
 
CLHEP::RandFlat * flatGen
 
G4double alphaX
 Twiss parameter. More...
 
G4double alphaY
 Twiss parameter. More...
 
G4double betaX
 Twiss parameter. More...
 
G4double betaY
 Twiss parameter. More...
 
G4double emitX
 Twiss parameter. More...
 
G4double emitY
 Twiss parameter. More...
 
G4double gammaX
 Twiss parameter. More...
 
G4double gammaY
 Twiss parameter. More...
 
G4double sigmaX
 Twiss parameter. More...
 
G4double sigmaY
 Twiss parameter. More...
 
G4double sigmaXp
 Twiss parameter. More...
 
G4double sigmaYp
 Twiss parameter. 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...
 
- 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...
 

Detailed Description

A halo distribution based on both twiss parameters and sigmas.

Author
Stewart Boogert, Simon Williams

Definition at line 34 of file BDSBunchHalo.hh.

Constructor & Destructor Documentation

◆ BDSBunchHalo()

BDSBunchHalo::BDSBunchHalo ( )

Definition at line 34 of file BDSBunchHalo.cc.

◆ ~BDSBunchHalo()

BDSBunchHalo::~BDSBunchHalo ( )
virtual

Definition at line 62 of file BDSBunchHalo.cc.

Member Function Documentation

◆ CheckParameters()

void BDSBunchHalo::CheckParameters ( )
virtual

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

Reimplemented from BDSBunch.

Definition at line 211 of file BDSBunchHalo.cc.

References betaX, betaY, BDSBunch::CheckParameters(), emitX, and emitY.

Referenced by SetOptions().

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

◆ GetNextParticleLocal()

BDSParticleCoordsFull BDSBunchHalo::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 116 of file BDSBunchHalo.cc.

References alphaX, alphaY, betaX, betaY, BDSBunch::CalculateZp(), BDSBunch::E0, emitX, emitY, gammaX, gammaY, BDSBunch::S0, sigmaX, sigmaXp, sigmaY, sigmaYp, 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 BDSBunchHalo::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 67 of file BDSBunchHalo.cc.

References GMAD::BeamBase::alfx, GMAD::BeamBase::alfy, alphaX, alphaY, betaX, betaY, GMAD::BeamBase::betx, GMAD::BeamBase::bety, CheckParameters(), emitX, emitY, gammaX, gammaY, GMAD::BeamBase::haloNSigmaXInner, GMAD::BeamBase::haloNSigmaXOuter, GMAD::BeamBase::haloNSigmaYInner, GMAD::BeamBase::haloNSigmaYOuter, GMAD::BeamBase::haloPSWeightFunction, GMAD::BeamBase::haloPSWeightParameter, GMAD::BeamBase::haloXCutInner, GMAD::BeamBase::haloXCutOuter, GMAD::BeamBase::haloXpCutInner, GMAD::BeamBase::haloXpCutOuter, GMAD::BeamBase::haloYCutInner, GMAD::BeamBase::haloYCutOuter, GMAD::BeamBase::haloYpCutInner, GMAD::BeamBase::haloYpCutOuter, BDSBunch::SetEmittances(), BDSBunch::SetOptions(), sigmaX, sigmaXp, sigmaY, and sigmaYp.

Here is the call graph for this function:

Field Documentation

◆ alphaX

G4double BDSBunchHalo::alphaX
private

Twiss parameter.

Definition at line 53 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ alphaY

G4double BDSBunchHalo::alphaY
private

Twiss parameter.

Definition at line 54 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ betaX

G4double BDSBunchHalo::betaX
private

Twiss parameter.

Definition at line 55 of file BDSBunchHalo.hh.

Referenced by CheckParameters(), GetNextParticleLocal(), and SetOptions().

◆ betaY

G4double BDSBunchHalo::betaY
private

Twiss parameter.

Definition at line 56 of file BDSBunchHalo.hh.

Referenced by CheckParameters(), GetNextParticleLocal(), and SetOptions().

◆ emitInnerX

G4double BDSBunchHalo::emitInnerX
private

Definition at line 82 of file BDSBunchHalo.hh.

◆ emitInnerY

G4double BDSBunchHalo::emitInnerY
private

Definition at line 83 of file BDSBunchHalo.hh.

◆ emitOuterX

G4double BDSBunchHalo::emitOuterX
private

Definition at line 84 of file BDSBunchHalo.hh.

◆ emitOuterY

G4double BDSBunchHalo::emitOuterY
private

Definition at line 85 of file BDSBunchHalo.hh.

◆ emitX

G4double BDSBunchHalo::emitX
private

Twiss parameter.

Definition at line 57 of file BDSBunchHalo.hh.

Referenced by CheckParameters(), GetNextParticleLocal(), and SetOptions().

◆ emitY

G4double BDSBunchHalo::emitY
private

Twiss parameter.

Definition at line 58 of file BDSBunchHalo.hh.

Referenced by CheckParameters(), GetNextParticleLocal(), and SetOptions().

◆ flatGen

CLHEP::RandFlat* BDSBunchHalo::flatGen
private

Definition at line 92 of file BDSBunchHalo.hh.

◆ gammaX

G4double BDSBunchHalo::gammaX
private

Twiss parameter.

Definition at line 59 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ gammaY

G4double BDSBunchHalo::gammaY
private

Twiss parameter.

Definition at line 60 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ haloNSigmaXInner

G4double BDSBunchHalo::haloNSigmaXInner
private

Definition at line 67 of file BDSBunchHalo.hh.

◆ haloNSigmaXOuter

G4double BDSBunchHalo::haloNSigmaXOuter
private

Definition at line 68 of file BDSBunchHalo.hh.

◆ haloNSigmaYInner

G4double BDSBunchHalo::haloNSigmaYInner
private

Definition at line 69 of file BDSBunchHalo.hh.

◆ haloNSigmaYOuter

G4double BDSBunchHalo::haloNSigmaYOuter
private

Definition at line 70 of file BDSBunchHalo.hh.

◆ haloPSWeightParameter

G4double BDSBunchHalo::haloPSWeightParameter
private

Definition at line 79 of file BDSBunchHalo.hh.

◆ haloXCutInner

G4double BDSBunchHalo::haloXCutInner
private

Definition at line 71 of file BDSBunchHalo.hh.

◆ haloXCutOuter

G4double BDSBunchHalo::haloXCutOuter
private

Definition at line 73 of file BDSBunchHalo.hh.

◆ haloXpCutInner

G4double BDSBunchHalo::haloXpCutInner
private

Definition at line 75 of file BDSBunchHalo.hh.

◆ haloXpCutOuter

G4double BDSBunchHalo::haloXpCutOuter
private

Definition at line 77 of file BDSBunchHalo.hh.

◆ haloYCutInner

G4double BDSBunchHalo::haloYCutInner
private

Definition at line 72 of file BDSBunchHalo.hh.

◆ haloYCutOuter

G4double BDSBunchHalo::haloYCutOuter
private

Definition at line 74 of file BDSBunchHalo.hh.

◆ haloYpCutInner

G4double BDSBunchHalo::haloYpCutInner
private

Definition at line 76 of file BDSBunchHalo.hh.

◆ haloYpCutOuter

G4double BDSBunchHalo::haloYpCutOuter
private

Definition at line 78 of file BDSBunchHalo.hh.

◆ sigmaX

G4double BDSBunchHalo::sigmaX
private

Twiss parameter.

Definition at line 61 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ sigmaXp

G4double BDSBunchHalo::sigmaXp
private

Twiss parameter.

Definition at line 63 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ sigmaY

G4double BDSBunchHalo::sigmaY
private

Twiss parameter.

Definition at line 62 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ sigmaYp

G4double BDSBunchHalo::sigmaYp
private

Twiss parameter.

Definition at line 64 of file BDSBunchHalo.hh.

Referenced by GetNextParticleLocal(), and SetOptions().

◆ weightFunction

G4String BDSBunchHalo::weightFunction
private

Definition at line 80 of file BDSBunchHalo.hh.

◆ xMax

G4double BDSBunchHalo::xMax
private

Definition at line 87 of file BDSBunchHalo.hh.

◆ xpMax

G4double BDSBunchHalo::xpMax
private

Definition at line 89 of file BDSBunchHalo.hh.

◆ yMax

G4double BDSBunchHalo::yMax
private

Definition at line 88 of file BDSBunchHalo.hh.

◆ ypMax

G4double BDSBunchHalo::ypMax
private

Definition at line 90 of file BDSBunchHalo.hh.


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