Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

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

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

tomeichlersmith
Copy link
Member

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.

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.
Copy link
Contributor

@EinarElen EinarElen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (can you tell that my setup is biased towards production that you can run in one big file? :))

I do think the logic in produce is a bit complicated, if at all possible I think we should try to simplify it (or at least spread it our/refactor it). As it is, I wouldn't want a new developer to have to read through it

src/SimCore/ReSimulator.cxx Outdated Show resolved Hide resolved
src/SimCore/ReSimulator.cxx Outdated Show resolved Hide resolved
the translation of different format of runs provided by the user into
the actual data structure used during processing is done within python
now so it can be more transparent in error
@tomeichlersmith
Copy link
Member Author

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
Copy link
Contributor

EinarElen commented Nov 19, 2023

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()
} 
}

this is helpful isolation and makes it easier to document how an event
ends up being re-simulated
python/simulator.py.in Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants