Summarizing an event in UserStackingAction::NewStage()

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?

1 Like

I suspect not :smiley: I would think that UserEventAction::EndOfEventAction() is a more suitable place for this. Do not take my opinion as authoritative, I am mostly trying to exploit Cunningham’s law.

1 Like