BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
__w
bdsim
bdsim
include
BDSHitSamplerLink.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 BDSHITSAMPLERLINK_H
19
#define BDSHITSAMPLERLINK_H
20
21
#include "BDSHitSampler.hh"
22
#include "BDSParticleCoordsFull.hh"
23
24
#include "G4Types.hh"
25
#include "G4VHit.hh"
26
#include "G4THitsCollection.hh"
27
#include "G4Allocator.hh"
28
37
class
BDSHitSamplerLink
:
public
BDSHitSampler
38
{
39
public
:
40
BDSHitSamplerLink
() =
delete
;
41
BDSHitSamplerLink
(G4int samplerIDIn,
42
const
BDSParticleCoordsFull
& coordsIn,
43
G4double momentumIn,
44
G4double massIn,
45
G4int ZIn,
46
G4int AIn,
47
G4double chargeIn,
48
G4int pdgIDIn,
49
G4int parentIDIn,
50
G4int trackIDIn,
51
G4int nElectronsIn = 0);
52
54
virtual
~BDSHitSamplerLink
();
55
56
inline
void
*
operator
new
(size_t);
57
inline
void
operator
delete
(
void
*aHit);
58
59
G4int Z;
60
G4int A;
61
G4int eventID;
62
G4int externalParticleID;
63
G4int externalParentID;
64
};
65
66
typedef
G4THitsCollection<BDSHitSamplerLink>
BDSHitsCollectionSamplerLink
;
67
extern
G4Allocator<BDSHitSamplerLink> BDSAllocatorSamplerLink;
68
69
inline
void
* BDSHitSamplerLink::operator
new
(size_t)
70
{
71
void
* aHit;
72
aHit=(
void
*) BDSAllocatorSamplerLink.MallocSingle();
73
return
aHit;
74
}
75
76
inline
void
BDSHitSamplerLink::operator
delete
(
void
*aHit)
77
{
78
BDSAllocatorSamplerLink.FreeSingle((
BDSHitSamplerLink
*) aHit);
79
}
80
81
#endif
BDSHitSamplerLink
The information recorded from a particle impacting a link sampler.
Definition
BDSHitSamplerLink.hh:38
BDSHitSamplerLink::~BDSHitSamplerLink
virtual ~BDSHitSamplerLink()
Note this should not be inline when we use a G4Allocator.
Definition
BDSHitSamplerLink.cc:45
BDSHitSamplerLink::BDSHitSamplerLink
BDSHitSamplerLink()=delete
No default constructor.
BDSHitSampler
The information recorded from a particle impacting a sampler.
Definition
BDSHitSampler.hh:35
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