Skip to content

Commit 4a835f3

Browse files
author
Ibrahim Safa
committed
release for sbncode v10_01_04
Merge branch 'release/v10_00_01'
2 parents c708675 + 9b87a11 commit 4a835f3

7 files changed

Lines changed: 111 additions & 37 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 10.00.00 LANGUAGES CXX)
17+
project(sbnobj VERSION 10.00.01 LANGUAGES CXX)
1818

1919
message(STATUS
2020
"\n-- ============================================================================="

sbnobj/Common/CRT/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cet_make_library(
22
SOURCE
33
CRTHit.cc
4+
CRTPMTMatching.cxx
45
CRTTrack.cc
56
CRTTzero.cc
67
LIBRARIES
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

sbnobj/Common/Trigger/ExtraTriggerInfo.cxx

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -205,42 +205,29 @@ std::ostream& sbn::operator<< (std::ostream& out, ExtraTriggerInfo const& info)
205205
if (info.triggerLocationBits != 0) {
206206
out << "\nLocation(s) of trigger:";
207207
for (std::string const& bitName: names(info.triggerLocation()))
208-
out << " " << bitName;
209-
}
210-
out << "\nEast cryostat: "
211-
<< info.cryostats[ExtraTriggerInfo::EastCryostat].triggerCount
212-
<< " triggers";
213-
if (auto const& cryo = info.cryostats[ExtraTriggerInfo::EastCryostat];
214-
cryo.hasAnyActivity()
215-
) {
216-
out << "\n trigger logic: ";
217-
if (cryo.triggerLogicBits) {
218-
for (std::string const& bitName: names(cryo.triggerLogic()))
219-
out << " " << bitName;
220-
}
221-
else out << " none!";
222-
out
223-
<< "\n east wall: "
224-
<< dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::EastPMTwall])
225-
<< ", sectors: "
226-
<< dumpBits(cryo.sectorStatus[ExtraTriggerInfo::EastPMTwall], 6)
227-
<< "\n west wall: "
228-
<< dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::WestPMTwall])
229-
<< ", sectors: "
230-
<< dumpBits(cryo.sectorStatus[ExtraTriggerInfo::WestPMTwall], 6)
231-
;
208+
out << " * " << bitName;
232209
}
210+
211+
out << "\nWest cryostat: " << info.cryostats[ExtraTriggerInfo::WestCryostat];
212+
out << "\nEast cryostat: " << info.cryostats[ExtraTriggerInfo::EastCryostat];
213+
214+
return out;
215+
} // sbn::operator<< (ExtraTriggerInfo)
233216

234-
out << "\nWest cryostat: "
235-
<< info.cryostats[ExtraTriggerInfo::WestCryostat].triggerCount
236-
<< " triggers";
237-
if (auto const& cryo = info.cryostats[ExtraTriggerInfo::WestCryostat];
238-
cryo.hasAnyActivity()
239-
) {
217+
218+
219+
// -----------------------------------------------------------------------------
220+
std::ostream& sbn::operator<<
221+
(std::ostream& out, sbn::ExtraTriggerInfo::CryostatInfo const& cryo)
222+
{
223+
out << cryo.triggerCount << " triggers";
224+
if (cryo.hasTrigger())
225+
out << ", the first one " << cryo.beamToTrigger << " ns after gate";
226+
if (cryo.hasAnyActivity()) {
240227
out << "\n trigger logic: ";
241228
if (cryo.triggerLogicBits) {
242229
for (std::string const& bitName: names(cryo.triggerLogic()))
243-
out << " * " << bitName;
230+
out << " * " << bitName;
244231
}
245232
else out << " none!";
246233
out
@@ -254,9 +241,8 @@ std::ostream& sbn::operator<< (std::ostream& out, ExtraTriggerInfo const& info)
254241
<< dumpBits(cryo.sectorStatus[ExtraTriggerInfo::WestPMTwall], 6)
255242
;
256243
}
257-
258244
return out;
259-
} // sbn::operator<< (ExtraTriggerInfo)
245+
} // std::ostream& sbn::operator<< (ExtraTriggerInfo::CryostatInfo)
260246

261247

262248
// -----------------------------------------------------------------------------

sbnobj/Common/Trigger/ExtraTriggerInfo.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ struct sbn::ExtraTriggerInfo {
190190

191191
/// Trigger data pertaining a single cryostat.
192192
struct CryostatInfo {
193+
194+
/// Special value for no local cryostat trigger.
195+
static constexpr unsigned int NoTrigger
196+
= std::numeric_limits<unsigned int>::max();
197+
193198
/// Count of triggers in this cryostat.
194199
unsigned long int triggerCount { 0 };
195200

@@ -244,6 +249,10 @@ struct sbn::ExtraTriggerInfo {
244249
/// @see sbn::bits::triggerLogicMask
245250
unsigned int triggerLogicBits { 0U };
246251

252+
/// Delay from the beam gate opening to the first cryostat trigger
253+
/// (`NoTrigger` if no trigger is available in the cryostat) [ns]
254+
unsigned int beamToTrigger { NoTrigger };
255+
247256
/**
248257
* @brief Returns the type of logic satisfied by the trigger.
249258
*
@@ -270,6 +279,9 @@ struct sbn::ExtraTriggerInfo {
270279
/// Returns whether there is some recorded activity (LVDS or sector).
271280
constexpr bool hasAnyActivity() const;
272281

282+
/// Returns whether this cryostat has a trigger in the gate.
283+
constexpr bool hasTrigger() const;
284+
273285
}; // CryostatInfo
274286

275287

@@ -346,6 +358,8 @@ struct sbn::ExtraTriggerInfo {
346358

347359
namespace sbn {
348360
std::ostream& operator<< (std::ostream& out, ExtraTriggerInfo const& info);
361+
std::ostream& operator<<
362+
(std::ostream& out, ExtraTriggerInfo::CryostatInfo const& cryo);
349363
}
350364

351365

@@ -375,6 +389,13 @@ inline constexpr bool sbn::ExtraTriggerInfo::CryostatInfo::hasAnyActivity()
375389
} // sbn::ExtraTriggerInfo::CryostatInfo::hasAnyActivity()
376390

377391

392+
// -----------------------------------------------------------------------------
393+
inline constexpr bool sbn::ExtraTriggerInfo::CryostatInfo::hasTrigger() const
394+
{
395+
return beamToTrigger != NoTrigger;
396+
} // sbn::ExtraTriggerInfo::CryostatInfo::hasTrigger()
397+
398+
378399
// -----------------------------------------------------------------------------
379400

380401

sbnobj/Common/Trigger/classes_def.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<enum name="sbn::bits::triggerSource" ClassVersion="10" />
2828
<enum name="sbn::bits::triggerLocation" ClassVersion="10" />
2929
<enum name="sbn::bits::triggerType" ClassVersion="10" />
30-
<class name="sbn::ExtraTriggerInfo::CryostatInfo" ClassVersion="13" >
30+
<class name="sbn::ExtraTriggerInfo::CryostatInfo" ClassVersion="14" >
31+
<version ClassVersion="14" checksum="1406793077"/>
3132
<version ClassVersion="13" checksum="2956313925"/>
3233
<version ClassVersion="12" checksum="804951501"/>
3334
<version ClassVersion="11" checksum="3455337645"/>

0 commit comments

Comments
 (0)