BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBunchSphere.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include "BDSBunchSphere.hh"
19#include "BDSParticleCoordsFull.hh"
20
21#include "globals.hh"
22#include "G4RandomDirection.hh"
23
24BDSBunchSphere::BDSBunchSphere():
25 BDSBunch("sphere")
26{;}
27
29{
30 G4ThreeVector momentumUnitVector = G4RandomDirection();
31 G4double xp = momentumUnitVector.x();
32 G4double yp = momentumUnitVector.y();
33 G4double zp = momentumUnitVector.z();
34 return BDSParticleCoordsFull(X0,Y0,Z0,xp,yp,zp,T0,S0,E0,/*weight=*/1.0);
35}
virtual BDSParticleCoordsFull GetNextParticleLocal()
The base class for bunch distribution generators.
Definition BDSBunch.hh:46
G4double T0
Centre of distributions.
Definition BDSBunch.hh:174
G4double S0
Centre of distributions.
Definition BDSBunch.hh:173
G4double Z0
Centre of distributions.
Definition BDSBunch.hh:172
G4double X0
Centre of distributions.
Definition BDSBunch.hh:170
G4double E0
Centre of distributions.
Definition BDSBunch.hh:178
G4double Y0
Centre of distributions.
Definition BDSBunch.hh:171
A set of particle coordinates including energy and weight.