|
BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
A bunch distribution that holds a bunch from a Link. More...
#include <BDSLinkBunch.hh>


Public Member Functions | |
| virtual BDSParticleCoordsFull | GetNextParticleLocal () |
| Get the next particle. | |
| void | AddParticle (BDSParticleDefinition *particleDefinitionIn, const BDSParticleCoordsFull &coordsIn, int externalParticleID, int externalParentID) |
| Append particle to the bunch for tracking. | |
| void | ClearParticles () |
| Delete all particle objects in the bunch and clear the vector. | |
| virtual const BDSParticleDefinition * | ParticleDefinition () const |
| Access the current particle definition of the current particle in the bunch. | |
| void | UpdateGeant4ParticleDefinition (G4int pdgID) |
| TBC. | |
| virtual void | UpdateIonDefinition () |
| Override method in BDSBunch to use our local currentParticleDefinition member. | |
| size_t | Size () const |
| Accessor. | |
| int | CurrentExternalParticleID () const |
| Accessor. | |
| int | CurrentExternalParentID () const |
| Accessor. | |
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. | |
| 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 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. | |
| 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. | |
Private Attributes | |
| G4int | currentIndex |
| G4int | currentExternalParticleID |
| G4int | currentExternalParentID |
| BDSParticleDefinition * | currentParticleDefinition |
| G4int | size |
| Number of particles (1 counting). | |
| std::vector< BDSParticleExternal * > | particles |
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. | |
Protected Attributes inherited from BDSBunch | |
| G4String | name |
| Name of distribution. | |
| G4bool | useCurvilinear |
| Whether to ignore z and use s and transform for curvilinear coordinates. | |
| BDSParticleDefinition * | particleDefinition |
| 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. | |
A bunch distribution that holds a bunch from a Link.
Definition at line 36 of file BDSLinkBunch.hh.
| BDSLinkBunch::BDSLinkBunch | ( | ) |
Definition at line 33 of file BDSLinkBunch.cc.
|
virtual |
Definition at line 42 of file BDSLinkBunch.cc.
| void BDSLinkBunch::AddParticle | ( | BDSParticleDefinition * | particleDefinitionIn, |
| const BDSParticleCoordsFull & | coordsIn, | ||
| int | externalParticleID, | ||
| int | externalParentID | ||
| ) |
Append particle to the bunch for tracking.
Definition at line 68 of file BDSLinkBunch.cc.
References size.
| void BDSLinkBunch::ClearParticles | ( | ) |
Delete all particle objects in the bunch and clear the vector.
Definition at line 77 of file BDSLinkBunch.cc.
References size.
|
inline |
Accessor.
Definition at line 57 of file BDSLinkBunch.hh.
|
inline |
Accessor.
Definition at line 56 of file BDSLinkBunch.hh.
|
virtual |
Get the next particle.
Reimplemented from BDSBunch.
Definition at line 45 of file BDSLinkBunch.cc.
References BDSBunch::particleDefinitionHasBeenUpdated, size, and UpdateIonDefinition().

|
inlinevirtual |
Access the current particle definition of the current particle in the bunch.
Reimplemented from BDSBunch.
Definition at line 61 of file BDSLinkBunch.hh.
|
inline |
Accessor.
Definition at line 55 of file BDSLinkBunch.hh.
| void BDSLinkBunch::UpdateGeant4ParticleDefinition | ( | G4int | pdgID | ) |
TBC.
Definition at line 86 of file BDSLinkBunch.cc.
References BDSIonDefinition::A(), BDSIonDefinition::ExcitationEnergy(), BDS::FixGeant105ThreshholdsForParticle(), BDSParticleDefinition::IonDefinition(), BDSParticleDefinition::IsAnIon(), BDSBunch::particleDefinition, BDSParticleDefinition::UpdateG4ParticleDefinition(), and BDSIonDefinition::Z().

|
virtual |
Override method in BDSBunch to use our local currentParticleDefinition member.
Reimplemented from BDSBunch.
Definition at line 119 of file BDSLinkBunch.cc.
References BDSIonDefinition::A(), BDSIonDefinition::ExcitationEnergy(), BDS::FixGeant105ThreshholdsForParticle(), BDSParticleDefinition::IonDefinition(), BDSParticleDefinition::IsAnIon(), BDSParticleDefinition::UpdateG4ParticleDefinition(), and BDSIonDefinition::Z().
Referenced by GetNextParticleLocal().


|
private |
Definition at line 72 of file BDSLinkBunch.hh.
|
private |
Definition at line 71 of file BDSLinkBunch.hh.
|
private |
Definition at line 70 of file BDSLinkBunch.hh.
|
private |
Definition at line 73 of file BDSLinkBunch.hh.
|
private |
Definition at line 76 of file BDSLinkBunch.hh.
|
private |
Number of particles (1 counting).
Definition at line 75 of file BDSLinkBunch.hh.
Referenced by AddParticle(), ClearParticles(), and GetNextParticleLocal().