4 // See the class description in the header file.
7 #include "TG4CutVector.h"
8 #include "TG4FlagVector.h"
10 TG4Limits::TG4Limits()
12 // default values of G4UserLimits data members are set:
13 // fMaxStep (DBL_MAX), fMaxTrack(DBL_MAX),fMaxTime(DBL_MAX),
14 // fMinEkine(0.), fMinRange(0.)
19 fCutVector = new TG4CutVector();
20 fFlagVector = new TG4FlagVector();
23 TG4Limits::TG4Limits(const TG4Limits& right)
27 fCutVector = new TG4CutVector(*right.fCutVector);
28 fFlagVector = new TG4FlagVector(*right.fFlagVector);
31 TG4Limits::~TG4Limits() {
39 TG4Limits& TG4Limits::operator=(const TG4Limits& right)
41 // check assignement to self
42 if (this == &right) return *this;
44 // base class assignement
45 G4UserLimits::operator=(right);
47 *fCutVector = *right.fCutVector;
48 *fFlagVector = *right.fFlagVector;
55 G4double TG4Limits::GetUserMinEkine(const G4Track& track)
57 // Returns the kinetic energy cut for the particle
58 // associated with the specified track.
62 return fCutVector->GetMinEkine(track);
69 void TG4Limits::SetG3Cut(TG3Cut g3Cut, G4double cutValue)
71 // Sets the cut value for the specified cut.
74 fCutVector->SetG3Cut(g3Cut, cutValue);
78 void TG4Limits::SetG3Flag(TG3Flag g3Flag, G4double flagValue)
80 // Sets the process control value for the specified flag.
83 fFlagVector->SetG3Flag(g3Flag, flagValue);
84 if (flagValue - kUnset > 0.01) fIsFlag = true;
87 void TG4Limits::SetG3DefaultCuts()
89 // Sets the G3 default cut values for all cuts.
92 fCutVector->SetG3Defaults();
96 void TG4Limits::SetG3DefaultFlags()
98 // Sets the G3 default process control values for all flags.
101 fFlagVector->SetG3Defaults();
105 G4double TG4Limits::GetMinEkineForGamma(const G4Track& track) const
107 // Returns the cut value for gamma.
111 return fCutVector->GetMinEkine(track);
116 G4double TG4Limits::GetMinEkineForElectron(const G4Track& track) const
118 // Returns the cut value for e-.
122 return fCutVector->GetMinEkineForElectron(track);
127 G4double TG4Limits::GetMinEkineForHadron(const G4Track& track) const
129 // Returns the cut value for charged hadron.
133 return fCutVector->GetMinEkineForHadron(track);
138 G4double TG4Limits::GetMinEkineForNeutralHadron(const G4Track& track) const
140 // Returns the cut value for neutral hadron.
144 return fCutVector->GetMinEkineForNeutralHadron(track);
149 G4double TG4Limits::GetMinEkineForMuon(const G4Track& track) const
151 // Returns the cut value for neutral muon.
155 return fCutVector->GetMinEkineForMuon(track);
160 G4double TG4Limits::GetMinEkineForOther(const G4Track& track) const
168 G4int TG4Limits::GetFlag(G4VProcess* process) const
170 // Returns the flag value for the particle associated with
171 // the specified process.
175 return fFlagVector->GetFlag(process);