|
| 1 | +/** |
| 2 | + * @file sbnobj/Common/CRTPMTMatching.cxx |
| 3 | + * @brief Data product to store CRT PMT Matches (implementation file). |
| 4 | + * @author Anna Heggestuen (aheggest@colostate.edu) and Francesco Poppi (poppi@bo.infn.it) |
| 5 | + * @date November 22, 2024 |
| 6 | + * @see sbnobj/Common/CRTPMTMatching.hh |
| 7 | + */ |
| 8 | + |
| 9 | +// Library header |
| 10 | +#include "sbnobj/Common/CRT/CRTPMTMatching.hh" |
| 11 | + |
| 12 | +sbn::crt::MatchType sbn::crt::assignFlashClassification( |
| 13 | + unsigned int topen, unsigned int topex, |
| 14 | + unsigned int sideen, unsigned int sideex, |
| 15 | + unsigned int bottomen, unsigned int bottomex |
| 16 | +) |
| 17 | +{ |
| 18 | + MatchType flashType; |
| 19 | + if (topen == 0 && sideen == 0 && topex == 0 && sideex == 0){ |
| 20 | + if(bottomex==0 && bottomen==0) flashType = MatchType::noMatch; |
| 21 | + else if (bottomex>=1 && bottomen==0) flashType = MatchType::exBottom; |
| 22 | + else if (bottomex==0 && bottomen>=1) flashType = MatchType::enBottom; |
| 23 | + else flashType = MatchType::others; |
| 24 | + } |
| 25 | + else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 0){ |
| 26 | + if(bottomex==1 && bottomen==0) flashType = MatchType::enTop_exBottom; |
| 27 | + else flashType = MatchType::enTop; |
| 28 | + } |
| 29 | + else if (topen == 0 && sideen == 1 && topex == 0 && sideex == 0) |
| 30 | + if(bottomex==1 && bottomen==0) flashType = MatchType::enSide_exBottom; |
| 31 | + else flashType = MatchType::enSide; |
| 32 | + else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 1) |
| 33 | + flashType = MatchType::enTop_exSide; |
| 34 | + else if (topen == 0 && sideen == 0 && topex == 1 && sideex == 0){ |
| 35 | + if(bottomex==0 && bottomen==1) flashType = MatchType::exTop_enBottom; |
| 36 | + else flashType = MatchType::exTop; |
| 37 | + } |
| 38 | + else if (topen == 0 && sideen == 0 && topex == 0 && sideex == 1) |
| 39 | + if(bottomex==0 && bottomen==1) flashType = MatchType::exSide_enBottom; |
| 40 | + else flashType = MatchType::exSide; |
| 41 | + else if (topen >= 1 && sideen == 0 && topex == 0 && sideex == 0) // could also add `if (MatchBottomCRT)` here |
| 42 | + flashType = MatchType::enTop_mult; |
| 43 | + else if (topen >= 1 && sideen == 0 && topex == 0 && sideex >= 1) // and here |
| 44 | + flashType = MatchType::enTop_exSide_mult; |
| 45 | + else |
| 46 | + flashType = MatchType::others; |
| 47 | + return flashType; |
| 48 | + |
| 49 | +} |
0 commit comments