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) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "BDSParticleCoords.hh"
20#include "BDSParticleCoordsFull.hh"
21
22#include <ostream>
23
24BDSParticleCoordsFull::BDSParticleCoordsFull():
25 s(0),
26 totalEnergy(0),
27 weight(1)
28{;}
29
30BDSParticleCoordsFull::BDSParticleCoordsFull(G4double xIn,
31 G4double yIn,
32 G4double zIn,
33 G4double xpIn,
34 G4double ypIn,
35 G4double zpIn,
36 G4double tIn,
37 G4double sIn,
38 G4double totalEnergyIn,
39 G4double weightIn):
40 BDSParticleCoords(xIn, yIn, zIn, xpIn, ypIn, zpIn, tIn),
41 s(sIn),
42 totalEnergy(totalEnergyIn),
43 weight(weightIn)
44{;}
45
46BDSParticleCoordsFull::BDSParticleCoordsFull(const BDSParticleCoords& localIn,
47 G4double sIn,
48 G4double totalEnergyIn,
49 G4double weightIn):
50 BDSParticleCoords(localIn),
51 s(sIn),
52 totalEnergy(totalEnergyIn),
53 weight(weightIn)
54{;}
55
56std::ostream& operator<< (std::ostream& out, BDSParticleCoordsFull const& p)
57{
58 p.Print(out);
59 return out;
60}
61
62void BDSParticleCoordsFull::Print(std::ostream& out) const
63{
65 out << "s: " << s << ", E (total): " << totalEnergy << ", weight: " << weight << G4endl;
66}
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.