Skip to content

Adding offbeam gate into the CAFs#89

Draft
jzettle wants to merge 3 commits intodevelopfrom
feature/jzettle_offbeamgateaccounting
Draft

Adding offbeam gate into the CAFs#89
jzettle wants to merge 3 commits intodevelopfrom
feature/jzettle_offbeamgateaccounting

Conversation

@jzettle
Copy link

@jzettle jzettle commented Sep 30, 2022

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.

@jzettle
Copy link
Author

jzettle commented Sep 30, 2022

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

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?

@jzennamo
Copy link
Contributor

Looks good now!

Copy link
Member

@PetrilloAtWork PetrilloAtWork left a 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.

Comment on lines +191 to +193
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"
Copy link
Member

Choose a reason for hiding this comment

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

More maintainable alternative:

Suggested change
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"

@miquelnebot miquelnebot added the help wanted Extra attention is needed label Feb 7, 2023
@miquelnebot miquelnebot marked this pull request as draft February 7, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants