]>
Commit | Line | Data |
---|---|---|
1 | // $Id$ | |
2 | // Category: event | |
3 | // | |
4 | // Author: I. Hrivnacova | |
5 | // | |
6 | // Class AliSteppingAction | |
7 | // ----------------------- | |
8 | // See the class description in the header file. | |
9 | ||
10 | #include "AliSteppingAction.h" | |
11 | #include "AliRun.h" | |
12 | ||
13 | #include <G4Track.hh> | |
14 | #include <G4SteppingManager.hh> | |
15 | ||
16 | #include <math.h> | |
17 | ||
18 | //_____________________________________________________________________________ | |
19 | AliSteppingAction::AliSteppingAction() | |
20 | : TG4SteppingAction(), | |
21 | fMessenger(this) { | |
22 | // | |
23 | } | |
24 | ||
25 | //_____________________________________________________________________________ | |
26 | AliSteppingAction::~AliSteppingAction() { | |
27 | // | |
28 | } | |
29 | ||
30 | // public methods | |
31 | ||
32 | //_____________________________________________________________________________ | |
33 | void AliSteppingAction::SteppingAction(const G4Step* step) | |
34 | { | |
35 | // Stops particle if it gets outside of user defined tracking region. | |
36 | // --- | |
37 | ||
38 | G4ThreeVector position | |
39 | = step->GetPostStepPoint()->GetPosition(); | |
40 | ||
41 | if (position.mag() > gAlice->TrackingRmax() || | |
42 | abs(position.z()) > gAlice->TrackingZmax()) { | |
43 | ||
44 | // print looping info | |
45 | if (fLoopVerboseLevel > 0) { | |
46 | G4cout << "*** Particle has reached user defined tracking region. ***" | |
47 | << G4endl; | |
48 | if (fStandardVerboseLevel == 0) PrintTrackInfo(step->GetTrack()); | |
49 | } | |
50 | ||
51 | // stop the track | |
52 | step->GetTrack()->SetTrackStatus(fStopAndKill); | |
53 | } | |
54 | } |