BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
__w
bdsim
bdsim
src
BDSBunchSphere.cc
1
/*
2
Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4
This file is part of BDSIM.
5
6
BDSIM is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published
8
by the Free Software Foundation version 3 of the License.
9
10
BDSIM is distributed in the hope that it will be useful, but
11
WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along 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
24
BDSBunchSphere::BDSBunchSphere():
25
BDSBunch
(
"sphere"
)
26
{;}
27
28
BDSParticleCoordsFull
BDSBunchSphere::GetNextParticleLocal
()
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
}
BDSBunchSphere::GetNextParticleLocal
virtual BDSParticleCoordsFull GetNextParticleLocal()
Definition
BDSBunchSphere.cc:28
BDSBunch
The base class for bunch distribution generators.
Definition
BDSBunch.hh:46
BDSBunch::T0
G4double T0
Centre of distributions.
Definition
BDSBunch.hh:174
BDSBunch::S0
G4double S0
Centre of distributions.
Definition
BDSBunch.hh:173
BDSBunch::Z0
G4double Z0
Centre of distributions.
Definition
BDSBunch.hh:172
BDSBunch::X0
G4double X0
Centre of distributions.
Definition
BDSBunch.hh:170
BDSBunch::E0
G4double E0
Centre of distributions.
Definition
BDSBunch.hh:178
BDSBunch::Y0
G4double Y0
Centre of distributions.
Definition
BDSBunch.hh:171
BDSParticleCoordsFull
A set of particle coordinates including energy and weight.
Definition
BDSParticleCoordsFull.hh:34
Generated on Thu Nov 12 2026 21:36:59 for BDSIM by
1.9.8