Skip to content

Commit a2792ac

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/hlay_crt_clustering_base
2 parents e7d17a5 + 77d254d commit a2792ac

31 files changed

Lines changed: 826 additions & 7 deletions

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.16.00 LANGUAGES CXX)
17+
project(sbnobj VERSION 09.17.10 LANGUAGES CXX)
1818

1919
message(STATUS
2020
"\n-- ============================================================================="
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/**
2+
* @file sbnobj/Common/CRTPMTMatching.hh
3+
* @brief data product to store CRT PMT Matches
4+
* @author Anna Heggestuen (aheggest@colostate.edu) and Francesco Poppi ( poppi@bo.infn.it )
5+
* @date June 1 2023.
6+
*/
7+
8+
#ifndef CRTPMTMATCHING_hh_
9+
#define CRTPMTMATCHING_hh_
10+
11+
// C++ includes
12+
#include <vector>
13+
#include <limits>
14+
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
15+
16+
namespace sbn::crt {
17+
18+
/// Type of match between a TPC object (e.g. PMT flash) and CRT system.
19+
enum class MatchType { /// perhaps it would be better to define these in icaruscode
20+
noMatch = 0, ///< No CRT match.
21+
enTop = 1, ///< Matched with Top CRT hit before optical flash.
22+
enSide = 2, ///< Matched with Side CRT hit before optical flash.
23+
enTop_exSide = 3, ///< Matched with one Top CRT hit before the optical flash and matched with one Side CRT hit after the optical flash.
24+
exTop = 4, ///< Matched with a Top CRT after the optical flash.
25+
exSide = 5, ///< Matched with a Side CRT after the optical flash.
26+
enTop_mult = 6, ///< Matched with multiple Top CRT hits before the optical flash.
27+
enTop_exSide_mult = 7, ///< Matched with multiple Top CRT hits before the optical flash and more then 1 side CRT hits after the optical flash.
28+
enBottom = 8, ///< Matched with bottom CRT hit before the optical flash.
29+
exBottom = 10, ///< Matched with Bottom CRT hit after the optical flash.
30+
enTop_exBottom = 11, ///< Matched with one Top CRT hit before the optical flash and
31+
enSide_exBottom = 12, ///< Matched with one Side CRT hit before the optical flash and matched with one Bottom CRT hit after the optical flash.
32+
exTop_enBottom = 13, ///< Matched with one Bottom CRT hit before the optical flash and matched with one Top CRT hit after the optical flash.
33+
exSide_enBottom = 14, ///< Matched with one Bottom CRT hit before the optical flash and matched with one Side CRT hit after the optical flash.
34+
others = 9 ///< All the other cases.
35+
};
36+
/// Information about a CRT hit matched with a PMT flash.
37+
struct MatchedCRT {
38+
39+
/// Special value to indicate the lack of information on a time.
40+
static constexpr double NoTime = std::numeric_limits<double>::lowest();
41+
42+
/// Special value to indicate no information on the hit location.
43+
static constexpr int NoLocation = -1;
44+
45+
geo::Point_t position; ///< Hit location [cm]
46+
double PMTTimeDiff; //= NoTime; < CRT hit time minus PMT flash time [us] (instead maybe wanna set NoTime vars in
47+
double time;// = NoTime; ///< CRT hit time [us]
48+
int sys; // = NoLocation; ///< CRT subdetector the hit fell into.
49+
int region;// = NoLocation; ///< Region the matched CRT hit fell into.
50+
};
51+
52+
struct CRTPMTMatching{
53+
/// Special value to indicate the lack of information on an ID.
54+
static constexpr int NoID = std::numeric_limits<int>::min();
55+
56+
/// Special value to indicate the lack of information on a counter.
57+
static constexpr unsigned int NoCount
58+
= std::numeric_limits<unsigned int>::max();
59+
60+
/// Special value to indicate the lack of information on a time.
61+
static constexpr double NoTime = std::numeric_limits<double>::lowest();
62+
63+
/// Special value to indicate the lack of information on flash photoelectrons.
64+
static constexpr double NoPE = -1.0;
65+
66+
/// Special value to indicate the lack of information on flash width.
67+
static constexpr double NoWidth = -1.0;
68+
69+
70+
int flashID;// = NoID; ///< ID of the optical flash.
71+
double flashTime;// = NoTime; ///< Time of the optical flash w.r.t. the global trigger [us]
72+
double flashGateTime;// = NoTime; ///< Time of the optical flash w.r.t. the beam gate opening [us]
73+
double firstOpHitPeakTime;// = NoTime; ///< Time of the first optical hit peak time w.r.t. the global trigger [us]
74+
double firstOpHitStartTime;// = NoTime; ///< Time of the first optical hit start time w.r.t. the global trigger [us]
75+
bool flashInGate;// = false; ///< Flash within gate or not.
76+
bool flashInBeam ;// = false; ///< Flash within the beam window of the gate or not.
77+
double flashPE;// = -1.0; ///< Total reconstructed light in the flash [photoelectrons]
78+
geo::Point_t flashPosition; ///< Flash barycenter coordinates evaluated using ADCs as weights.
79+
double flashYWidth;// = NoWidth; ///< Flash spread along Y.
80+
double flashZWidth;// = NoWidth; ///< Flash spread along Z.
81+
MatchType flashClassification;// = MatchType::noMatch; ///< Classification of the optical flash.
82+
std::vector<MatchedCRT> matchedCRTHits; ///< Matched CRT Hits with the optical flash.
83+
unsigned int nTopCRTHitsBefore = NoCount; ///< Number of Top CRT Hits before the optical flash.
84+
unsigned int nTopCRTHitsAfter = NoCount; ///< Number of Top CRT Hits after the optical flash.
85+
unsigned int nSideCRTHitsBefore = NoCount; ///< Number of Side CRT Hits before the optical flash.
86+
unsigned int nSideCRTHitsAfter = NoCount; ///< Number of Side CRT Hits after the optical flash.
87+
88+
89+
90+
/// Returns whether the information in this record is in any way valid.
91+
bool isValid() const { return flashID != NoID; }
92+
93+
};
94+
95+
/// Additional information about the matching of one flash and one CRT hit.
96+
///
97+
/// Intended as association metadata.
98+
struct CRTPMTMatchingInfo {
99+
100+
enum class Dir { unknown, entering, exiting };
101+
102+
/// Special value to indicate the lack of information on a time.
103+
static constexpr double NoTime = std::numeric_limits<double>::lowest();
104+
105+
/// Whether CRT hit describes a particle entering the detector of exiting.
106+
Dir direction = Dir::unknown;
107+
double timeOfFlight = NoTime; ///< CRT hit time minus PMT flash time [us]
108+
double distance; ///< Distance between CRT Hit and optical flash centroid [cm]
109+
110+
}; // CRTPMTMatchingInfo
111+
112+
113+
} // namespace sbn::crt
114+
115+
116+
#endif

sbnobj/Common/CRT/classes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
#include "sbnobj/Common/CRT/CRTHit.hh"
66
#include "sbnobj/Common/CRT/CRTTrack.hh"
77
#include "lardataobj/AnalysisBase/T0.h"
8+
#include "lardataobj/RecoBase/OpFlash.h"
89
#include "sbnobj/Common/CRT/CRTTzero.hh"
10+
#include "sbnobj/Common/CRT/CRTPMTMatching.hh"
911
#include "sbnobj/Common/CRT/CRTHit_Legacy.hh"
1012
#include "sbnobj/Common/CRT/CRTTrack_Legacy.hh"
1113
#include "sbnobj/Common/CRT/CRTTzero_Legacy.hh"
1214
#include <vector>
1315
#include <map>
1416
#include <utility>
17+
18+

sbnobj/Common/CRT/classes_def.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,50 @@
113113
<class name="art::Assns<icarus::crt::CRTHit, icarus::crt::CRTTzero, void>" />
114114
<class name="art::Wrapper< art::Assns<icarus::crt::CRTHit, icarus::crt::CRTTzero, void> >" />
115115

116+
<!-- CRT PMT Matching -->
117+
<enum name="sbn::crt::MatchType"/>
118+
<class name="sbn::crt::MatchedCRT"/>
119+
<class name="vector<sbn::crt::MatchedCRT>"/>
120+
<class name="sbn::crt::CRTPMTMatching"/>
121+
<class name="std::vector<sbn::crt::CRTPMTMatching>"/>
122+
<class name="art::Wrapper<vector<sbn::crt::CRTPMTMatching>>" />
123+
124+
<!-- associations: sbn::crt::CRTPMTMatching, recob::OpFlash -->
125+
<class name="art::Assns<sbn::crt::CRTPMTMatching, recob::OpFlash, void>" />
126+
<class name="art::Wrapper<art::Assns<sbn::crt::CRTPMTMatching, recob::OpFlash>>" />
127+
128+
<class name="art::Assns<recob::OpFlash, sbn::crt::CRTPMTMatching, void>" />
129+
<class name="art::Wrapper<art::Assns<recob::OpFlash, sbn::crt::CRTPMTMatching>>" />
130+
131+
<!-- associations: sbn::crt::CRTPMTMatching, sbn::crt::CRTHit -->
132+
<class name="art::Assns<sbn::crt::CRTPMTMatching, sbn::crt::CRTHit, void>" />
133+
<class name="art::Wrapper<art::Assns<sbn::crt::CRTPMTMatching, sbn::crt::CRTHit>>" />
134+
135+
<class name="art::Assns<sbn::crt::CRTHit, sbn::crt::CRTPMTMatching, void>" />
136+
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHit, sbn::crt::CRTPMTMatching>>" />
137+
138+
139+
<!-- associations: recob::OpFlash, sbn::crt::CRTHit -->
140+
<enum name="sbn::crt::CRTPMTMatchingInfo::Dir"/>
141+
<class name="sbn::crt::CRTPMTMatchingInfo"/>
142+
<class name="std::vector<sbn::crt::CRTPMTMatchingInfo>"/>
143+
<class name="art::Assns<recob::OpFlash,sbn::crt::CRTHit,void>"/>
144+
<class name="art::Wrapper<art::Assns<recob::OpFlash,sbn::crt::CRTHit>>"/>
145+
146+
<!-- associations: recob::OpFlash, sbn::crt::CRTHit, sbn::crt::CRTPMTMatchingInfo-->
147+
<class name="art::Assns<recob::OpFlash,sbn::crt::CRTHit,sbn::crt::CRTPMTMatchingInfo>"/>
148+
<class name="art::Wrapper<art::Assns<recob::OpFlash,sbn::crt::CRTHit,sbn::crt::CRTPMTMatchingInfo>> "/>
149+
150+
151+
<!-- associations: sbn::crt::CRTHit, recob::OpFlash, void-->
152+
<class name="art::Assns<sbn::crt::CRTHit, recob::OpFlash, void>"/>
153+
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHit, recob::OpFlash>>" />
154+
155+
<!-- associations: sbn::crt::CRTHit, recob::OpFlash, sbn::crt::CRTPMTMatchingInfo-->
156+
<class name="art::Assns<sbn::crt::CRTHit, recob::OpFlash, sbn::crt::CRTPMTMatchingInfo>" />
157+
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHit, recob::OpFlash, sbn::crt::CRTPMTMatchingInfo>>" />
158+
159+
<!--<class name="art::Assns<recob::OpFlash,sbn::crt::CRTHit,sbn::crt::CRTPMTMatchingInfo>"/>
160+
<class name="art::Wrapper<art::Assns<recob::OpFlash,sbn::crt::CRTHit,sbn::crt::CRTPMTMatchingInfo> >"/>
161+
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHit,recob::OpFlash,sbn::crt::CRTPMTMatchingInfo> >"/>-->
116162
</lcgdict>

sbnobj/Common/Calibration/TrackCaloSkimmerObj.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define SBN_TrackCaloSkimmerObj
33

44
#include <climits>
5+
#include <limits> // for std::numeric_limits
56

67
#include <vector>
78

@@ -206,6 +207,9 @@ namespace sbn {
206207
std::vector<TrueHit> truehits1; //!< List of True "hits" of this particle on Plane 1
207208
std::vector<TrueHit> truehits2; //!< List of True "hits" of this particle on Plane 2
208209

210+
std::vector<Vector3D> traj; //!< True trajectory of particle
211+
std::vector<Vector3D> traj_sce; //!< True trajectory of particle, deflected by space charge
212+
209213
TrueParticle():
210214
plane0VisE(std::numeric_limits<float>::signaling_NaN()),
211215
plane1VisE(std::numeric_limits<float>::signaling_NaN()),

sbnobj/Common/Calibration/classes_def.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<class name="sbn::TrackTruth" ClassVersion="10">
66
<version ClassVersion="10" checksum="2749399767"/>
77
</class>
8-
<class name="sbn::TrueParticle" ClassVersion="11">
8+
<class name="sbn::TrueParticle" ClassVersion="12">
9+
<version ClassVersion="12" checksum="3355992085"/>
910
<version ClassVersion="11" checksum="855399631"/>
1011
<version ClassVersion="10" checksum="2150513055"/>
1112
</class>

sbnobj/Common/EventGen/MeVPrtl/MeVPrtlFlux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class MeVPrtlFlux {
2222
double C4;
2323
double C5;
2424
double mass;
25+
double polarization;
2526
int meson_pdg;
2627
int secondary_pdg;
2728
int generator;

sbnobj/Common/EventGen/MeVPrtl/classes_def.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
<class name="art::Wrapper<evgen::ldm::MeVPrtlDecay>" />
2525
<class name="art::Wrapper<std::vector<evgen::ldm::MeVPrtlDecay>>" />
2626

27-
<class name="evgen::ldm::MeVPrtlFlux" ClassVersion="13" >
27+
<class name="evgen::ldm::MeVPrtlFlux" ClassVersion="15" >
28+
<version ClassVersion="15" checksum="1124353542"/>
29+
<version ClassVersion="14" checksum="3307820966"/>
2830
<version ClassVersion="13" checksum="2581972823"/>
2931
<version ClassVersion="12" checksum="58715042"/>
3032
<version ClassVersion="11" checksum="2679592796"/>

sbnobj/Common/PMT/Data/V1730channelConfiguration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define SBNOBJ_COMMON_PMT_DATA_V1730CHANNELCONFIGURATION_H
1111

1212
// LArSoft libraries
13+
#include <cstdint> // uint16_t in OpDetWaveform.h
1314
#include "lardataobj/RawData/OpDetWaveform.h" // raw::Channel_t
1415

1516
// C/C++ standard libraries

sbnobj/Common/Reco/MVAPID.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "messagefacility/MessageLogger/MessageLogger.h"
55

66
#include <algorithm>
7+
#include <limits> // for std::numeric_limits
78

89
void sbn::MVAPID::AddScore(int pdg, float score)
910
{

0 commit comments

Comments
 (0)