dguff / G4SOLAr

MIT License
1 stars 0 forks source link

Major generator refactoring #53

Closed dguff closed 5 months ago

dguff commented 7 months ago

I think I have come up with a better design of the primary generator action in the simulation: Now all the generators inherit from a common SLArBaseGenerator class, this making possible to have a generation methods common to all generators. image Also, each generator now owns its vertex generator, these also inheriting from a common abstract base class image

The new design allows one to run multiple generators in the same event (eg, cosmic + GENIE + radiogenic +... ). Downside of this is that the configuration has become a bit less immediate (no macro command yet). Instead, generators are now configured in yet another json file (you will find examples in the /assets/macros/). Each generator has to be defined by its type (marley, genie, ...) and by a custom label for event tracking. For example, I can run in a single event multiple instances of the tyep = decay0 generator, the first with label = "Ar39_gen", second with label = "Ar42_gen", and so on.

Other sparse fixing should have improved performance and memory managment, although I still haven't touched the backtraker, nor checked if they still work.

On the side, I have fixed a wrong uint conversion in the SLArGENIEGeneratorAction which was plagin most vertices outside the TPC volume.