Looking at the ‘\extended\optical\OpNovice’ example, the number of scintillation and Cerenkov photons generated during each event are summarized in the UserStackingAction::NewStage() function.
According to the manual, “the NewStage() function is invoked when the urgent stack is empty and the waiting stack contains at least one G4Track object.”
I can understand the NewStage() function is invoked at the end of an event, because the urgent stack will be empty by the time. However, I assume there are other cases when the urgent stack becomes empty in the middle of an event, which would also invoke the NewStage() function. Is it recommended to use the UserStackingAction::NewStage() function for summarizing an event, as is done in the ‘\extended\optical\OpNovice’ example?