Belle II Software development
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
16using namespace std;
17
18namespace Belle2 {
25 {
26 }
27
29 {
30 }
31
32 void
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
virtual void UserSteppingAction(const G4Step *)
Stepping action to control a step in G4.
virtual ~TRGCDCSteppingAction()
Destructor.
Abstract base class for different kinds of events.
STL namespace.