Skip to content

Commit 0fe792f

Browse files
authored
Merge branch 'release/SBN2024A' into feature/hhausner_newBNBQualityDevices
2 parents b2fb7b0 + 105b1db commit 0fe792f

4 files changed

Lines changed: 69 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
1515

1616
find_package(cetmodules 3.20.00 REQUIRED)
17-
project(sbnobj VERSION 09.19.00 LANGUAGES CXX)
17+
project(sbnobj VERSION 09.19.00.01 LANGUAGES CXX)
1818

1919
message(STATUS
2020
"\n-- ============================================================================="
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
}

sbnobj/Common/CRT/CRTPMTMatching.hh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @date June 1 2023.
66
*/
77

8-
#ifndef CRTPMTMATCHING_hh_
9-
#define CRTPMTMATCHING_hh_
8+
#ifndef SBNOBJ_COMMON_CRTPMTMATCHING_HH
9+
#define SBNOBJ_COMMON_CRTPMTMATCHING_HH
1010

1111
// C++ includes
1212
#include <vector>
@@ -33,6 +33,22 @@ 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+
37+
/**
38+
* @brief Returns the classification of a TPC object based on the CRT hits associated to it.
39+
* @param topen number of hits on the top CRT earlier than the object (entering)
40+
* @param topex number of hits on the top CRT later than the object (exiting)
41+
* @param sideen number of hits on any side CRT earlier than the object (entering)
42+
* @param sideex number of hits on any side CRT later than the object (exiting)
43+
* @param bottomen number of hits on the bottom CRT earlier than the object (entering)
44+
* @param bottomex number of hits on the bottom side CRT later than the object (exiting)
45+
* @return a value encoding the classification of the TPC object
46+
*
47+
*/
48+
MatchType assignFlashClassification(unsigned int topen, unsigned int topex,
49+
unsigned int sideen, unsigned int sideex,
50+
unsigned int bottomen, unsigned int bottomex);
51+
3652
/// Information about a CRT hit matched with a PMT flash.
3753
struct MatchedCRT {
3854

ups/product_deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ defaultqual e26
246246
#
247247
####################################
248248
product version qual flags <table_format=2>
249-
lardataobj v09_18_01 -
249+
lardataobj v09_18_02 -
250250
cetmodules v3_24_01 - only_for_build
251251
end_product_list
252252
####################################

0 commit comments

Comments
 (0)