Read Messengers Pre-Initialization

Hi!

I’m putting together some custom messengers to define the parameters of my histograms initialized in my RunAction constructor. I’m having issues in the workflow of Geant4, in that the messengers don’t seem to be read until AFTER the histograms are initialized (hence, they won’t initialize without default values which then won’t be overwritten in time to be implemented).

Is there a way to get the messenger inputs to be read before the histograms are initialized? I’ve tried defining the messengers to be for the PreInit state but this has not solved the issue, so any thoughts would be helpful :slight_smile:

Thanks!

Hello,

Do you use Geant4 analysis manager for your histograms ? If yes, you can define you histogram parameters with the /analysis/hn/set command.

If not, then we would need to know more details about your messenger classes; especially in which class/method they are created.

Best regards,