Skip to content
This repository was 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
tomeichlersmith merged 3 commits into
trunkfrom
resim-filter-by-run
Nov 20, 2023
Merged

add option to filter by run number as well as event number#105
tomeichlersmith merged 3 commits into
trunkfrom
resim-filter-by-run

Conversation

@tomeichlersmith

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

@EinarElen EinarElen left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/SimCore/ReSimulator.cxx Outdated
Comment thread src/SimCore/ReSimulator.cxx Outdated
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
Copy Markdown
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

EinarElen commented Nov 19, 2023

Copy link
Copy Markdown
Contributor

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
Comment thread python/simulator.py.in
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