BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSHitSamplerSphere.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 BDSHITSAMPLERSPHERE_H
19#define BDSHITSAMPLERSPHERE_H
20#include "BDSParticleCoordsSpherical.hh"
21
22#include "globals.hh"
23#include "G4VHit.hh"
24#include "G4THitsCollection.hh"
25#include "G4Allocator.hh"
26
33class BDSHitSamplerSphere: public G4VHit
34{
35public:
37 BDSHitSamplerSphere(G4int samplerIDIn,
38 const BDSParticleCoordsSpherical& coordsIn,
39 G4double totalEnergyIn,
40 G4double weightIn,
41 G4double SIn,
42 G4double momentumIn,
43 G4double massIn,
44 G4double chargeIn,
45 G4double rigidityIn,
46 G4int pdgIDIn,
47 G4int parentIDIn,
48 G4int trackIDIn,
49 G4int turnsTakenIn,
50 G4int beamlineIndexIn,
51 G4int nElectronsIn = 0);
52
54 virtual ~BDSHitSamplerSphere();
55
56 inline void* operator new(size_t);
57 inline void operator delete(void *aHit);
58
59 G4int samplerID;
61 G4double totalEnergy;
62 G4double weight;
63 G4double S;
64 G4double momentum;
65 G4double mass;
66 G4double charge;
67 G4double rigidity;
68 G4int pdgID;
69 G4int parentID;
70 G4int trackID;
71 G4int turnsTaken;
72 G4int beamlineIndex;
73 G4int nElectrons;
74};
75
77extern G4Allocator<BDSHitSamplerSphere> BDSAllocatorSamplerSphere;
78
79inline void* BDSHitSamplerSphere::operator new(size_t)
80{
81 void* aHit;
82 aHit=(void*) BDSAllocatorSamplerSphere.MallocSingle();
83 return aHit;
84}
85
86inline void BDSHitSamplerSphere::operator delete(void *aHit)
87{
88 BDSAllocatorSamplerSphere.FreeSingle((BDSHitSamplerSphere*) aHit);
89}
90
91#endif
The information recorded from a particle impacting a sampler.
virtual ~BDSHitSamplerSphere()
Note this should not be inline when we use a G4Allocator.
BDSHitSamplerSphere()=delete
No default constructor.
G4double charge
Double as g4 uses charge as a double.
G4int nElectrons
Can only get this at inspection time so include here.
A set of spherical particle coordinates.