File indexing completed on 2025-01-18 09:55:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDG4_GEANT4USERLIMITS_H
0014 #define DDG4_GEANT4USERLIMITS_H
0015
0016
0017 #include <DD4hep/Objects.h>
0018
0019
0020 #include <G4UserLimits.hh>
0021
0022
0023 class G4ParticleDefinition;
0024
0025
0026 namespace dd4hep {
0027
0028
0029
0030 namespace sim {
0031
0032
0033
0034
0035
0036
0037
0038 class Geant4UserLimits : public G4UserLimits {
0039 public:
0040
0041
0042
0043
0044
0045
0046 struct Handler {
0047 public:
0048
0049 double defaultValue = 0.0;
0050
0051 std::map<const G4ParticleDefinition*, double> particleLimits;
0052 public:
0053
0054 Handler() = default;
0055
0056 void set(const std::string& particles, double val);
0057
0058 double value(const G4Track& track) const;
0059 };
0060
0061 LimitSet limits;
0062
0063 Handler maxStepLength;
0064
0065 Handler maxTrackLength;
0066
0067 Handler maxTime;
0068
0069 Handler minEKine;
0070
0071 Handler minRange;
0072
0073 public:
0074
0075 Geant4UserLimits(LimitSet limitset);
0076
0077 virtual ~Geant4UserLimits();
0078
0079 virtual void update(LimitSet limitset);
0080
0081 virtual G4double GetMaxAllowedStep(const G4Track& track)
0082 { return maxStepLength.value(track); }
0083
0084 virtual G4double GetUserMaxTrackLength(const G4Track& track)
0085 { return maxTrackLength.value(track); }
0086
0087 virtual G4double GetUserMaxTime (const G4Track& track)
0088 { return maxTime.value(track); }
0089
0090 virtual G4double GetUserMinEkine(const G4Track& track)
0091 { return minEKine.value(track); }
0092
0093 virtual G4double GetUserMinRange(const G4Track& track)
0094 { return minRange.value(track); }
0095
0096 virtual void SetMaxAllowedStep(G4double ustepMax);
0097 virtual void SetUserMaxTrackLength(G4double utrakMax);
0098 virtual void SetUserMaxTime(G4double utimeMax);
0099 virtual void SetUserMinEkine(G4double uekinMin);
0100 virtual void SetUserMinRange(G4double urangMin);
0101
0102 static bool enable_debug(bool value);
0103 };
0104 }
0105 }
0106
0107 #endif