Q-Pix / qpixg4

4 stars 11 forks source link

Unable to simulate supernova backgrounds #24

Open guigoruiz1 opened 7 months ago

guigoruiz1 commented 7 months ago

I am not sure whether it is a problem with Geant4 4.11 or the changes implemented in version 3.0.0, but I am unable to run simulations which use particle_type SUPERNOVA. The supernova class is initialised before the ConfigManager has the correct values from the macro. This causes the number of isotopes to simulate to be 0 when entering the loop.

Here is a macro for testing:

# set verbosity
/control/verbose 1
/run/verbose 1
/tracking/verbose 0

# configure supernova
/inputs/particle_type SUPERNOVA

# output path
/inputs/output_file ./output/radiogenic_Ar42_background.root

# initialize run
/run/initialize
/random/setSeeds 137 100

# event ID offset
/event/offset 0

# Supernova configs
/supernova/Event_Window 10 s
/supernova/Event_Cutoff 10 s

/supernova/N_Ar42_Decays 1

# run
/run/beamOn 10
kelseymh commented 7 months ago

@guigoruiz1 I have not had a chance to look at the code itself yet, but I do have a suggestion. I notice that you're doing your /supernova/... configurations after /run/initialize. Generally, runManager->Initialize() assumes that any kind of user configuration has been completed. I still have to go through the code to see if I'm correct in general, but you could test this quickly and see if we just need the documentation updated.

guigoruiz1 commented 7 months ago

@kelseymh I have tried that but unfortunately it doesn't work.