Belle II Software  release-05-02-19
ExtStepLengthLimitProcess.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2011 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Leo Piilonen *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef EXTSTEPLENGTHLIMITPROCESS_H_
12 #define EXTSTEPLENGTHLIMITPROCESS_H_
13 
14 #include <globals.hh>
15 #include "G4VDiscreteProcess.hh"
16 
17 class G4Track;
18 
19 namespace Belle2 {
25  namespace Simulation {
26 
28  class ExtStepLengthLimitProcess: public G4VDiscreteProcess {
29 
30  public:
31 
33  explicit ExtStepLengthLimitProcess(const G4String& processName = "ExtStepLengthLimitProcess");
34 
37 
39  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
40 
42  G4double PostStepGetPhysicalInteractionLength(const G4Track&, G4double, G4ForceCondition*);
43 
45  G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*);
46 
48  G4double GetStepLimit() const { return m_stepLimit; }
49 
51  void SetStepLimit(G4double val) { m_stepLimit = val; }
52 
53  protected:
54 
56  G4double m_stepLimit;
57 
58  };
59 
60  inline G4double ExtStepLengthLimitProcess::PostStepGetPhysicalInteractionLength(const G4Track&, G4double,
61  G4ForceCondition* condition)
62  {
63  *condition = Forced; // PostStepDoIt() must be called after each step
64  return m_stepLimit;
65  }
66 
67  inline G4double ExtStepLengthLimitProcess::GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*)
68  {
69  return kInfinity;
70  }
71 
72 
73  } //end namespace Simulation
74 
76 } //end Belle2 namespace
77 
78 #endif /* EXTSTEPLENGTHLIMITPROCESS_H_ */
Belle2::Simulation::ExtStepLengthLimitProcess::PostStepGetPhysicalInteractionLength
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double, G4ForceCondition *)
Returns the step length after each step.
Definition: ExtStepLengthLimitProcess.h:60
Belle2::Simulation::ExtStepLengthLimitProcess::PostStepDoIt
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
See if the particle has left the geant4e "target" volume.
Definition: ExtStepLengthLimitProcess.cc:29
Belle2::Simulation::ExtStepLengthLimitProcess::GetStepLimit
G4double GetStepLimit() const
Returns the step limit.
Definition: ExtStepLengthLimitProcess.h:48
Belle2::Simulation::ExtStepLengthLimitProcess::SetStepLimit
void SetStepLimit(G4double val)
Sets the step limit.
Definition: ExtStepLengthLimitProcess.h:51
Belle2::Simulation::ExtStepLengthLimitProcess::ExtStepLengthLimitProcess
ExtStepLengthLimitProcess(const G4String &processName="ExtStepLengthLimitProcess")
constructor
Definition: ExtStepLengthLimitProcess.cc:19
Belle2::Simulation::ExtStepLengthLimitProcess
Defines the physics process that avoids hit invocation in sensitive volumes.
Definition: ExtStepLengthLimitProcess.h:28
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Simulation::ExtStepLengthLimitProcess::m_stepLimit
G4double m_stepLimit
Stores the step limit.
Definition: ExtStepLengthLimitProcess.h:56
Belle2::Simulation::ExtStepLengthLimitProcess::GetMeanFreePath
G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
Returns the mean free path for this process.
Definition: ExtStepLengthLimitProcess.h:67
Belle2::Simulation::ExtStepLengthLimitProcess::~ExtStepLengthLimitProcess
~ExtStepLengthLimitProcess()
destructor
Definition: ExtStepLengthLimitProcess.cc:25