20#include "BDSBunchCompositeSDE.hh"
21#include "BDSBunchFactory.hh"
23#include "BDSException.hh"
24#include "BDSParticleCoordsFull.hh"
26#include "parser/beam.h"
28BDSBunchCompositeSDE::BDSBunchCompositeSDE():
29BDSBunch(
"compositespacedirectionenergy"),
35BDSBunchCompositeSDE::~BDSBunchCompositeSDE()
45 G4Transform3D beamlineTransformIn,
59 {e.AppendToMessage(
"Error with space dimension in composite beam distribution");
throw e;}
63 {e.AppendToMessage(
"Error with direction dimension in composite beam distribution");
throw e;}
67 {e.AppendToMessage(
"Error with energy dimension in composite beam distribution");
throw e;}
69 std::vector<BDSBunchType> dims = {sType, dType, eType};
72 if (d == BDSBunchType::composite || d == BDSBunchType::compositesde)
73 {
throw BDSException(__METHOD_NAME__,
"s,y,z distributions cannot be 'composite'");}
82 name =
"composite: space: " + sBunch->
Name() +
", direction: " + dBunch->
Name() +
", energy: " + eBunch->
Name();
virtual void SetGeneratePrimariesOnly(G4bool generatePrimariesOnlyIn)
virtual void CheckParameters()
virtual void SetOptions(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const BDSBunchType &distrType, G4Transform3D beamlineTransformIn=G4Transform3D::Identity, const G4double beamlineS=0)
virtual BDSParticleCoordsFull GetNextParticleLocal()
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 directionDistrType
beam parameters
std::string spaceDistrType
beam parameters
std::string energyDistrType
beam parameters
BDSBunchType DetermineBunchType(G4String distrType)
Function that gives corresponding enum value for string (case-insensitive).