-
Notifications
You must be signed in to change notification settings - Fork 13
Description
At the moment, we send optical photons to the waiting stack and track them at the end only if there is an energy deposition in germanium with the desired energy:
remage/src/RMGGermaniumOutputScheme.cc
Lines 361 to 385 in af65926
| std::optional<G4ClassificationOfNewTrack> RMGGermaniumOutputScheme::StackingActionClassify( | |
| const G4Track* aTrack, | |
| int stage | |
| ) { | |
| // we are only interested in stacking optical photons into stage 1 after stage 0 finished. | |
| if (stage != 0) return std::nullopt; | |
| // defer tracking of optical photons. | |
| if (fDiscardPhotonsIfNoGermaniumEdep && | |
| aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition()) | |
| return fWaiting; | |
| return std::nullopt; | |
| } | |
| std::optional<bool> RMGGermaniumOutputScheme::StackingActionNewStage(const int stage) { | |
| // we are only interested in stacking optical photons into stage 1 after stage 0 finished. | |
| if (stage != 0) return std::nullopt; | |
| // if we do not want to discard any photons ourselves, let other output schemes decide (i.e. not | |
| // force `true` on them). | |
| if (!fDiscardPhotonsIfNoGermaniumEdep) return std::nullopt; | |
| const auto event = G4EventManager::GetEventManager()->GetConstCurrentEvent(); | |
| // discard all waiting events, if there was no energy deposition in Germanium. | |
| return ShouldDiscardEvent(event) ? std::make_optional(false) : std::nullopt; | |
| } |
Still, just stacking itself seems to slow down the simulation quite a bit. We should try to understand if we can be even smarter and avoid stacking photons in some situations. For example, if the energy deposited in argon is above a certain threshold far enough from any other surface.
All of this should of course carefully validated. Any other idea?
Metadata
Metadata
Assignees
Type
Projects
Status
No status