Skip to content

Commit c40e41e

Browse files
committed
Merge tag 'v10_20_04' into feature/frame_shift_refactor_v10_03_02_01
v10_20_04
2 parents d5fb79d + 71577fd commit c40e41e

33 files changed

Lines changed: 578 additions & 106 deletions

CMakeLists.txt

Lines changed: 3 additions & 8 deletions
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.03.02.01 LANGUAGES CXX)
17+
project(sbnobj VERSION 10.20.04 LANGUAGES CXX)
1818

1919
message(STATUS
2020
"\n-- ============================================================================="
@@ -34,16 +34,11 @@ cet_set_compiler_flags(DIAGS CAUTIOUS
3434
cet_report_compiler_flags(REPORT_THRESHOLD VERBOSE)
3535

3636
# these are minimum required versions, not the actual product versions
37-
find_package(art REQUIRED EXPORT)
38-
find_package(canvas REQUIRED EXPORT)
37+
# this package must NOT depend on art, nor on the *alg LArSoft packages
38+
find_package( canvas REQUIRED EXPORT)
3939
find_package( messagefacility REQUIRED )
40-
find_package( canvas REQUIRED )
41-
find_package( larcore REQUIRED )
4240
find_package( larcoreobj REQUIRED )
43-
find_package( lardata REQUIRED )
4441
find_package( lardataobj REQUIRED )
45-
find_package( larcorealg REQUIRED )
46-
find_package( lardataalg REQUIRED )
4742
find_package( nusimdata REQUIRED )
4843
find_package( Boost COMPONENTS system )
4944
find_package( ROOT REQUIRED )

sbnobj/Common/CRT/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cet_make_library(
99
LIBRARIES
1010
cetlib_except::cetlib_except
1111
lardataobj::Simulation
12-
larcorealg::Geometry
12+
larcoreobj::geo_vectors
1313
)
1414

1515
art_dictionary(DICTIONARY_LIBRARIES sbnobj::Common_CRT)

sbnobj/Common/CRT/CRTHit.hh

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,37 @@
1717
#include <map>
1818
#include <string>
1919
#include <utility>
20+
#include <limits>
2021

2122
namespace sbn::crt {
2223

2324
struct CRTHit{
2425

26+
static constexpr float kInvalidF = std::numeric_limits<float>::lowest();
27+
static constexpr double kInvalidD = std::numeric_limits<double>::lowest();
28+
2529
std::vector<uint8_t> feb_id; ///< FEB address
2630
std::map< uint8_t, std::vector<std::pair<int,float> > > pesmap; ///< Saves signal hit information (FEB, local-channel and PE) .
27-
float peshit; ///< Total photo-electron (PE) in a crt hit.
31+
float peshit{kInvalidF}; ///< Total photo-electron (PE) in a crt hit.
2832

29-
uint64_t ts0_s; ///< Second-only part of timestamp T0.
30-
double ts0_s_corr; ///< [Honestly, not sure at this point, it was there since long time (BB)]
31-
double ts0_ns; ///< Timestamp T0 (from White Rabbit), in UTC absolute time scale in nanoseconds from the Epoch.
32-
double ts0_ns_corr; ///< [Honestly, not sure at this point, it was there since long time (BB)]
33+
uint64_t ts0_s{static_cast<uint64_t>(-1)}; ///< Second-only part of timestamp T0.
34+
double ts0_s_corr{kInvalidD}; ///< [Honestly, not sure at this point, it was there since long time (BB)]
35+
double ts0_ns{kInvalidD}; ///< Timestamp T0 (from White Rabbit), in UTC absolute time scale in nanoseconds from the Epoch.
36+
double ts0_ns_corr{kInvalidD}; ///< [Honestly, not sure at this point, it was there since long time (BB)]
3337

34-
double ts1_ns; ///< Timestamp T1 ([signal time w.r.t. Trigger time]),
38+
double ts1_ns{kInvalidD}; ///< Timestamp T1 ([signal time w.r.t. Trigger time]),
3539

36-
int plane; ///< Name of the CRT wall (in the form of numbers).
40+
int plane{-1}; ///< Name of the CRT wall (in the form of numbers).
3741

38-
float x_pos; ///< position in x-direction (cm).
39-
float x_err; ///< position uncertainty in x-direction (cm).
40-
float y_pos; ///< position in y-direction (cm).
41-
float y_err; ///< position uncertainty in y-direction (cm).
42-
float z_pos; ///< position in z-direction (cm).
43-
float z_err; ///< position uncertainty in z-direction (cm).
42+
float x_pos{kInvalidF}; ///< position in x-direction (cm).
43+
float x_err{kInvalidF}; ///< position uncertainty in x-direction (cm).
44+
float y_pos{kInvalidF}; ///< position in y-direction (cm).
45+
float y_err{kInvalidF}; ///< position uncertainty in y-direction (cm).
46+
float z_pos{kInvalidF}; ///< position in z-direction (cm).
47+
float z_err{kInvalidF}; ///< position uncertainty in z-direction (cm).
4448

4549
std::string tagger; ///< Name of the CRT wall (in the form of strings).
4650

47-
CRTHit() {}
48-
4951
int64_t ts0() const { return static_cast<int64_t>(ts0_s) * 1'000'000'000LL + static_cast<int64_t>(ts0_ns); }
5052
// T1 is a relative time not a timestamp, so we don't need second-part.
5153
// nano-second part is enough and we saved entire time there.

sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
// C/C++ standard libraries
1111
#include <limits>
12-
#include "larcorealg/Geometry/GeometryCore.h"
1312
#include "larcoreobj/SimpleTypesAndConstants/geo_types.h"
1413
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
14+
1515
// -----------------------------------------------------------------------------
1616
namespace sbn::crt {
1717
/// @brief How was the track fitted when matched with a CRT hit.
@@ -100,4 +100,4 @@ struct sbn::crt::CRTHitT0TaggingInfo {
100100
// -----------------------------------------------------------------------------
101101

102102

103-
#endif // SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_
103+
#endif // SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_

sbnobj/Common/CRT/CRTPMTMatching.hh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ namespace sbn::crt {
5959
static constexpr int NoLocation = -1;
6060

6161
geo::Point_t position; ///< Hit location [cm]
62-
double PMTTimeDiff; //= NoTime; < CRT hit time minus PMT flash time [us] (instead maybe wanna set NoTime vars in
63-
double time;// = NoTime; ///< CRT hit time [us]
64-
int sys; // = NoLocation; ///< CRT subdetector the hit fell into.
65-
int region;// = NoLocation; ///< Region the matched CRT hit fell into.
62+
double PMTTimeDiff = NoTime; ///< CRT hit time minus PMT flash time [us]
63+
double time = NoTime; ///< CRT hit time [us]
64+
int sys = NoLocation; ///< CRT subdetector the hit fell into.
65+
int region = NoLocation; ///< Region the matched CRT hit fell into.
6666
};
6767

6868
struct CRTPMTMatching{
@@ -83,18 +83,18 @@ namespace sbn::crt {
8383
static constexpr double NoWidth = -1.0;
8484

8585

86-
int flashID;// = NoID; ///< ID of the optical flash.
87-
double flashTime;// = NoTime; ///< Time of the optical flash w.r.t. the global trigger [us]
88-
double flashGateTime;// = NoTime; ///< Time of the optical flash w.r.t. the beam gate opening [us]
89-
double firstOpHitPeakTime;// = NoTime; ///< Time of the first optical hit peak time w.r.t. the global trigger [us]
90-
double firstOpHitStartTime;// = NoTime; ///< Time of the first optical hit start time w.r.t. the global trigger [us]
91-
bool flashInGate;// = false; ///< Flash within gate or not.
92-
bool flashInBeam ;// = false; ///< Flash within the beam window of the gate or not.
93-
double flashPE;// = -1.0; ///< Total reconstructed light in the flash [photoelectrons]
86+
int flashID = NoID; ///< ID of the optical flash.
87+
double flashTime = NoTime; ///< Time of the optical flash w.r.t. the global trigger [us]
88+
double flashGateTime = NoTime; ///< Time of the optical flash w.r.t. the beam gate opening [us]
89+
double firstOpHitPeakTime = NoTime; ///< Time of the first optical hit peak time w.r.t. the global trigger [us]
90+
double firstOpHitStartTime = NoTime; ///< Time of the first optical hit start time w.r.t. the global trigger [us]
91+
bool flashInGate = false; ///< Flash within gate or not.
92+
bool flashInBeam = false; ///< Flash within the beam window of the gate or not.
93+
double flashPE = -1.0; ///< Total reconstructed light in the flash [photoelectrons]
9494
geo::Point_t flashPosition; ///< Flash barycenter coordinates evaluated using ADCs as weights.
95-
double flashYWidth;// = NoWidth; ///< Flash spread along Y.
96-
double flashZWidth;// = NoWidth; ///< Flash spread along Z.
97-
MatchType flashClassification;// = MatchType::noMatch; ///< Classification of the optical flash.
95+
double flashYWidth = NoWidth; ///< Flash spread along Y.
96+
double flashZWidth = NoWidth; ///< Flash spread along Z.
97+
MatchType flashClassification = MatchType::noMatch; ///< Classification of the optical flash.
9898
std::vector<MatchedCRT> matchedCRTHits; ///< Matched CRT Hits with the optical flash.
9999
unsigned int nTopCRTHitsBefore = NoCount; ///< Number of Top CRT Hits before the optical flash.
100100
unsigned int nTopCRTHitsAfter = NoCount; ///< Number of Top CRT Hits after the optical flash.

sbnobj/Common/CRT/classes.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
#include "canvas/Persistency/Common/Assns.h"
33
#include "lardataobj/RecoBase/Track.h"
44
#include "lardataobj/RecoBase/PFParticle.h"
5-
#include "lardataobj/AnalysisBase/T0.h"
5+
#include "lardataobj/RecoBase/OpFlash.h"
66
#include "lardataobj/Simulation/AuxDetSimChannel.h"
7-
#include "lardataobj/RecoBase/Track.h"
8-
#include "lardataobj/RecoBase/PFParticle.h"
7+
#include "lardataobj/AnalysisBase/T0.h"
98
#include "sbnobj/Common/CRT/CRTHit.hh"
109
#include "sbnobj/Common/CRT/CRTTrack.hh"
11-
#include "lardataobj/AnalysisBase/T0.h"
12-
#include "lardataobj/RecoBase/OpFlash.h"
1310
#include "sbnobj/Common/CRT/CRTTzero.hh"
1411
#include "sbnobj/Common/CRT/CRTPMTMatching.hh"
1512
#include "sbnobj/Common/CRT/CRTHit_Legacy.hh"

sbnobj/Common/Reco/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cet_make_library(
33
CNNScore.cc
44
CRUMBSResult.cc
55
FlashTriggerPrimitive.cc
6+
LightCalo.cc
67
MVAPID.cc
78
MergedTrackInfo.cc
89
OpT0FinderResult.cc
@@ -17,7 +18,6 @@ cet_make_library(
1718
LIBRARIES
1819
cetlib_except::cetlib_except
1920
messagefacility::MF_MessageLogger
20-
larcorealg::Geometry
2121
lardataobj::AnalysisBase
2222
)
2323

sbnobj/Common/Reco/LightCalo.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "sbnobj/Common/Reco/LightCalo.h"

sbnobj/Common/Reco/LightCalo.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* @file sbnobj/Common/Reco/LightCalo.h
3+
* @brief Defines data structures for light calorimetry products.
4+
* @author Lynn Tung
5+
* @date December 2nd, 2025
6+
*
7+
*/
8+
9+
#ifndef sbnobj_LightCalo_H
10+
#define sbnobj_LightCalo_H
11+
12+
#include <limits>
13+
14+
namespace sbn{
15+
16+
/**
17+
* @brief A simple class to store reconstructed charge, light, and visible energy.
18+
*/
19+
20+
struct LightCalo {
21+
public:
22+
23+
// NaN value to initialize data members
24+
static constexpr double nan = std::numeric_limits<double>::signaling_NaN();
25+
26+
/// @name Reconstructed charge, light, and visible energy data members.
27+
/// @{
28+
double charge = nan; ///< Total charge in a reconstructed interaction (recob::Slice) [# of electrons]
29+
double light = nan; ///< Total light in a reconstructed interaction (recob::Slice + recob::OpFlash) [# of photons]
30+
double energy = nan; ///< Total visible energy (sum of charge+light) for a reconstructed interaction [GeV]
31+
int bestplane = -1; ///< Plane that was used for the total charge
32+
/// @}
33+
34+
/**
35+
* Default constructor.
36+
*/
37+
LightCalo() = default;
38+
};
39+
}
40+
41+
#endif

sbnobj/Common/Reco/classes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "sbnobj/Common/Reco/VertexHit.h"
2929
#include "sbnobj/Common/Reco/MVAPID.h"
3030
#include "sbnobj/Common/Reco/CRUMBSResult.h"
31+
#include "sbnobj/Common/Reco/LightCalo.h"
3132
#include "sbnobj/Common/Reco/OpT0FinderResult.h"
3233
#include "sbnobj/Common/Reco/CNNScore.h"
3334
#include "sbnobj/Common/Reco/TPCPMTBarycenterMatch.h"

0 commit comments

Comments
 (0)