]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: global | |
3 | // | |
e5967ab3 | 4 | // Author: I. Hrivnacova |
5 | // | |
6 | // Class TG4Limits | |
7 | // --------------- | |
8 | // G4UserLimits derived class extended with the | |
2817d3e2 | 9 | // vectors of kinetic energy cuts and control process flags |
e5967ab3 | 10 | // data members. |
2817d3e2 | 11 | |
12 | #ifndef TG4_LIMITS_H | |
13 | #define TG4_LIMITS_H | |
14 | ||
15 | #include "TG4Globals.h" | |
6eb43d7c | 16 | #include "TG4G3Cut.h" |
17 | #include "TG4G3Control.h" | |
e5967ab3 | 18 | #include "TG4G3CutVector.h" |
19 | #include "TG4G3ControlVector.h" | |
2817d3e2 | 20 | |
21 | #include <G4UserLimits.hh> | |
22 | ||
2817d3e2 | 23 | class G4VProcess; |
24 | ||
25 | class TG4Limits: public G4UserLimits | |
26 | { | |
27 | public: | |
e5967ab3 | 28 | TG4Limits(const TG4G3CutVector& cuts, const TG4G3ControlVector& controls); |
29 | TG4Limits(const G4String& name, | |
30 | const TG4G3CutVector& cuts, const TG4G3ControlVector& controls); | |
2817d3e2 | 31 | TG4Limits(const TG4Limits& right); |
32 | virtual ~TG4Limits(); | |
33 | ||
34 | // operators | |
35 | TG4Limits& operator=(const TG4Limits& right); | |
e5967ab3 | 36 | |
37 | // static methods | |
38 | static G4int GetNofLimits(); | |
2817d3e2 | 39 | |
40 | // set methods | |
e5967ab3 | 41 | void SetName(const G4String& name); |
6eb43d7c | 42 | void SetG3Cut(TG4G3Cut cut, G4double cutValue); |
e5967ab3 | 43 | void SetG3Control(TG4G3Control control, TG4G3ControlValue controlValue); |
44 | G4bool Update(const TG4G3ControlVector& controls); | |
2817d3e2 | 45 | void SetG3DefaultCuts(); |
6eb43d7c | 46 | void SetG3DefaultControls(); |
2817d3e2 | 47 | |
e5967ab3 | 48 | // methods |
49 | void Print() const; | |
50 | ||
2817d3e2 | 51 | // get methods |
e5967ab3 | 52 | G4String GetName() const; |
ac498928 | 53 | const TG4G3CutVector* GetCutVector() const; |
54 | const TG4G3ControlVector* GetControlVector() const; | |
e5967ab3 | 55 | G4bool IsCut() const; |
56 | G4bool IsControl() const; | |
2817d3e2 | 57 | virtual G4double GetUserMinEkine(const G4Track& track); |
58 | G4double GetMinEkineForGamma(const G4Track& track) const; | |
59 | G4double GetMinEkineForElectron(const G4Track& track) const; | |
e5967ab3 | 60 | G4double GetMinEkineForEplus(const G4Track& track) const; |
61 | G4double GetMinEkineForChargedHadron(const G4Track& track) const; | |
2817d3e2 | 62 | G4double GetMinEkineForNeutralHadron(const G4Track& track) const; |
63 | G4double GetMinEkineForMuon(const G4Track& track) const; | |
64 | G4double GetMinEkineForOther(const G4Track& track) const; | |
e5967ab3 | 65 | TG4G3ControlValue GetControl(G4VProcess* process) const; |
66 | ||
67 | protected: | |
68 | TG4Limits(); | |
2817d3e2 | 69 | |
70 | private: | |
e5967ab3 | 71 | // methods |
72 | void Initialize(const TG4G3CutVector& cuts, | |
73 | const TG4G3ControlVector& controls); | |
74 | ||
015b87e4 | 75 | // static data members |
98c988ce | 76 | static const G4double fgkDefaultMaxStep; // default max step value |
e5967ab3 | 77 | static G4int fgCounter; // counter |
015b87e4 | 78 | |
2817d3e2 | 79 | // data members |
e5967ab3 | 80 | G4String fName; //name |
98c988ce | 81 | G4bool fIsCut; //true if any cut value is set |
e5967ab3 | 82 | G4bool fIsControl; //true if any control value is set |
83 | TG4G3CutVector fCutVector; //TG4CutVector | |
84 | TG4G3ControlVector fControlVector;//TG4ControlVector | |
2817d3e2 | 85 | }; |
86 | ||
87 | // inline methods | |
88 | ||
e5967ab3 | 89 | inline G4int TG4Limits::GetNofLimits() |
90 | { return fgCounter; } | |
91 | ||
92 | inline G4bool TG4Limits::IsCut() const | |
93 | { return fIsCut; } | |
94 | ||
95 | inline G4bool TG4Limits::IsControl() const | |
96 | { return fIsControl; } | |
97 | ||
98 | inline void TG4Limits::SetName(const G4String& name) | |
99 | { fName = name; } | |
100 | ||
101 | inline G4String TG4Limits::GetName() const | |
102 | { return fName; } | |
2817d3e2 | 103 | |
ac498928 | 104 | inline const TG4G3CutVector* TG4Limits::GetCutVector() const |
105 | { return &fCutVector; } | |
106 | ||
107 | inline const TG4G3ControlVector* TG4Limits::GetControlVector() const | |
108 | { return &fControlVector; } | |
109 | ||
2817d3e2 | 110 | #endif //TG4_USER_LIMITS_H |
111 | ||
112 | ||
113 |