Belle II Software development
ExtMagFieldLimitProcess Class Reference

Defines the physics process that avoids hit invocation in sensitive volumes. More...

#include <ExtMagFieldLimitProcess.h>

Inheritance diagram for ExtMagFieldLimitProcess:

Public Member Functions

 ExtMagFieldLimitProcess (const G4String &processName="ExtMagFieldLimitProcess")
 constructor
 
 ~ExtMagFieldLimitProcess ()
 destructor
 
G4VParticleChange * PostStepDoIt (const G4Track &, const G4Step &)
 Do nothing special after the particle has stepped.
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &, G4double, G4ForceCondition *)
 Returns the step length after each step.
 
G4double GetMeanFreePath (const G4Track &, G4double, G4ForceCondition *)
 Returns the mean free path (always infinity!) after each step.
 
G4double GetStepLimit () const
 Returns the step limit.
 
void SetStepLimit (G4double val)
 Sets the step limit.
 

Protected Attributes

const G4Field * m_field
 Stores the pointer to the magnetic field class.
 
G4double m_stepLimit
 Stores the step limit.
 

Detailed Description

Defines the physics process that avoids hit invocation in sensitive volumes.

Definition at line 27 of file ExtMagFieldLimitProcess.h.

Constructor & Destructor Documentation

◆ ExtMagFieldLimitProcess()

ExtMagFieldLimitProcess ( const G4String &  processName = "ExtMagFieldLimitProcess")
explicit

constructor

Definition at line 22 of file ExtMagFieldLimitProcess.cc.

22 :
23 G4VDiscreteProcess(processName),
24 m_stepLimit(kInfinity) // user may change this with a geant4 UI command
25{
26 m_field = G4TransportationManager::GetTransportationManager()->GetFieldManager()->GetDetectorField();
27 if (false) {
28 G4Track aTrack;
29 G4Step aStep;
30 G4ForceCondition* condition = nullptr;
31 GetMeanFreePath(aTrack, 0.0, condition);
32 PostStepDoIt(aTrack, aStep);
33 PostStepGetPhysicalInteractionLength(aTrack, 0.0, condition);
34 }
35
36}
const G4Field * m_field
Stores the pointer to the magnetic field class.
G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *)
Returns the mean free path (always infinity!) after each step.
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double, G4ForceCondition *)
Returns the step length after each step.
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
Do nothing special after the particle has stepped.

◆ ~ExtMagFieldLimitProcess()

destructor

Definition at line 38 of file ExtMagFieldLimitProcess.cc.

39{
40}

Member Function Documentation

◆ GetMeanFreePath()

G4double GetMeanFreePath ( const G4Track &  ,
G4double  ,
G4ForceCondition *   
)

Returns the mean free path (always infinity!) after each step.

Definition at line 42 of file ExtMagFieldLimitProcess.cc.

43{
44 return kInfinity;
45}

◆ GetStepLimit()

G4double GetStepLimit ( ) const
inline

Returns the step limit.

Definition at line 47 of file ExtMagFieldLimitProcess.h.

47{ return m_stepLimit; }

◆ PostStepDoIt()

G4VParticleChange * PostStepDoIt ( const G4Track &  track,
const G4Step &   
)

Do nothing special after the particle has stepped.

Definition at line 69 of file ExtMagFieldLimitProcess.cc.

70{
71 aParticleChange.Initialize(track);
72 return &aParticleChange;
73}

◆ PostStepGetPhysicalInteractionLength()

G4double PostStepGetPhysicalInteractionLength ( const G4Track &  aTrack,
G4double  ,
G4ForceCondition *  condition 
)

Returns the step length after each step.

Definition at line 48 of file ExtMagFieldLimitProcess.cc.

49{
50 *condition = NotForced;
51 G4double stepLength = kInfinity;
52 if (m_field != 0) {
53 G4ThreeVector trkPosi = aTrack.GetPosition();
54 G4double pos1[3] = { trkPosi.x(), trkPosi.y(), trkPosi.z() };
55 G4double h1[3] = { 0.0, 0.0, 0.0 };
56 m_field->GetFieldValue(pos1, h1);
57 G4ThreeVector BVec(h1[0], h1[1], h1[2]);
58 G4double pmag = aTrack.GetMomentum().mag();
59 G4double BPerpMom = BVec.cross(aTrack.GetMomentum()).mag() / pmag; // LEP
60 if (BPerpMom != 0.0) {
61 stepLength = m_stepLimit * pmag / BPerpMom;
62 }
63 B2DEBUG(300, "ExtMagFieldLimitProcess::PostStepGetPhysicalInteractionLength() stepLength "
64 << stepLength << " B " << BPerpMom << " BVec " << BVec << " pmag " << pmag);
65 }
66 return stepLength;
67}

◆ SetStepLimit()

void SetStepLimit ( G4double  val)
inline

Sets the step limit.

Definition at line 50 of file ExtMagFieldLimitProcess.h.

50{ m_stepLimit = val; }

Member Data Documentation

◆ m_field

const G4Field* m_field
protected

Stores the pointer to the magnetic field class.

Definition at line 55 of file ExtMagFieldLimitProcess.h.

◆ m_stepLimit

G4double m_stepLimit
protected

Stores the step limit.

Definition at line 58 of file ExtMagFieldLimitProcess.h.


The documentation for this class was generated from the following files: