19#include "BDSBunchCompositeSDE.hh"
20#include "BDSBunchFactory.hh"
22#include "BDSException.hh"
23#include "BDSParticleCoordsFull.hh"
25#include "parser/beam.h"
27BDSBunchCompositeSDE::BDSBunchCompositeSDE():
28BDSBunch(
"compositespacedirectionenergy"),
34BDSBunchCompositeSDE::~BDSBunchCompositeSDE()
44 G4Transform3D beamlineTransformIn,
58 {e.AppendToMessage(
"Error with space dimension in composite beam distribution");
throw e;}
62 {e.AppendToMessage(
"Error with direction dimension in composite beam distribution");
throw e;}
66 {e.AppendToMessage(
"Error with energy dimension in composite beam distribution");
throw e;}
68 std::vector<BDSBunchType> dims = {sType, dType, eType};
71 if (d == BDSBunchType::composite || d == BDSBunchType::compositesde)
72 {
throw BDSException(__METHOD_NAME__,
"s,y,z distributions cannot be 'composite'");}
81 name =
"composite: space: " + sBunch->
Name() +
", direction: " + dBunch->
Name() +
", energy: " + eBunch->
Name();
114 s.weight * d.weight * e.weight);
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).