BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
bdsim
include
BDSHitSamplerSphere.hh
1
/*
2
Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3
University of London 2001 - 2023.
4
5
This file is part of BDSIM.
6
7
BDSIM is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published
9
by the Free Software Foundation version 3 of the License.
10
11
BDSIM is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
#ifndef BDSHITSAMPLERSPHERE_H
20
#define BDSHITSAMPLERSPHERE_H
21
#include "BDSParticleCoordsSpherical.hh"
22
23
#include "globals.hh"
24
#include "G4VHit.hh"
25
#include "G4THitsCollection.hh"
26
#include "G4Allocator.hh"
27
34
class
BDSHitSamplerSphere
:
public
G4VHit
35
{
36
public
:
37
BDSHitSamplerSphere
() =
delete
;
38
BDSHitSamplerSphere
(G4int samplerIDIn,
39
const
BDSParticleCoordsSpherical
& coordsIn,
40
G4double totalEnergyIn,
41
G4double weightIn,
42
G4double SIn,
43
G4double momentumIn,
44
G4double massIn,
45
G4double chargeIn,
46
G4double rigidityIn,
47
G4int pdgIDIn,
48
G4int parentIDIn,
49
G4int trackIDIn,
50
G4int turnsTakenIn,
51
G4int beamlineIndexIn,
52
G4int nElectronsIn = 0);
53
55
virtual
~BDSHitSamplerSphere
();
56
57
inline
void
*
operator
new
(size_t);
58
inline
void
operator
delete
(
void
*aHit);
59
60
G4int samplerID;
61
BDSParticleCoordsSpherical
coords;
62
G4double totalEnergy;
63
G4double weight;
64
G4double S;
65
G4double momentum;
66
G4double mass;
67
G4double
charge
;
68
G4double rigidity;
69
G4int pdgID;
70
G4int parentID;
71
G4int trackID;
72
G4int turnsTaken;
73
G4int beamlineIndex;
74
G4int
nElectrons
;
75
};
76
77
typedef
G4THitsCollection<BDSHitSamplerSphere>
BDSHitsCollectionSamplerSphere
;
78
extern
G4Allocator<BDSHitSamplerSphere> BDSAllocatorSamplerSphere;
79
80
inline
void
* BDSHitSamplerSphere::operator
new
(size_t)
81
{
82
void
* aHit;
83
aHit=(
void
*) BDSAllocatorSamplerSphere.MallocSingle();
84
return
aHit;
85
}
86
87
inline
void
BDSHitSamplerSphere::operator
delete
(
void
*aHit)
88
{
89
BDSAllocatorSamplerSphere.FreeSingle((
BDSHitSamplerSphere
*) aHit);
90
}
91
92
#endif
BDSHitSamplerSphere
The information recorded from a particle impacting a sampler.
Definition:
BDSHitSamplerSphere.hh:35
BDSHitSamplerSphere::~BDSHitSamplerSphere
virtual ~BDSHitSamplerSphere()
Note this should not be inline when we use a G4Allocator.
Definition:
BDSHitSamplerSphere.cc:59
BDSHitSamplerSphere::BDSHitSamplerSphere
BDSHitSamplerSphere()=delete
No default constructor.
BDSHitSamplerSphere::charge
G4double charge
Double as g4 uses charge as a double.
Definition:
BDSHitSamplerSphere.hh:67
BDSHitSamplerSphere::nElectrons
G4int nElectrons
Can only get this at inspection time so include here.
Definition:
BDSHitSamplerSphere.hh:74
BDSParticleCoordsSpherical
A set of spherical particle coordinates.
Definition:
BDSParticleCoordsSpherical.hh:35
G4THitsCollection
Definition:
BDSOutput.hh:35
Generated on Mon Aug 14 2023 13:49:30 for BDSIM by
1.9.6