BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSHitEnergyDeposition.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 "BDSHitEnergyDeposition.hh"
20#include "BDSHitEnergyDepositionExtra.hh"
21
22#include "globals.hh" // geant4 types / globals
23#include "G4Allocator.hh"
24
25G4Allocator<BDSHitEnergyDeposition> BDSAllocatorEnergyDeposition;
26
28 G4double sHitIn,
29 G4double weightIn,
30 G4bool storeExtras,
31 G4double preStepKineticEnergy,
32 G4double X,
33 G4double Y,
34 G4double Z,
35 G4double x,
36 G4double y,
37 G4double z,
38 G4double globalTime,
39 G4int partID,
40 G4int trackID,
41 G4int parentID,
42 G4int turnsTaken,
43 G4double stepLength,
44 G4int beamlineIndex,
45 G4int postStepProcessType,
46 G4int postStepProcessSubType):
47 energy(energyIn),
48 sHit(sHitIn),
49 weight(weightIn),
50 extra(nullptr)
51{
52 if (storeExtras)
53 {
54 extra = new BDSHitEnergyDepositionExtra(preStepKineticEnergy,
55 X, Y, Z, x, y, z, globalTime,
56 partID, trackID, parentID,
57 turnsTaken, stepLength,
58 beamlineIndex, postStepProcessType, postStepProcessSubType);
59 }
60}
61
63{
64 delete extra;
65}
Extra information recorded for a single piece of energy deposition.
virtual ~BDSHitEnergyDeposition()
Note this should not be inline when we use a G4Allocator.