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