Skip to content

Commit 60bc2e5

Browse files
authored
Merge branch 'develop' into feature/aheggest_reassignCRTPMTMatchIDinCAF
2 parents 821e37b + a0ef986 commit 60bc2e5

12 files changed

Lines changed: 102 additions & 66 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.19.04 LANGUAGES CXX)
17+
project(sbnobj VERSION 09.19.05 LANGUAGES CXX)
1818

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

sbnobj/SBND/CRT/CRTCluster.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace sbnd {
1616
, fComposition (kUndefinedSet)
1717
{}
1818

19-
CRTCluster::CRTCluster(uint32_t _ts0, uint32_t _ts1, uint32_t _unixS, uint16_t _nHits, CRTTagger _tagger,
19+
CRTCluster::CRTCluster(int64_t _ts0, int64_t _ts1, uint32_t _unixS, uint16_t _nHits, CRTTagger _tagger,
2020
CoordSet _composition)
2121
: fTs0 (_ts0)
2222
, fTs1 (_ts1)
@@ -28,8 +28,8 @@ namespace sbnd {
2828

2929
CRTCluster::~CRTCluster() {}
3030

31-
uint32_t CRTCluster::Ts0() const { return fTs0; }
32-
uint32_t CRTCluster::Ts1() const { return fTs1; }
31+
int64_t CRTCluster::Ts0() const { return fTs0; }
32+
int64_t CRTCluster::Ts1() const { return fTs1; }
3333
uint32_t CRTCluster::UnixS() const { return fUnixS; }
3434
uint16_t CRTCluster::NHits() const { return fNHits; }
3535
CRTTagger CRTCluster::Tagger() const { return fTagger; }

sbnobj/SBND/CRT/CRTCluster.hh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace sbnd::crt {
1616

1717
class CRTCluster {
1818

19-
uint32_t fTs0; // T0 counter [ns]
20-
uint32_t fTs1; // T1 counter [ns]
19+
int64_t fTs0; // T0 counter [ns]
20+
int64_t fTs1; // T1 counter [ns]
2121
uint32_t fUnixS; // Unixtime of event [s]
2222
uint16_t fNHits; // The number of strip hits forming the cluster
2323
CRTTagger fTagger; // The tagger this cluster exists on
@@ -27,13 +27,13 @@ namespace sbnd::crt {
2727

2828
CRTCluster();
2929

30-
CRTCluster(uint32_t _ts0, uint32_t _ts1, uint32_t _unixS, uint16_t _nHits, CRTTagger _tagger,
30+
CRTCluster(int64_t _ts0, int64_t _ts1, uint32_t _unixS, uint16_t _nHits, CRTTagger _tagger,
3131
CoordSet _composition);
3232

3333
virtual ~CRTCluster();
3434

35-
uint32_t Ts0() const;
36-
uint32_t Ts1() const;
35+
int64_t Ts0() const;
36+
int64_t Ts1() const;
3737
uint32_t UnixS() const;
3838
uint16_t NHits() const;
3939
CRTTagger Tagger() const;

sbnobj/SBND/CRT/CRTSpacePoint.cxx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,34 @@ namespace sbnd {
1111
: fPos ({0., 0., 0.})
1212
, fPosErr ({0., 0., 0.})
1313
, fPE (0.)
14-
, fTime (0.)
15-
, fTimeErr (0.)
14+
, fTs0 (0.)
15+
, fTs0Err (0.)
16+
, fTs1 (0.)
17+
, fTs1Err (0.)
1618
, fComplete (false)
1719
{}
1820

1921
CRTSpacePoint::CRTSpacePoint(double _x, double _ex, double _y, double _ey, double _z, double _ez,
20-
double _pe, double _time, double _etime, bool _complete)
22+
double _pe, double _ts0, double _ets0, double _ts1, double _ets1, bool _complete)
2123
: fPos ({_x, _y, _z})
2224
, fPosErr ({_ex, _ey, _ez})
2325
, fPE (_pe)
24-
, fTime (_time)
25-
, fTimeErr (_etime)
26+
, fTs0 (_ts0)
27+
, fTs0Err (_ets0)
28+
, fTs1 (_ts1)
29+
, fTs1Err (_ets1)
2630
, fComplete (_complete)
2731
{}
2832

29-
CRTSpacePoint::CRTSpacePoint(geo::Point_t _pos, geo::Point_t _err, double _pe, double _time, double _etime, bool _complete)
33+
CRTSpacePoint::CRTSpacePoint(geo::Point_t _pos, geo::Point_t _err, double _pe, double _ts0, double _ets0,
34+
double _ts1, double _ets1, bool _complete)
3035
: fPos (_pos)
3136
, fPosErr (_err)
3237
, fPE (_pe)
33-
, fTime (_time)
34-
, fTimeErr (_etime)
38+
, fTs0 (_ts0)
39+
, fTs0Err (_ets0)
40+
, fTs1 (_ts1)
41+
, fTs1Err (_ets1)
3542
, fComplete (_complete)
3643
{}
3744

@@ -46,8 +53,10 @@ namespace sbnd {
4653
geo::Point_t CRTSpacePoint::Pos() const { return fPos; }
4754
geo::Point_t CRTSpacePoint::Err() const { return fPosErr; }
4855
double CRTSpacePoint::PE() const { return fPE; }
49-
double CRTSpacePoint::Time() const { return fTime; }
50-
double CRTSpacePoint::TimeErr() const { return fTimeErr; }
56+
double CRTSpacePoint::Ts0() const { return fTs0; }
57+
double CRTSpacePoint::Ts0Err() const { return fTs0Err; }
58+
double CRTSpacePoint::Ts1() const { return fTs1; }
59+
double CRTSpacePoint::Ts1Err() const { return fTs1Err; }
5160
bool CRTSpacePoint::Complete() const { return fComplete; }
5261
}
5362
}

sbnobj/SBND/CRT/CRTSpacePoint.hh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,21 @@ namespace sbnd::crt {
1919
geo::Point_t fPos; // position [cm]
2020
geo::Point_t fPosErr; // positional error [cm]
2121
double fPE; // total PE
22-
double fTime; // time [ns]
23-
double fTimeErr; // time error [ns]
22+
double fTs0; // time according to T0 clock [ns]
23+
double fTs0Err; // error on time according to T0 clock [ns]
24+
double fTs1; // time according to T1 clock [ns]
25+
double fTs1Err; // error on time according to T1 clock [ns]
2426
bool fComplete; // whether or not the cluster was 3D and contained overlaps
2527

2628
public:
2729

2830
CRTSpacePoint();
2931

3032
CRTSpacePoint(double _x, double _ex, double _y, double _ey, double _z, double _ez, double _pe,
31-
double _time, double _etime, bool _complete);
33+
double _ts0, double _ets0, double _ts1, double _ets1, bool _complete);
3234

33-
CRTSpacePoint(geo::Point_t _pos, geo::Point_t _err, double _pe, double _time, double _etime, bool _complete);
35+
CRTSpacePoint(geo::Point_t _pos, geo::Point_t _err, double _pe, double _ts0, double _ets0,
36+
double _ts1, double _ets1, bool _complete);
3437

3538
virtual ~CRTSpacePoint();
3639

@@ -43,8 +46,10 @@ namespace sbnd::crt {
4346
geo::Point_t Pos() const;
4447
geo::Point_t Err() const;
4548
double PE() const;
46-
double Time() const;
47-
double TimeErr() const;
49+
double Ts0() const;
50+
double Ts0Err() const;
51+
double Ts1() const;
52+
double Ts1Err() const;
4853
bool Complete() const;
4954

5055
CRTSpacePoint& operator= (CRTSpacePoint const&) = default;

sbnobj/SBND/CRT/CRTStripHit.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace sbnd {
2020
, fSaturated2 (false)
2121
{}
2222

23-
CRTStripHit::CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
23+
CRTStripHit::CRTStripHit(uint32_t _channel, int64_t _ts0, int64_t _ts1, uint32_t _s, double _pos,
2424
double _err, uint16_t _adc1, uint16_t _adc2)
2525
: fChannel (_channel)
2626
, fTs0 (_ts0)
@@ -35,7 +35,7 @@ namespace sbnd {
3535
fSaturated2 = fADC2 == 4095;
3636
}
3737

38-
CRTStripHit::CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
38+
CRTStripHit::CRTStripHit(uint32_t _channel, int64_t _ts0, int64_t _ts1, uint32_t _s, double _pos,
3939
double _err, uint16_t _adc1, uint16_t _adc2, bool _saturated1, bool _saturated2)
4040
: fChannel (_channel)
4141
, fTs0 (_ts0)
@@ -52,8 +52,8 @@ namespace sbnd {
5252
CRTStripHit::~CRTStripHit() {}
5353

5454
uint32_t CRTStripHit::Channel() const { return fChannel; }
55-
uint32_t CRTStripHit::Ts0() const { return fTs0; }
56-
uint32_t CRTStripHit::Ts1() const { return fTs1; }
55+
int64_t CRTStripHit::Ts0() const { return fTs0; }
56+
int64_t CRTStripHit::Ts1() const { return fTs1; }
5757
uint32_t CRTStripHit::UnixS() const { return fUnixS; }
5858
double CRTStripHit::Pos() const { return fPos; }
5959
double CRTStripHit::Error() const { return fErr; }

sbnobj/SBND/CRT/CRTStripHit.hh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ namespace sbnd::crt {
1717
class CRTStripHit {
1818

1919
uint32_t fChannel; // Channel ID for 1st SiPM
20-
uint32_t fTs0; // T0 counter [ns] - Time relative to pulse-per-second
21-
uint32_t fTs1; // T1 counter [ns] - Time relative to some beam signal
20+
int64_t fTs0; // T0 counter [ns] - Time relative to pulse-per-second
21+
int64_t fTs1; // T1 counter [ns] - Time relative to some beam signal
2222
uint32_t fUnixS; // Unixtime of event [s]
2323
double fPos; // Lateral position within strip [cm]
2424
double fErr; // Error on lateral position [cm]
@@ -31,17 +31,17 @@ namespace sbnd::crt {
3131

3232
CRTStripHit();
3333

34-
CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
34+
CRTStripHit(uint32_t _channel, int64_t _ts0, int64_t _ts1, uint32_t _s, double _pos,
3535
double _err, uint16_t _adc1, uint16_t _adc2);
3636

37-
CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
37+
CRTStripHit(uint32_t _channel, int64_t _ts0, int64_t _ts1, uint32_t _s, double _pos,
3838
double _err, uint16_t _adc1, uint16_t _adc2, bool _saturated1, bool _saturated2);
3939

4040
virtual ~CRTStripHit();
4141

4242
uint32_t Channel() const;
43-
uint32_t Ts0() const;
44-
uint32_t Ts1() const;
43+
int64_t Ts0() const;
44+
int64_t Ts1() const;
4545
uint32_t UnixS() const;
4646
double Pos() const;
4747
double Error() const;

sbnobj/SBND/CRT/CRTTrack.cxx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,36 @@ namespace sbnd {
99

1010
CRTTrack::CRTTrack()
1111
: fPoints ({})
12-
, fTime (0.)
13-
, fTimeErr (0.)
12+
, fTs0 (0.)
13+
, fTs0Err (0.)
14+
, fTs1 (0.)
15+
, fTs1Err (0.)
1416
, fPE (0.)
1517
, fToF (0.)
1618
, fTaggers ({})
1719
{}
1820

19-
CRTTrack::CRTTrack(const geo::Point_t &_start, const geo::Point_t &_end, const double &_time, const double &_etime,
20-
const double &_pe, const double &_tof, const std::set<CRTTagger> &_taggers)
21+
CRTTrack::CRTTrack(const geo::Point_t &_start, const geo::Point_t &_end, const double &_ts0, const double &_ets0,
22+
const double &_ts1, const double &_ets1, const double &_pe, const double &_tof,
23+
const std::set<CRTTagger> &_taggers)
2124
: fPoints ({_start, _end})
22-
, fTime (_time)
23-
, fTimeErr (_etime)
25+
, fTs0 (_ts0)
26+
, fTs0Err (_ets0)
27+
, fTs1 (_ts1)
28+
, fTs1Err (_ets1)
2429
, fPE (_pe)
2530
, fToF (_tof)
2631
, fTaggers (_taggers)
2732
{}
2833

29-
CRTTrack::CRTTrack(const std::vector<geo::Point_t> &_points, const double &_time, const double &_etime,
30-
const double &_pe, const double &_tof, const std::set<CRTTagger> &_taggers)
34+
CRTTrack::CRTTrack(const std::vector<geo::Point_t> &_points, const double &_ts0, const double &_ets0,
35+
const double &_ts1, const double &_ets1, const double &_pe, const double &_tof,
36+
const std::set<CRTTagger> &_taggers)
3137
: fPoints (_points)
32-
, fTime (_time)
33-
, fTimeErr (_etime)
38+
, fTs0 (_ts0)
39+
, fTs0Err (_ets0)
40+
, fTs1 (_ts1)
41+
, fTs1Err (_ets1)
3442
, fPE (_pe)
3543
, fToF (_tof)
3644
, fTaggers (_taggers)
@@ -39,8 +47,10 @@ namespace sbnd {
3947
CRTTrack::~CRTTrack() {}
4048

4149
std::vector<geo::Point_t> CRTTrack::Points() const { return fPoints; }
42-
double CRTTrack::Time() const {return fTime; }
43-
double CRTTrack::TimeErr() const { return fTimeErr; }
50+
double CRTTrack::Ts0() const {return fTs0; }
51+
double CRTTrack::Ts0Err() const { return fTs0Err; }
52+
double CRTTrack::Ts1() const {return fTs1; }
53+
double CRTTrack::Ts1Err() const { return fTs1Err; }
4454
double CRTTrack::PE() const { return fPE; }
4555
double CRTTrack::ToF() const { return fToF; }
4656
std::set<CRTTagger> CRTTrack::Taggers() const { return fTaggers; }

sbnobj/SBND/CRT/CRTTrack.hh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ namespace sbnd::crt {
2121
class CRTTrack {
2222

2323
std::vector<geo::Point_t> fPoints; // the fitted track points at each tagger [cm]
24-
double fTime; // average time [ns]
25-
double fTimeErr; // average time error [ns]
24+
double fTs0; // average time according to T0 clock [ns]
25+
double fTs0Err; // average time error according to T0 clock [ns]
26+
double fTs1; // average time according to T1 clock [ns]
27+
double fTs1Err; // average time error according to T1 clock [ns]
2628
double fPE; // total PE
2729
double fToF; // time from first space point to last [ns]
2830
std::set<CRTTagger> fTaggers; // which taggers were used to create the track
@@ -31,17 +33,21 @@ namespace sbnd::crt {
3133

3234
CRTTrack();
3335

34-
CRTTrack(const geo::Point_t &_start, const geo::Point_t &_end, const double &_time, const double &_etime,
35-
const double &_pe, const double &_tof, const std::set<CRTTagger> &_taggers);
36+
CRTTrack(const geo::Point_t &_start, const geo::Point_t &_end, const double &_ts0, const double &_ets0,
37+
const double &_ts1, const double &_ets1, const double &_pe, const double &_tof,
38+
const std::set<CRTTagger> &_taggers);
3639

37-
CRTTrack(const std::vector<geo::Point_t> &_points, const double &_time, const double &_etime,
38-
const double &_pe, const double &_tof, const std::set<CRTTagger> &_taggers);
40+
CRTTrack(const std::vector<geo::Point_t> &_points, const double &_ts0, const double &_ets0,
41+
const double &_ts1, const double &_ets1, const double &_pe, const double &_tof,
42+
const std::set<CRTTagger> &_taggers);
3943

4044
virtual ~CRTTrack();
4145

4246
std::vector<geo::Point_t> Points() const;
43-
double Time() const;
44-
double TimeErr() const;
47+
double Ts0() const;
48+
double Ts0Err() const;
49+
double Ts1() const;
50+
double Ts1Err() const;
4551
double PE() const;
4652
double ToF() const;
4753
std::set<CRTTagger> Taggers() const;

sbnobj/SBND/CRT/FEBData.hh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ namespace sbnd::crt {
2626
uint32_t fTs1; ///< T1 counter [ns]
2727
uint32_t fUnixS; ///< Event time since unix epoch [s]
2828
adc_array_t fADC; ///< 32 ADC values, one per SiPM
29-
uint32_t fCoinc; ///< ID of SiPM that fired the trigger
29+
uint32_t fCoinc; ///< This was intended to be the ID of SiPM that fired the trigger,
30+
///< the hardware doesn't fill this field so in data we are filling it
31+
///< with the cable delay for this module instead.
3032

3133
public:
3234

@@ -44,7 +46,7 @@ namespace sbnd::crt {
4446
* @param ts1 The value of the t1 counter.
4547
* @param unixs The event time since unix epoch.
4648
* @param ADC The 32-size array with ADC values.
47-
* @param coinc The ID of the strip that fired the trigger.
49+
* @param coinc Historical Name - Contains the cable delay for the module.
4850
*/
4951
FEBData(uint16_t mac5, uint16_t flags, uint32_t ts0, uint32_t ts1, uint32_t unixs, adc_array_t ADC, uint32_t coinc);
5052

@@ -104,9 +106,9 @@ namespace sbnd::crt {
104106
uint16_t ADC(size_t sipmID) const;
105107

106108
/**
107-
* Returns the ID of the sipm that fired the trigger.
109+
* Historical Name - Contains the cable delay for the module.
108110
*
109-
* @return The Coinc variable of this FEB data.
111+
* @return The cable delay of this module
110112
*/
111113
uint32_t Coinc() const;
112114

@@ -154,9 +156,9 @@ namespace sbnd::crt {
154156
void SetADC(size_t sipmID, uint16_t adc);
155157

156158
/**
157-
* Setter method for coinc
159+
* Setter method for cable delay
158160
*
159-
* @param coinc The coinc values to set
161+
* @param coinc The cable delay value to set
160162
*/
161163
void SetCoinc(uint32_t coinc);
162164
};

0 commit comments

Comments
 (0)