4 // See the class description in the header file.
7 #include "TG4G3CutVector.h"
8 #include "TG4G3ControlVector.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 TG4G3CutVector();
20 fControlVector = new TG4G3ControlVector();
23 TG4Limits::TG4Limits(const TG4Limits& right)
27 fCutVector = new TG4G3CutVector(*right.fCutVector);
28 fControlVector = new TG4G3ControlVector(*right.fControlVector);
31 TG4Limits::~TG4Limits() {
34 delete fControlVector;
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 *fControlVector = *right.fControlVector;
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(TG4G3Cut cut, G4double cutValue)
71 // Sets the cut value for the specified cut.
74 fCutVector->SetG3Cut(cut, cutValue);
78 void TG4Limits::SetG3Control(TG4G3Control control, G4double flagValue)
80 // Sets the process control value for the specified flag.
83 fControlVector->SetG3Control(control, flagValue);
84 if (flagValue - kUnset > 0.01) fIsControl = true;
87 void TG4Limits::SetG3DefaultCuts()
89 // Sets the G3 default cut values for all cuts.
92 fCutVector->SetG3Defaults();
96 void TG4Limits::SetG3DefaultControls()
98 // Sets the G3 default process control values for all flags.
101 fControlVector->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::GetControl(G4VProcess* process) const
170 // Returns the flag value for the particle associated with
171 // the specified process.
175 return fControlVector->GetControl(process);