BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSParticleCoordsFull.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 "BDSParticleCoords.hh"
19#include "BDSParticleCoordsFull.hh"
20
21#include <ostream>
22
23BDSParticleCoordsFull::BDSParticleCoordsFull():
24 s(0),
25 totalEnergy(0),
26 weight(1)
27{;}
28
29BDSParticleCoordsFull::BDSParticleCoordsFull(G4double xIn,
30 G4double yIn,
31 G4double zIn,
32 G4double xpIn,
33 G4double ypIn,
34 G4double zpIn,
35 G4double tIn,
36 G4double sIn,
37 G4double totalEnergyIn,
38 G4double weightIn):
39 BDSParticleCoords(xIn, yIn, zIn, xpIn, ypIn, zpIn, tIn),
40 s(sIn),
41 totalEnergy(totalEnergyIn),
42 weight(weightIn)
43{;}
44
45BDSParticleCoordsFull::BDSParticleCoordsFull(const BDSParticleCoords& localIn,
46 G4double sIn,
47 G4double totalEnergyIn,
48 G4double weightIn):
49 BDSParticleCoords(localIn),
50 s(sIn),
51 totalEnergy(totalEnergyIn),
52 weight(weightIn)
53{;}
54
55std::ostream& operator<< (std::ostream& out, BDSParticleCoordsFull const& p)
56{
57 p.Print(out);
58 return out;
59}
60
61void BDSParticleCoordsFull::Print(std::ostream& out) const
62{
64 out << "s: " << s << ", E (total): " << totalEnergy << ", weight: " << weight << G4endl;
65}
A set of particle coordinates including energy and weight.
G4double s
TODO - remove this. Unused. S (global) is calculated from S0 + z.
virtual void Print(std::ostream &out) const
Actual print out method so it can be called from a derived class.
A set of particle coordinates.
virtual void Print(std::ostream &out) const
Actual print out method so it can be called from a derived class.