BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSTerminatorUserLimits.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
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 BDSTERMINATORUSERLIMITS_H
20#define BDSTERMINATORUSERLIMITS_H
21
22#include "G4UserLimits.hh"
23#include "globals.hh" // geant4 basic stl types
24
25#include <limits>
26
38class BDSTerminatorUserLimits: public G4UserLimits
39{
40public:
44 BDSTerminatorUserLimits(G4double ustepMax = std::numeric_limits<double>::max(),
45 G4double utrakMax = std::numeric_limits<double>::max(),
46 G4double utimeMax = std::numeric_limits<double>::max(),
47 G4double uekinMin = 0.,
48 G4double urangMin = 0.);
49
50 BDSTerminatorUserLimits(const G4String& type,
51 G4double ustepMax = std::numeric_limits<double>::max(),
52 G4double utrakMax = std::numeric_limits<double>::max(),
53 G4double utimeMax = std::numeric_limits<double>::max(),
54 G4double uekinMin = 0.,
55 G4double urangMin = 0.);
56
57 virtual ~BDSTerminatorUserLimits(){};
58
62 virtual G4double GetUserMinEkine(const G4Track&);
63
64protected:
65 G4double keeprunningEK;
66 G4double stoprunningEK;
67
68private:
71 const G4int turnsToTake;
72};
73
74#endif
Dynamic user limits for a volume that changed based on the parameter turnstaken in BDSGlobalConstants...
virtual G4double GetUserMinEkine(const G4Track &)
G4double keeprunningEK
Minimum energy particle must have to keep going.
G4double stoprunningEK
Same, so everything < DBL_MAX so everything stopped.