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