BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSHitCollimator.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 BDSHITCOLLIMATOR_H
19#define BDSHITCOLLIMATOR_H
20
21#include "globals.hh"
22#include "G4VHit.hh"
23#include "G4ThreeVector.hh"
24#include "G4THitsCollection.hh"
25#include "G4Allocator.hh"
26
27class BDSBeamline;
29
38class BDSHitCollimator: public G4VHit
39{
40public:
41 BDSHitCollimator() = delete;
42 BDSHitCollimator(const BDSBeamline* beamlineIn,
43 G4int collimatorIndexIn,
44 const G4ThreeVector& preStepPositionIn,
45 const G4ThreeVector& preStepMomentumIn,
46 G4double totalEnergyIn,
47 G4double globalTimeIn,
48 G4double weightIn,
49 G4int partIDIn,
50 G4int parentIDIn,
51 G4int turnsTakenIn,
52 BDSHitEnergyDeposition* energyDepositionHitIn);
53
55 virtual ~BDSHitCollimator();
56
57 inline void* operator new(size_t);
58 inline void operator delete(void* aHit);
59
62 G4ThreeVector preStepPosition;
63 G4ThreeVector preStepMomentum;
64 G4double totalEnergy;
65 G4double globalTime;
66 G4double weight;
67 G4int partID;
68 G4int parentID;
69 G4int turnsTaken;
70
75};
76
78extern G4Allocator<BDSHitCollimator> BDSAllocatorCollimator;
79
80inline void* BDSHitCollimator::operator new(size_t)
81{
82 void* aHit;
83 aHit=(void*) BDSAllocatorCollimator.MallocSingle();
84 return aHit;
85}
86
87inline void BDSHitCollimator::operator delete(void* aHit)
88{
89 BDSAllocatorCollimator.FreeSingle((BDSHitCollimator*) aHit);
90}
91
92#endif
A vector of BDSBeamlineElement instances - a beamline.
Snapshot of information for particle passing through a collimator.
G4double totalEnergy
Total energy of particle.
virtual ~BDSHitCollimator()
Note this should not be inline when we use a G4Allocator.
G4int parentID
Track ID of the parent of the particle.
G4ThreeVector preStepMomentum
Local pre step point momentum.
G4int turnsTaken
Turn number of the hit.
G4double globalTime
Pre step point global time.
G4int collimatorIndex
Index of collimator the hit is in.
G4double weight
Statistical weight of the track.
G4int partID
PDG ID of the particle.
const BDSBeamline * beamline
Which beam line the collimator is in.
BDSHitEnergyDeposition * energyDepositionHit
G4ThreeVector preStepPosition
Local pre step point (z from centre of object).
Information recorded for a single piece of energy deposition.