Belle II Software  release-08-01-10
SteppingAction.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 //-----------------------------------------------------------------------------
10 // Description : A class to control a track in G4
11 //-----------------------------------------------------------------------------
12 
13 #include "G4Step.hh"
14 #include "trg/cdc/SteppingAction.h"
15 
16 using namespace std;
17 
18 namespace Belle2 {
24  TRGCDCSteppingAction::TRGCDCSteppingAction()
25  {
26  }
27 
28  TRGCDCSteppingAction::~TRGCDCSteppingAction()
29  {
30  }
31 
32  void
33  TRGCDCSteppingAction::UserSteppingAction(const G4Step* aStep)
34  {
35  const G4StepPoint& in = * aStep->GetPreStepPoint();
36  const G4StepPoint& out = * aStep->GetPostStepPoint();
37  const double rIn = in.GetPosition().r();
38  const double rOut = out.GetPosition().r();
39  const bool curlBack = rIn > rOut;
40  if (curlBack)
41  aStep->GetTrack()->SetTrackStatus(fKillTrackAndSecondaries);
42  };
43 
45 } // namespace Belle2
Abstract base class for different kinds of events.