]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/AliSteppingAction.cxx
Moved from exa
[u/mrichter/AliRoot.git] / AliGeant4 / AliSteppingAction.cxx
CommitLineData
676fb573 1// $Id$
2// Category: event
3//
30bf1ed6 4// Author: I. Hrivnacova
5//
6// Class AliSteppingAction
7// -----------------------
676fb573 8// See the class description in the header file.
9
10#include "AliSteppingAction.h"
30bf1ed6 11#include "AliRun.h"
676fb573 12
13#include <G4Track.hh>
14#include <G4SteppingManager.hh>
15
30bf1ed6 16#include <math.h>
676fb573 17
78ca1e9c 18//_____________________________________________________________________________
676fb573 19AliSteppingAction::AliSteppingAction()
30bf1ed6 20 : TG4SteppingAction(),
21 fMessenger(this) {
676fb573 22//
676fb573 23}
24
78ca1e9c 25//_____________________________________________________________________________
676fb573 26AliSteppingAction::~AliSteppingAction() {
27//
676fb573 28}
29
676fb573 30// public methods
31
78ca1e9c 32//_____________________________________________________________________________
9bcb6317 33void AliSteppingAction::SteppingAction(const G4Step* step)
676fb573 34{
30bf1ed6 35// Stops particle if it gets outside of user defined tracking region.
676fb573 36// ---
37
30bf1ed6 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());
676fb573 49 }
30bf1ed6 50
51 // stop the track
52 step->GetTrack()->SetTrackStatus(fStopAndKill);
53 }
676fb573 54}