-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStepCut.hh
90 lines (63 loc) · 2.12 KB
/
StepCut.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef StepCut_h
#define StepCut_h 1
#include "G4VDiscreteProcess.hh"
class StepCut : public G4VDiscreteProcess
{
public:
StepCut(const G4String& processName ="UserStepCut" );
StepCut(StepCut &);
virtual ~StepCut();
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track&,
const G4Step&
);
void SetMaxStep(G4double);
protected:
// it is not needed here !
virtual G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition
);
private:
// hide assignment operator as private
StepCut & operator=(const StepCut &right);
private:
G4double fMaxChargedStep;
};
// inlined function members implementation
inline G4double StepCut::PostStepGetPhysicalInteractionLength(
const G4Track& aTrack,
G4double,
G4ForceCondition* condition)
{
// condition is set to "Not Forced"
*condition = NotForced;
G4double proposedStep = DBL_MAX;
if((fMaxChargedStep > 0.) &&
(aTrack.GetVolume() != 0) &&
(aTrack.GetVolume()->GetName() == "Absorber") &&
(aTrack.GetDynamicParticle()->GetDefinition()->GetPDGCharge() != 0.))
proposedStep = fMaxChargedStep;
return proposedStep;
}
inline G4VParticleChange* StepCut::PostStepDoIt(
const G4Track& aTrack,
const G4Step&
)
{
// do nothing
aParticleChange.Initialize(aTrack);
return &aParticleChange;
}
inline G4double StepCut::GetMeanFreePath(const G4Track&,
G4double,
G4ForceCondition*)
{
return 0.;
}
#endif