]>
Commit | Line | Data |
---|---|---|
6fc5df41 | 1 | // $Id$ |
2 | // Category: event | |
3 | // | |
499b353a | 4 | // Author: I.Hrivnacova |
5 | // | |
6 | // Class TG4SteppingAction | |
7 | // ----------------------- | |
8 | // This class ensures additional call to sensitive detector | |
9 | // when track crosses a geometrical boundary. | |
10 | // It also enables to define a maximum number of steps | |
11 | // and takes care of stopping of a track when this number | |
12 | // is reached. | |
6fc5df41 | 13 | |
14 | #ifndef TG4_STEPPING_ACTION_H | |
15 | #define TG4_STEPPING_ACTION_H | |
16 | ||
17 | #include <G4UserSteppingAction.hh> | |
6fc5df41 | 18 | |
4148f156 | 19 | #include <globals.hh> |
20 | ||
21 | class G4Track; | |
6fc5df41 | 22 | class G4Step; |
23 | ||
24 | class TG4SteppingAction : public G4UserSteppingAction | |
25 | { | |
4148f156 | 26 | enum { |
154f8f7b | 27 | kMaxNofSteps = 30000, |
4148f156 | 28 | kMaxNofLoopSteps = 5 |
29 | }; | |
30 | ||
6fc5df41 | 31 | public: |
32 | TG4SteppingAction(); | |
33 | // --> protected | |
34 | // TG4SteppingAction(const TG4SteppingAction& right); | |
35 | virtual ~TG4SteppingAction(); | |
36 | ||
37 | // methods | |
38 | virtual void SteppingAction(const G4Step* step) {;} | |
39 | // the following method should not | |
40 | // be overwritten in a derived class | |
41 | virtual void UserSteppingAction(const G4Step* step); | |
42 | ||
4148f156 | 43 | // set methods |
44 | void SetLoopVerboseLevel(G4int level); | |
45 | void SetMaxNofSteps(G4int number); | |
46 | ||
47 | // get methods | |
48 | G4int GetLoopVerboseLevel() const; | |
49 | G4int GetMaxNofSteps() const; | |
6fc5df41 | 50 | |
51 | protected: | |
52 | TG4SteppingAction(const TG4SteppingAction& right); | |
53 | ||
54 | // operators | |
55 | TG4SteppingAction& operator=(const TG4SteppingAction& right); | |
4148f156 | 56 | |
57 | // methods | |
58 | void PrintTrackInfo(const G4Track* track) const; | |
59 | ||
60 | // data members | |
61 | G4int fMaxNofSteps; //max number of steps allowed | |
62 | G4int fStandardVerboseLevel; //standard tracking verbose level | |
63 | G4int fLoopVerboseLevel; //tracking verbose level //for looping particles | |
64 | //for looping particles | |
65 | G4int fLoopStepCounter; //loop steps counter | |
6fc5df41 | 66 | }; |
67 | ||
4148f156 | 68 | // inline methods |
69 | ||
70 | inline void TG4SteppingAction::SetLoopVerboseLevel(G4int level) | |
71 | { fLoopVerboseLevel = level; } | |
72 | ||
73 | inline void TG4SteppingAction::SetMaxNofSteps(G4int number) | |
74 | { fMaxNofSteps = number; } | |
75 | ||
76 | inline G4int TG4SteppingAction::GetMaxNofSteps() const | |
77 | { return fMaxNofSteps; } | |
78 | ||
79 | inline G4int TG4SteppingAction::GetLoopVerboseLevel() const | |
80 | { return fLoopVerboseLevel; } | |
81 | ||
6fc5df41 | 82 | #endif //TG4_STEPPING_ACTION_H |