LDMX-Software / SimCore

Integration of Geant4 simulation framework into a more generalized event processing framework.
2 stars 0 forks source link

add option to filter by run number as well as event number #105

Closed tomeichlersmith closed 1 year ago

tomeichlersmith commented 1 year ago

This is helpful for people like me who have massive samples of heavily-filtered simulations. The best way to generate these samples is across many runs but then merge the resulting files. This results in several runs per file and often an event from one run is aborted by the simulation while the same event number from a different run is the event I wish to resimulate.

tomeichlersmith commented 1 year ago

Ok, I refactored how I implemented it and chose to move the deduction of a configuration from the parameters supplied by the user into the python. I haven't tested running yet, but I wanted to push it up here to see if others think it reads better. @EinarElen ?

EinarElen commented 1 year ago

This looks reasonable to me, I would just move the check for whether an event should be resimulated into a member function rather than doing it inline with a lambda. i.e. it would read

if (!resimulate_all) {
  if skip_event(event) {
  abort_event()
} 
}