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