Skip to content

Commit fa05d0e

Browse files
authored
Merge branch 'develop' into feature/gp_triggerTicks
2 parents deb3d3f + 7ad1015 commit fa05d0e

15 files changed

Lines changed: 143 additions & 68 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.00.01 LANGUAGES CXX)
17+
project(sbnobj VERSION 10.00.00 LANGUAGES CXX)
1818

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

sbnobj/Common/CRT/CRTPMTMatching.hh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,42 @@ 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+
MatchType assignFlashClassification(uint topen, uint topex,
37+
uint sideen, uint sideex,
38+
uint bottomen, uint bottomex)
39+
{
40+
MatchType flashType;
41+
if (topen == 0 && sideen == 0 && topex == 0 && sideex == 0){
42+
if(bottomex==0 && bottomen==0) flashType = MatchType::noMatch;
43+
else if (bottomex>=1 && bottomen==0) flashType = MatchType::exBottom;
44+
else if (bottomex==0 && bottomen>=1) flashType = MatchType::enBottom;
45+
else flashType = MatchType::others;
46+
}
47+
else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 0){
48+
if(bottomex==1 && bottomen==0) flashType = MatchType::enTop_exBottom;
49+
else flashType = MatchType::enTop;
50+
}
51+
else if (topen == 0 && sideen == 1 && topex == 0 && sideex == 0)
52+
if(bottomex==1 && bottomen==0) flashType = MatchType::enSide_exBottom;
53+
else flashType = MatchType::enSide;
54+
else if (topen == 1 && sideen == 0 && topex == 0 && sideex == 1)
55+
flashType = MatchType::enTop_exSide;
56+
else if (topen == 0 && sideen == 0 && topex == 1 && sideex == 0){
57+
if(bottomex==0 && bottomen==1) flashType = MatchType::exTop_enBottom;
58+
else flashType = MatchType::exTop;
59+
}
60+
else if (topen == 0 && sideen == 0 && topex == 0 && sideex == 1)
61+
if(bottomex==0 && bottomen==1) flashType = MatchType::exSide_enBottom;
62+
else flashType = MatchType::exSide;
63+
else if (topen >= 1 && sideen == 0 && topex == 0 && sideex == 0) // could also add `if (MatchBottomCRT)` here
64+
flashType = MatchType::enTop_mult;
65+
else if (topen >= 1 && sideen == 0 && topex == 0 && sideex >= 1) // and here
66+
flashType = MatchType::enTop_exSide_mult;
67+
else
68+
flashType = MatchType::others;
69+
return flashType;
70+
}
71+
3672
/// Information about a CRT hit matched with a PMT flash.
3773
struct MatchedCRT {
3874

sbnobj/Common/Calibration/TrackCaloSkimmerObj.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ namespace sbn {
260260
std::vector<WireInfo> wires1; //!< List of wire information on plane 1
261261
std::vector<WireInfo> wires2; //!< List of wire information on plane 2
262262

263-
float t0; //!< T0 of track [us]
263+
float t0; //!< T0 of track [ns]
264+
float t0CRT; //!< T0 of track from CRT-TPC matching [ns]
264265
int whicht0; //!< Which T0 producer was used to tag
265266
int id; //!< ID of track
266267
int cryostat; //!< Cryostat number of track
@@ -311,6 +312,7 @@ namespace sbn {
311312

312313
TrackInfo():
313314
t0(-1),
315+
t0CRT(-1),
314316
id(-1),
315317
cryostat(-1),
316318
clear_cosmic_muon(false),

sbnobj/Common/Calibration/classes_def.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<version ClassVersion="11" checksum="903476586"/>
1515
<version ClassVersion="10" checksum="118230262"/>
1616
</class>
17-
<class name="sbn::TrackInfo" ClassVersion="13">
17+
<class name="sbn::TrackInfo" ClassVersion="14">
18+
<version ClassVersion="14" checksum="3729960902"/>
1819
<version ClassVersion="13" checksum="1962204283"/>
1920
<version ClassVersion="12" checksum="2151440214"/>
2021
<version ClassVersion="11" checksum="627908269"/>

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;

0 commit comments

Comments
 (0)