BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSOutputROOTEventTrajectoryPoint.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 "BDSOutputROOTEventTrajectoryPoint.hh"
20
22
23BDSOutputROOTEventTrajectoryPoint::BDSOutputROOTEventTrajectoryPoint()
24{
25 ClearContents();
26}
27
28BDSOutputROOTEventTrajectoryPoint::BDSOutputROOTEventTrajectoryPoint(int partIDIn,
29 unsigned int trackIDIn,
30 unsigned int parentIDIn,
31 unsigned int parentIndexIn,
32 int processTypeIn,
33 int processSubTypeIn,
34 double weightIn,
35 double energyDepositedIn,
36 const TVector3& positionIn,
37 const TVector3& momentumIn,
38 int modelIn,
39 double timeIn,
40 const TVector3& positionLocalIn,
41 const TVector3& momentumLocalIn,
42 double chargeIn,
43 double kineticEnergyIn,
44 int turnsTakenIn,
45 double rigidityIn,
46 double massIn,
47 bool isIonIn,
48 int ionAIn,
49 int ionZIn,
50 int nElectronsIn,
51 int materialIDIn,
52 int stepIndexIn):
53 partID(partIDIn),
54 trackID(trackIDIn),
55 parentID(parentIDIn),
56 parentIndex(parentIndexIn),
57 postProcessType(processTypeIn),
58 postProcessSubType(processSubTypeIn),
59 weight(weightIn),
60 energyDeposited(energyDepositedIn),
61 position(positionIn),
62 momentum(momentumIn),
63 model(modelIn),
64 time(timeIn),
65 positionLocal(positionLocalIn),
66 momentumLocal(momentumLocalIn),
67 charge(chargeIn),
68 kineticEnergy(kineticEnergyIn),
69 turnsTaken(turnsTakenIn),
70 rigidity(rigidityIn),
71 mass(massIn),
72 isIon(isIonIn),
73 ionA(ionAIn),
74 ionZ(ionZIn),
75 nElectrons(nElectronsIn),
76 materialID(materialIDIn),
77 stepIndex(stepIndexIn)
78{;}
79
80void BDSOutputROOTEventTrajectoryPoint::ClearContents()
81{
82 partID = 0;
83 trackID = 0;
84 parentID = 0;
85 parentIndex = 0;
86 postProcessType = -1;
87 postProcessSubType = -1;
88 weight = -1.0;
89 energyDeposited = -1.0;
90 position = {0,0,0};
91 momentum = {0,0,0};
92 model = -1;
93 time = 0;
94 positionLocal = {0,0,0};
95 momentumLocal = {0,0,0};
96 charge = 0;
97 kineticEnergy = 0;
98 turnsTaken = 0;
99 rigidity = 0;
100 mass = 0;
101 isIon = false;
102 ionA = 0;
103 ionZ = 0;
104 nElectrons = 0;
105 materialID = -1;
106 stepIndex = -1;
107}
108
109BDSOutputROOTEventTrajectoryPoint::~BDSOutputROOTEventTrajectoryPoint()
110{;}
Structure to record a trajectory point.
int stepIndex
Index along trajectory this point is.
int materialID
We allow this to be signed so we can use -1 to signify unknown.