@@ -33,6 +33,42 @@ namespace sbn::crt {
3333 exSide_enBottom = 14 , // /< Matched with one Bottom CRT hit before the optical flash and matched with one Side CRT hit after the optical flash.
3434 others = 9 // /< All the other cases.
3535 };
36+ MatchType assignFlashClassification (uint topen, uint topex,
37+ uint sideen, uint sideex,
38+ uint bottomen, uint bottomex)
39+ {
40+ MatchType flashType;
41+ if (topen == 0 && sideen == 0 && topex == 0 && sideex == 0 ){
42+ if (bottomex==0 && bottomen==0 ) flashType = MatchType::noMatch;
43+ else if (bottomex>=1 && bottomen==0 ) flashType = MatchType::exBottom;
44+ else if (bottomex==0 && bottomen>=1 ) flashType = MatchType::enBottom;
45+ else flashType = MatchType::others;
46+ }
47+ else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 0 ){
48+ if (bottomex==1 && bottomen==0 ) flashType = MatchType::enTop_exBottom;
49+ else flashType = MatchType::enTop;
50+ }
51+ else if (topen == 0 && sideen == 1 && topex == 0 && sideex == 0 )
52+ if (bottomex==1 && bottomen==0 ) flashType = MatchType::enSide_exBottom;
53+ else flashType = MatchType::enSide;
54+ else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 1 )
55+ flashType = MatchType::enTop_exSide;
56+ else if (topen == 0 && sideen == 0 && topex == 1 && sideex == 0 ){
57+ if (bottomex==0 && bottomen==1 ) flashType = MatchType::exTop_enBottom;
58+ else flashType = MatchType::exTop;
59+ }
60+ else if (topen == 0 && sideen == 0 && topex == 0 && sideex == 1 )
61+ if (bottomex==0 && bottomen==1 ) flashType = MatchType::exSide_enBottom;
62+ else flashType = MatchType::exSide;
63+ else if (topen >= 1 && sideen == 0 && topex == 0 && sideex == 0 ) // could also add `if (MatchBottomCRT)` here
64+ flashType = MatchType::enTop_mult;
65+ else if (topen >= 1 && sideen == 0 && topex == 0 && sideex >= 1 ) // and here
66+ flashType = MatchType::enTop_exSide_mult;
67+ else
68+ flashType = MatchType::others;
69+ return flashType;
70+ }
71+
3672 // / Information about a CRT hit matched with a PMT flash.
3773 struct MatchedCRT {
3874
0 commit comments