-
Notifications
You must be signed in to change notification settings - Fork 59
EventSelector modifications for new MC waveform hits #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Another downstream tool modification to adjust how the tool uses MC hits that are coming from the waveform generator.
Added config variable that tells EventSelector to use MC waveform hits rather than the default MC hits.
jminock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Merge with PMTWaveformSim
|
Merge with PMTWaveformSim |
Added skip event for PMTWaveformSim
|
Is this merged, ready for level 0 or on hold? can we update the tags so its clear? |
|
It is on hold because it needs to be merged with or after PR #358 Please see above comments |
|
PR #358 has been merged; so this PR is ready for merge |
|
|
||
| if (fIsMC){ | ||
| if (m_all_clusters_MC->size()){ | ||
| if (fMCWaveform) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like a fairly large block of duplicated code based on
if(data){
/* do X with data-like hits */
} else {
if(simulated data){
/* do X with data-like hits */
} else {
/* do X with MC-like hits */
}
}
can we at the least replace with
if(data || simulated data){ ...
to reduce code duplication. Alternatively if the MC/data manipulation code can be moved into a templated function or lambda taking an auto argument (see this comment), perhaps we could eliminate the duplication entirely...
This would be so much easier if the vectors held pointers to hits... 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can make those changes and re-commit. It is pretty ugly, my apologies. I just modified the existing for loops as they already existed.
|
the PR overall looks fine, but i'm somewhat uneasy with the amount of code duplication going on.... can we at least reduce it to two copies with consistent |
|
Yes I can clean it up a bit. I'll add the |
Cleaned up logic
jminock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
Thanks for this, most of the merges look good (and I think i spot some bugfixes too). I can still see one outstanding duplicate: lines 1077-1098 are the same as 1101-1121, and could be merged by updating the check on line 1075. |
|
Thanks for taking a look - I'll modify it and commit the changes |
- code condensed by merging data and MC logic together - removed the event skipping check
|
Done! Near line 100, I had previously included a condition that will skip the event if an upstream tool told it to do so (the original point of this PR). It was added to be compatible with the PMTWaveformSim tool, as the tool will skip events with no MCHits (since no waveforms are to be reconstructed). Andrew and I agreed this should be changed at some point moving forward, as skipping entries results in dropping events with 0 hits for cross section analyses (which we don't want!). I will be pushing changes later today that modify the waveform simulator to not skip events. Part of that includes "un-doing" some commits to downstream tools like this one, as there will no longer be any event skipping 😓 To save time I just removed it from this tool. |
|
awesome, thanks Steven 🎉 |
Describe your changes
See PR #329 for more details on why we need to alter downstream tools. For the PMTs,
EventSelectorassumes MC hits are coming from the MC cluster map. For the new MC waveform tool (#324) theClusterFindertool handles the MC hits in an identical fashion to the data hits. We therefore need to adjust some of the logic to allow for this tool to use "data" PMT clusters with MC MRD hits, truth information, etc...Checklist before submitting your PR
newusage, there is a reason the data must be on the heapnewthere is adelete, unless I explicitly know why (e.g. ROOT or a BoostStore takes ownership)Additional Material
This PR (just like #329) is dependent on Andrew's new MC waveform tool (#324).