4 // See the class description in the header file.
7 #include "TG4G3CutVector.h"
8 #include "TG4G3ControlVector.h"
12 const G4double TG4Limits::fgkDefaultMaxStep = 10*cm;
14 TG4Limits::TG4Limits()
16 // default values of G4UserLimits data members are set:
17 // fMaxStep (DBL_MAX), fMaxTrack(DBL_MAX),fMaxTime(DBL_MAX),
18 // fMinEkine(0.), fMinRange(0.)
23 fMaxStep = fgkDefaultMaxStep;
24 fCutVector = new TG4G3CutVector();
25 fControlVector = new TG4G3ControlVector();
28 TG4Limits::TG4Limits(const TG4Limits& right)
33 fCutVector = new TG4G3CutVector();
34 fControlVector = new TG4G3ControlVector();
40 TG4Limits::~TG4Limits() {
43 delete fControlVector;
48 TG4Limits& TG4Limits::operator=(const TG4Limits& right)
50 // check assignement to self
51 if (this == &right) return *this;
53 // base class assignement
54 G4UserLimits::operator=(right);
56 *fCutVector = *right.fCutVector;
57 *fControlVector = *right.fControlVector;
64 G4double TG4Limits::GetUserMinEkine(const G4Track& track)
66 // Returns the kinetic energy cut for the particle
67 // associated with the specified track.
71 return fCutVector->GetMinEkine(track);
78 void TG4Limits::SetG3Cut(TG4G3Cut cut, G4double cutValue)
80 // Sets the cut value for the specified cut.
83 fCutVector->SetG3Cut(cut, cutValue);
87 void TG4Limits::SetG3Control(TG4G3Control control, G4double flagValue)
89 // Sets the process control value for the specified flag.
92 fControlVector->SetG3Control(control, flagValue);
93 if (flagValue - kUnset > 0.01) fIsControl = true;
96 void TG4Limits::SetG3DefaultCuts()
98 // Sets the G3 default cut values for all cuts.
101 fCutVector->SetG3Defaults();
105 void TG4Limits::SetG3DefaultControls()
107 // Sets the G3 default process control values for all flags.
110 fControlVector->SetG3Defaults();
114 G4double TG4Limits::GetMinEkineForGamma(const G4Track& track) const
116 // Returns the cut value for gamma.
120 return fCutVector->GetMinEkine(track);
125 G4double TG4Limits::GetMinEkineForElectron(const G4Track& track) const
127 // Returns the cut value for e-.
131 return fCutVector->GetMinEkineForElectron(track);
136 G4double TG4Limits::GetMinEkineForHadron(const G4Track& track) const
138 // Returns the cut value for charged hadron.
142 return fCutVector->GetMinEkineForHadron(track);
147 G4double TG4Limits::GetMinEkineForNeutralHadron(const G4Track& track) const
149 // Returns the cut value for neutral hadron.
153 return fCutVector->GetMinEkineForNeutralHadron(track);
158 G4double TG4Limits::GetMinEkineForMuon(const G4Track& track) const
160 // Returns the cut value for neutral muon.
164 return fCutVector->GetMinEkineForMuon(track);
169 G4double TG4Limits::GetMinEkineForOther(const G4Track& track) const
177 G4int TG4Limits::GetControl(G4VProcess* process) const
179 // Returns the flag value for the particle associated with
180 // the specified process.
184 return fControlVector->GetControl(process);