-
Notifications
You must be signed in to change notification settings - Fork 16
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
Adding offbeam gate into the CAFs #89
base: develop
Are you sure you want to change the base?
Conversation
sbnana v09_59_00 using sbnanaobj v09_19_04
This is a set of PRs that spans SBNSoftware/sbnanaobj#79, SBNSoftware/sbncode#298, and SBNSoftware/sbnobj#67 |
std::cout << "SpectrumLoader: nonzero number of both BNB (" << nbnb | ||
<< ") and NuMI (" << nnumi << ") triggers. I'm confused" | ||
const int next = sr->hdr.extinfo.size(); | ||
if(nbnb > 0 && nnumi > 0 && next > 0){ |
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.
Should this abort when all three are non-zero or just when two out of three are?
Looks good now! |
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.
One suggestion left behind, because after all it's me.
Either ways, it's good.
if((nbnb > 0 && nnumi > 0) || (nbnb > 0 && next > 0) || (nnumi > 0 && next > 0)){ | ||
std::cout << "SpectrumLoader: nonzero number of 2 of 3 BNB (" << nbnb | ||
<< "), NuMI (" << nnumi << "), and EXT (" << next << ") triggers. I'm confused" |
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.
More maintainable alternative:
if((nbnb > 0 && nnumi > 0) || (nbnb > 0 && next > 0) || (nnumi > 0 && next > 0)){ | |
std::cout << "SpectrumLoader: nonzero number of 2 of 3 BNB (" << nbnb | |
<< "), NuMI (" << nnumi << "), and EXT (" << next << ") triggers. I'm confused" | |
const unsigned int nGateTypes = (nbnb > 0) + (nnumi > 0) + (next > 0); | |
if(nGateTypes > 1){ | |
std::cout << "SpectrumLoader: nonzero number of " << nGateTypes << " of 3 BNB (" << nbnb | |
<< "), NuMI (" << nnumi << "), and EXT (" << next << ") triggers. I'm confused" |
This PR adds offbeam gate counting into the CAFs. The number of gates is computed as a difference with the gate counting performed within the event to compute the number of offbeam gates for BNB or NuMI seen by the trigger hardware on an event-by-event basis.