|Message: Re: Behaivor of tracks with fWaiting_N classification||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
> > I am using some extra waiting track stacks such as those that correspond > to fWaiting_1 and fWaiting_2 track classifications. These are created by > for example doing runManager->SetNumberOfAdditionalWaitingStacks(1); in > my Stacking Action constructor. I see that there is an already > pre-existing default waiting stack in Geant4 corresponding to the > fWaiting classification but I need some extra waiting stacks in addition > to the default one. By executing the application, I see that even if the > fUrgent stack is empty, the simulation will continue by grabbing tracks > from the fWaiting stack, putting them into the fUrgent stack, and > simulating the new tracks brought into the fUrgent stack. > > My problem is this. When the fUrgent and the fWaiting stack are both > empty, the simulation terminates. This happens even if there are tracks > in the fWaiting_1 or fWaiting_2 stacks. > > My two questions are: Is this intended to happen? Where can I find > examples using track stacks with fWaiting_N and N > 0? >
When Urgent stack becomes empty, tracks in Waiting stack are transferred to Urgent stack. Also, if you have extra waiting stacks, tracks in extra waiting stack #1 are transferred to Waiting stack, tracks in extra waiting stack #2 are transferred to extra waiting Stack #1, and so forth. After these transfers, G4StackManager examines number of tracks in Urgent and Waiting stacks, and if both are empty, an event is over. This is the feature we implemented. Thus, it is true that if Waiting stack and extra waiting stack #1 are both empty when the Urgent stack becomes empty, the even is over even if there are tracks in yet another extra waiting stacks.
But prior to the termination of the event, G4UserStackingAction::NewStage() is invoked. This is your code. Here, you may re-classify all the tracks in the extra waiting stacks and re-distribute them to Urgent and/or ordinary Waiting stacks to avoid the termination of the event.
Please note that, when NewStage() method is invoked, transferring tracks from extra Waiting stack #N to extra Waiting stack #(N-1) has alreadt taken place.
Hope this helps, Makoto