Should I be able to set /tracking/verbose during event loop?

This is related to my request question about the event-loop macro. I want to turn on tracking verbosity for just a few events deep in a very long job. So I wrote the following macro:

/control/getVal EVENT /CDMS/getEventID
/tracking/verbose 0
/control/doif {EVENT} ==  150466 /tracking/verbose 1
/control/doif {EVENT} ==  263804 /tracking/verbose 1
[...]

where /CDMS/getEventID is a UI command we wrote ourselves to fetch the current event number in a way that is usable with GetCurrentValue().
I tested this with a simple /control/echo action which printed out exactly the selected events.

But the above action is not working: tracking verbosity is not being turned on. I checked that the TrackingManager instantiates its own TrackingMessenger, and the TrackingManager is created by the EventManager, and the EventManager is a thread-local singleton. So in principle, the macro command above should be applied to the specific thread in which it’s invoked.

Am I missing something? Or do I need to modify our simulation framework with a code block to do what I want to do in this special case, because you can’t use the macro command the way I want to use it?

After tracing through the code, and coming across the SetGuidance() calls for /run/beamOn, I found my answer. The optional event-loop macro is run at the end of the event, not the beginning. So verbosity settings have no effect.

To do what I want to do, I’ll have to modify our experiment’s CDMSEventAction::BeginOfEventAction() and associated Messenger to support a “before event macro” analogous to what G4RunManager supports.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.