BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSHitThinThing.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 BDSHITTHINTHING_H
19#define BDSHITTHINTHING_H
20
21#include "G4Allocator.hh"
22#include "G4VHit.hh"
23#include "G4THitsCollection.hh"
24#include "G4Types.hh"
25
26#include <vector>
27
31
32class BDSHitThinThing; // forward declaration to allow typedef required for static function
34extern G4Allocator<BDSHitThinThing> BDSAllocatorThinThing;
35
44class BDSHitThinThing: public G4VHit
45{
46public:
47 BDSHitThinThing(G4int pdgIDIn,
48 G4int trackIDIn,
49 G4int parentIDIn,
50 G4int turnsTakenIn,
51 BDSTrajectoryPoint* hitIn);
52
54 virtual ~BDSHitThinThing();
55
56 inline void* operator new(size_t);
57 inline void operator delete(void* aHit);
58
61
62 G4int pdgID;
63 G4int trackID;
64 G4int parentID;
65 G4int turnsTaken;
67
69 static std::vector<const BDSTrajectoryPoint*> TrajectoryPointsFromHC(BDSHitsCollectionThinThing* hits);
70
71 static std::vector<const BDSTrajectoryPointHit*>
72 ResolvePossibleEarlierThinHits(const std::vector<const BDSTrajectoryPrimary*>& primaryTrajectoryHits,
73 const BDSHitsCollectionThinThing* thinThingHits);
74
75private:
76 BDSHitThinThing() = delete;
77};
78
79inline void* BDSHitThinThing::operator new(size_t)
80{
81 void* aHit;
82 aHit=(void*) BDSAllocatorThinThing.MallocSingle();
83 return aHit;
84}
85
86inline void BDSHitThinThing::operator delete(void* aHit)
87{
88 BDSAllocatorThinThing.FreeSingle((BDSHitThinThing*) aHit);
89}
90#endif
A hit if a particle lost energy in a thin object.
BDSHitThinThing()=delete
No default constructor.
BDSTrajectoryPointHit * GetNewTrajectoryPointHit() const
Allocate and return a new hit object.
virtual ~BDSHitThinThing()
Note this should not be inline when we use a G4Allocator.
static std::vector< const BDSTrajectoryPoint * > TrajectoryPointsFromHC(BDSHitsCollectionThinThing *hits)
Utility function to get a vector of trajectory points from the hits collection.
A summary trajectory object of a loss point.
A Point in a trajectory with extra information.
Trajectory information for only the primary.