20#include "BDSBunchComposite.hh"
21#include "BDSBunchFactory.hh"
23#include "BDSException.hh"
24#include "BDSParticleCoordsFull.hh"
26#include "parser/beam.h"
28BDSBunchComposite::BDSBunchComposite():
35BDSBunchComposite::~BDSBunchComposite()
45 G4Transform3D beamlineTransformIn,
59 {e.AppendToMessage(
"Error with x dimension composite beam distribution");
throw e;}
63 {e.AppendToMessage(
"Error with y dimension composite beam distribution");
throw e;}
67 {e.AppendToMessage(
"Error with z dimension composite beam distribution");
throw e;}
69 if (xType == BDSBunchType::composite ||
70 yType == BDSBunchType::composite ||
71 zType == BDSBunchType::composite)
72 {
throw BDSException(__METHOD_NAME__,
"x,y,z distributions cannot be 'composite'");}
80 name =
"composite: x: " + xBunch->
Name() +
", y: " + yBunch->
Name() +
", z: " + zBunch->
Name();
virtual BDSParticleCoordsFull GetNextParticleLocal()
virtual void SetOptions(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const BDSBunchType &distrType, G4Transform3D beamlineTransformIn=G4Transform3D::Identity, const G4double beamlineS=0)
virtual void SetGeneratePrimariesOnly(G4bool generatePrimariesOnlyIn)
virtual void CheckParameters()
static BDSBunch * CreateBunch(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const G4Transform3D &beamlineTransform=G4Transform3D::Identity, G4double beamlineS=0, G4bool generatePrimariesOnlyIn=false)
factory method
The base class for bunch distribution generators.
G4bool ParticleDefinitionHasBeenUpdated() const
G4bool particleDefinitionHasBeenUpdated
virtual void SetGeneratePrimariesOnly(G4bool generatePrimariesOnlyIn)
virtual BDSParticleCoordsFull GetNextParticleLocal()
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.
G4String name
Name of distribution.
virtual void CheckParameters()
General exception with possible name of object and message.
A set of particle coordinates including energy and weight.
Wrapper for particle definition.
Improve type-safety of native enum data type in C++.
std::string zDistrType
beam parameters
std::string yDistrType
beam parameters
std::string xDistrType
beam parameters
BDSBunchType DetermineBunchType(G4String distrType)
Function that gives corresponding enum value for string (case-insensitive).