Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Riccardo Longo
JZCaPA
Commits
ec52a20a
Commit
ec52a20a
authored
Mar 10, 2022
by
Chad Lantz
Browse files
Changed from having multiple OPTICAL flag behaviors to just killing any photons outside of an SD
parent
5bfa11ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
MonteCarlo/src/SteppingAction.cc
View file @
ec52a20a
...
...
@@ -66,27 +66,15 @@ void SteppingAction::UserSteppingAction(__attribute__((unused)) const G4Step* th
}
//If we are tracking a gamma that came from the primary event
if
(
PI0
&&
theTrack
->
GetParentID
()
==
1
&&
theTrack
->
GetCurrentStepNumber
()
==
1
&&
theTrack
->
GetDefinition
()
==
G4Gamma
::
GammaDefinition
()
){
m_Pi0Mom
->
push_back
(
theTrack
->
GetVertexMomentumDirection
()
);
m_Pi0Vert
->
push_back
(
theTrack
->
GetVertexPosition
()
);
}
else
if
(
theTrack
->
GetDefinition
()
==
G4OpticalPhoton
::
OpticalPhotonDefinition
()
){
// If we are tracking an optical photon
// Get the SD for the volume we're in. Returns 0 if we aren't in an SD volume
if
(
PI0
&&
theTrack
->
GetParentID
()
==
1
&&
theTrack
->
GetCurrentStepNumber
()
==
1
&&
theTrack
->
GetDefinition
()
==
G4Gamma
::
GammaDefinition
()
){
m_Pi0Mom
->
push_back
(
theTrack
->
GetVertexMomentumDirection
()
);
m_Pi0Vert
->
push_back
(
theTrack
->
GetVertexPosition
()
);
}
else
if
(
theTrack
->
GetDefinition
()
==
G4OpticalPhoton
::
OpticalPhotonDefinition
()
){
//If the particle is an optical photon outside of any SDs, kill it.
FiberSD
*
sd
=
(
FiberSD
*
)
theTrack
->
GetVolume
()
->
GetLogicalVolume
()
->
GetSensitiveDetector
();
// If World OPTICAL is on
if
(
OPTICAL
){
// Kill photons only in SD volumes with OPTICAL off
if
(
sd
!=
0
&&
!
sd
->
OpticalIsOn
()
){
theTrack
->
SetTrackStatus
(
fStopAndKill
);
}
}
else
{
// World OPTICAL is off
// Kill all photons except those in SD volumes with OPTICAL on
if
(
sd
==
0
||
!
sd
->
OpticalIsOn
()
){
theTrack
->
SetTrackStatus
(
fStopAndKill
);
}
if
(
!
sd
){
theTrack
->
SetTrackStatus
(
fStopAndKill
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment