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)
28 fCutVector = new TG4G3CutVector();
29 fControlVector = new TG4G3ControlVector();
35 TG4Limits::~TG4Limits() {
38 delete fControlVector;
43 TG4Limits& TG4Limits::operator=(const TG4Limits& right)
45 // check assignement to self
46 if (this == &right) return *this;
48 // base class assignement
49 G4UserLimits::operator=(right);
51 *fCutVector = *right.fCutVector;
52 *fControlVector = *right.fControlVector;
59 G4double TG4Limits::GetUserMinEkine(const G4Track& track)
61 // Returns the kinetic energy cut for the particle
62 // associated with the specified track.
66 return fCutVector->GetMinEkine(track);
73 void TG4Limits::SetG3Cut(TG4G3Cut cut, G4double cutValue)
75 // Sets the cut value for the specified cut.
78 fCutVector->SetG3Cut(cut, cutValue);
82 void TG4Limits::SetG3Control(TG4G3Control control, G4double flagValue)
84 // Sets the process control value for the specified flag.
87 fControlVector->SetG3Control(control, flagValue);
88 if (flagValue - kUnset > 0.01) fIsControl = true;
91 void TG4Limits::SetG3DefaultCuts()
93 // Sets the G3 default cut values for all cuts.
96 fCutVector->SetG3Defaults();
100 void TG4Limits::SetG3DefaultControls()
102 // Sets the G3 default process control values for all flags.
105 fControlVector->SetG3Defaults();
109 G4double TG4Limits::GetMinEkineForGamma(const G4Track& track) const
111 // Returns the cut value for gamma.
115 return fCutVector->GetMinEkine(track);
120 G4double TG4Limits::GetMinEkineForElectron(const G4Track& track) const
122 // Returns the cut value for e-.
126 return fCutVector->GetMinEkineForElectron(track);
131 G4double TG4Limits::GetMinEkineForHadron(const G4Track& track) const
133 // Returns the cut value for charged hadron.
137 return fCutVector->GetMinEkineForHadron(track);
142 G4double TG4Limits::GetMinEkineForNeutralHadron(const G4Track& track) const
144 // Returns the cut value for neutral hadron.
148 return fCutVector->GetMinEkineForNeutralHadron(track);
153 G4double TG4Limits::GetMinEkineForMuon(const G4Track& track) const
155 // Returns the cut value for neutral muon.
159 return fCutVector->GetMinEkineForMuon(track);
164 G4double TG4Limits::GetMinEkineForOther(const G4Track& track) const
172 G4int TG4Limits::GetControl(G4VProcess* process) const
174 // Returns the flag value for the particle associated with
175 // the specified process.
179 return fControlVector->GetControl(process);