Skip to content
Snippets Groups Projects
Commit ec52a20a authored by Chad Lantz's avatar Chad Lantz
Browse files

Changed from having multiple OPTICAL flag behaviors to just killing any photons outside of an SD

parent 5bfa11ed
No related branches found
No related tags found
No related merge requests found
......@@ -66,28 +66,16 @@ 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
}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() ){
if(!sd){
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 );
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment