]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliSteppingAction.h
Initial version
[u/mrichter/AliRoot.git] / AliGeant4 / AliSteppingAction.h
1 // $Id$
2 // Category: event
3 //
4 // Class for detecting and stopping looping particles
5 // or particles that reached maximal number of steps.
6
7 #ifndef ALI_STEPPING_ACTION_H
8 #define ALI_STEPPING_ACTION_H
9
10 #include <G4UserSteppingAction.hh>
11 #include <G4ThreeVector.hh>
12 #include <globals.hh>
13
14 class AliSteppingActionMessenger;
15
16 class G4Track;
17
18 class AliSteppingAction : public G4UserSteppingAction
19 {
20   enum { 
21     kCheckNofSteps = 100,
22     kMaxNofLoopSteps = 5,
23     kMaxNofSteps = 5000
24   };
25
26   public:
27     AliSteppingAction();
28     // protected
29     // AliSteppingAction(const AliSteppingAction& right);
30     virtual ~AliSteppingAction();
31
32     // methods
33     virtual void UserSteppingAction(const G4Step* step);
34     
35     // set methods
36     void SetLoopVerboseLevel(G4int level);
37     
38     // get methods
39     G4int GetLoopVerboseLevel() const;
40
41   protected:
42     AliSteppingAction(const AliSteppingAction& right);
43
44     // operators
45     AliSteppingAction& operator=(const AliSteppingAction& right);
46
47   private:
48     // methods
49     void PrintTrackInfo(const G4Track* track) const;
50   
51     // static data members
52     static const G4double fgkTolerance;    //tolerance used in detecting 
53                                            //of looping particles
54
55     // data members
56     G4ThreeVector   fKeptStepPoint;        //kept step point
57     G4int           fLoopVerboseLevel;     //tracking verbose level
58                                            //for looping particles
59     G4int           fStandardVerboseLevel; //standard tracking verbose level
60     G4int           fLoopStepCounter;      //loop steps counter
61     AliSteppingActionMessenger*  fMessenger;  //messenger
62 };
63
64 // inline methods
65
66 inline void AliSteppingAction::SetLoopVerboseLevel(G4int level)
67 { fLoopVerboseLevel = level; }
68
69 inline G4int AliSteppingAction::GetLoopVerboseLevel() const
70 { return fLoopVerboseLevel; }
71
72 #endif //ALI_STEPPING_ACTION_H
73