Skip to content
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

add function to assign CRT-PMT Match classificaiton to sbnobj [release/SBN2024A] #115

Open
wants to merge 2 commits into
base: release/SBN2024A
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions sbnobj/Common/CRT/CRTPMTMatching.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,42 @@ namespace sbn::crt {
exSide_enBottom = 14, ///< Matched with one Bottom CRT hit before the optical flash and matched with one Side CRT hit after the optical flash.
others = 9 ///< All the other cases.
};
MatchType assignFlashClassification(uint topen, uint topex,
uint sideen, uint sideex,
uint bottomen, uint bottomex)
aheggest marked this conversation as resolved.
Show resolved Hide resolved
aheggest marked this conversation as resolved.
Show resolved Hide resolved
{
MatchType flashType;
if (topen == 0 && sideen == 0 && topex == 0 && sideex == 0){
if(bottomex==0 && bottomen==0) flashType = MatchType::noMatch;
else if (bottomex>=1 && bottomen==0) flashType = MatchType::exBottom;
else if (bottomex==0 && bottomen>=1) flashType = MatchType::enBottom;
else flashType = MatchType::others;
}
else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 0){
if(bottomex==1 && bottomen==0) flashType = MatchType::enTop_exBottom;
else flashType = MatchType::enTop;
}
else if (topen == 0 && sideen == 1 && topex == 0 && sideex == 0)
if(bottomex==1 && bottomen==0) flashType = MatchType::enSide_exBottom;
else flashType = MatchType::enSide;
else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 1)
flashType = MatchType::enTop_exSide;
else if (topen == 0 && sideen == 0 && topex == 1 && sideex == 0){
if(bottomex==0 && bottomen==1) flashType = MatchType::exTop_enBottom;
else flashType = MatchType::exTop;
}
else if (topen == 0 && sideen == 0 && topex == 0 && sideex == 1)
if(bottomex==0 && bottomen==1) flashType = MatchType::exSide_enBottom;
else flashType = MatchType::exSide;
else if (topen >= 1 && sideen == 0 && topex == 0 && sideex == 0) // could also add `if (MatchBottomCRT)` here
flashType = MatchType::enTop_mult;
else if (topen >= 1 && sideen == 0 && topex == 0 && sideex >= 1) // and here
flashType = MatchType::enTop_exSide_mult;
else
flashType = MatchType::others;
return flashType;
}

/// Information about a CRT hit matched with a PMT flash.
struct MatchedCRT {

Expand Down