BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSHitSamplerCylinder.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSHITSAMPLERCYLINDER_H
20#define BDSHITSAMPLERCYLINDER_H
21#include "BDSParticleCoordsCylindrical.hh"
22
23#include "globals.hh"
24#include "G4VHit.hh"
25#include "G4THitsCollection.hh"
26#include "G4Allocator.hh"
27
34class BDSHitSamplerCylinder: public G4VHit
35{
36public:
38 BDSHitSamplerCylinder(G4int samplerIDIn,
39 const BDSParticleCoordsCylindrical& 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 ~BDSHitSamplerCylinder();
56
57 inline void* operator new(size_t);
58 inline void operator delete(void *aHit);
59
60 G4int samplerID;
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
78extern G4Allocator<BDSHitSamplerCylinder> BDSAllocatorSamplerCylinder;
79
80inline void* BDSHitSamplerCylinder::operator new(size_t)
81{
82 void* aHit;
83 aHit=(void*) BDSAllocatorSamplerCylinder.MallocSingle();
84 return aHit;
85}
86
87inline void BDSHitSamplerCylinder::operator delete(void *aHit)
88{
89 BDSAllocatorSamplerCylinder.FreeSingle((BDSHitSamplerCylinder*) aHit);
90}
91
92#endif
The information recorded from a particle impacting a sampler.
G4int nElectrons
Can only get this at inspection time so include here.
BDSHitSamplerCylinder()=delete
No default constructor.
G4double charge
Double as g4 uses charge as a double.
virtual ~BDSHitSamplerCylinder()
Note this should not be inline when we use a G4Allocator.
A set of cylindrical particle coordinates.