BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSHitSamplerLink.hh
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#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
38{
39public:
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
67extern G4Allocator<BDSHitSamplerLink> BDSAllocatorSamplerLink;
68
69inline void* BDSHitSamplerLink::operator new(size_t)
70{
71 void* aHit;
72 aHit=(void*) BDSAllocatorSamplerLink.MallocSingle();
73 return aHit;
74}
75
76inline void BDSHitSamplerLink::operator delete(void *aHit)
77{
78 BDSAllocatorSamplerLink.FreeSingle((BDSHitSamplerLink*) aHit);
79}
80
81#endif
The information recorded from a particle impacting a sampler.
A set of particle coordinates including energy and weight.