BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSLinkRunAction.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 BDSLINKRUNACTION_H
19#define BDSLINKRUNACTION_H
20#include "BDSHitSamplerLink.hh"
21
22#include "G4Types.hh"
23#include "G4UserRunAction.hh"
24
25class G4Run;
26
33class BDSLinkRunAction: public G4UserRunAction
34{
35public:
37 virtual ~BDSLinkRunAction();
38
39 virtual void BeginOfRunAction(const G4Run* aRun);
40 virtual void EndOfRunAction(const G4Run* aRun);
41
42 void AppendHits(G4int currentEventIndex,
43 G4int externalParticleID,
44 G4int externalParentID,
46
47 BDSHitsCollectionSamplerLink* SamplerHits() const {return allHits;}
48 void ClearSamplerHits() {delete allHits; allHits = nullptr;}
49
50 inline G4int NSecondariesToReturn() const {return nSecondariesToReturn;}
51 inline G4int NPrimariesToReturn() const {return nPrimariesToReturn;}
52 inline G4int MaximumExternalParticleID() const {return maximumExternalParticleID;}
53 inline void SetMaximumExternalParticleID(G4int maxExtPartID) {maximumExternalParticleID = maxExtPartID;}
54
55private:
57 G4int nSecondariesToReturn;
58 G4int nPrimariesToReturn;
59 G4int maximumExternalParticleID;
60};
61
62#endif
63
Simplified run action to hold link hits.