-
Notifications
You must be signed in to change notification settings - Fork 0
Re-Simulation Processor #49
Re-Simulation Processor #49
Comments
I started looking into this a bit myself for my personal work. As far as I can tell, the output that we store in the I've tried to see if you can rescue thing with the existing Have you any thoughts on this @tomeichlersmith ? |
For context, what I'm doing for my purposes is something morally equivalent to:
G4Random::saveFullState(seedStream);
|
First of all, I agree that moving the recording of the RNG state to the start of the event is key. I think, in general, my long term view is to write a separate processor for handling re-simulations. Separate ReSim ClassI think we need a separate
For implementation, I'd have an abstract base that both |
Yeah, I just wanted to be clear about what I was doing for my needs and that it looks like picking the seed in a different place is enough for reproducing most basic events, I agree that dumping things to a random file isn't what we want :) A base class approach was what I had in mind. I think to get started, the check for ensuring the same primary generator/detector can be left for later (and detector, I guess actually we wouldn't want to keep the same in most use-cases). I haven't written this yet, as this has been enough for what I need right now but I think I could give it a go some time this week since I'm working on related things anyway. |
One question would be, do we know if anyone is currently using the One concern would be that we'd be reading that stream once for every attempted event but I think that overhead is relatively small compared with the rest of the Geant4 processing. |
I am not aware of anyone using the |
Ok, I'll see what I can do for this. If a resim processor works, would there be any purpose to keeping the rootCompleteReSim generator? It would change its behavior but afaik that behaviour is wrong anyway right now |
No - that generator would be removed. The ResimFromEcalSP generator would be kept around to (hopefully) enable re-sim of particles leaving the ECal to make studying different HCal geometries more efficient, but that is a much more complicated problem since it is attempting to start an event in the middle of it. |
We already have two generators that require an input file formatted the same as our event files and these generators attempt to restore the configuration of the random number generator in Geant4 at the time of the first simulation.
I've been trying to use these generators to do some re-sim and it isn't working.
I think this is because the
Simulator
processor is designed to be the first Producer in a production chain. I think we can get around this issue by writing another processor that is specifically focused on re-simulation. This processor would be designed to provide the current event bus to other simulation parts before starting the simulation, so that Geant4 can be reconfigured the same. Then we can run theReSimulator
processor as the first Producer in an analysis chain.This will probably require some modifications to other parts of our simulation infrastructure. Another potential solution is to try to have the
Simulator
work for both running modes; however, I ran into issues trying a few "easy" fixes, so I think separating them will be easier.The text was updated successfully, but these errors were encountered: