Belle II Software  release-05-01-25
SteppingAction.cc
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : SteppingAction.cc
5 // Section : TRG CDC
6 // Owner : Yoshihito Iwasaki
7 // Email : yoshihito.iwasaki@kek.jp
8 //-----------------------------------------------------------------------------
9 // Description : A class to control a track in G4
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #include "G4Step.hh"
15 #include "trg/cdc/SteppingAction.h"
16 
17 using namespace std;
18 
19 namespace Belle2 {
25  TRGCDCSteppingAction::TRGCDCSteppingAction()
26  {
27  }
28 
29  TRGCDCSteppingAction::~TRGCDCSteppingAction()
30  {
31  }
32 
33  void
34  TRGCDCSteppingAction::UserSteppingAction(const G4Step* aStep)
35  {
36  const G4StepPoint& in = * aStep->GetPreStepPoint();
37  const G4StepPoint& out = * aStep->GetPostStepPoint();
38  const double rIn = in.GetPosition().r();
39  const double rOut = out.GetPosition().r();
40  const bool curlBack = rIn > rOut;
41  if (curlBack)
42  aStep->GetTrack()->SetTrackStatus(fKillTrackAndSecondaries);
43  };
44 
46 } // namespace Belle2
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19