Skip to content

Commit 29ed37f

Browse files
authored
Merge pull request #82 from SBNSoftware/feature/hlay_crt_clustering_striphit
Add CRTStripHit object
2 parents 6877f7e + f93bda7 commit 29ed37f

2 files changed

Lines changed: 122 additions & 0 deletions

File tree

sbnobj/SBND/CRT/CRTStripHit.cxx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#ifndef SBND_CRTSTRIPHIT_CXX
2+
#define SBND_CRTSTRIPHIT_CXX
3+
4+
#include "sbnobj/SBND/CRT/CRTStripHit.hh"
5+
6+
namespace sbnd {
7+
8+
namespace crt {
9+
10+
CRTStripHit::CRTStripHit()
11+
: fChannel (0)
12+
, fTs0 (0)
13+
, fTs1 (0)
14+
, fUnixS (0)
15+
, fPos (0)
16+
, fErr (0)
17+
, fADC1 (0)
18+
, fADC2 (0)
19+
, fSaturated1 (false)
20+
, fSaturated2 (false)
21+
{}
22+
23+
CRTStripHit::CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
24+
double _err, uint16_t _adc1, uint16_t _adc2)
25+
: fChannel (_channel)
26+
, fTs0 (_ts0)
27+
, fTs1 (_ts1)
28+
, fUnixS (_s)
29+
, fPos (_pos)
30+
, fErr (_err)
31+
, fADC1 (_adc1)
32+
, fADC2 (_adc2)
33+
{
34+
fSaturated1 = fADC1 == 4095;
35+
fSaturated2 = fADC2 == 4095;
36+
}
37+
38+
CRTStripHit::CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
39+
double _err, uint16_t _adc1, uint16_t _adc2, bool _saturated1, bool _saturated2)
40+
: fChannel (_channel)
41+
, fTs0 (_ts0)
42+
, fTs1 (_ts1)
43+
, fUnixS (_s)
44+
, fPos (_pos)
45+
, fErr (_err)
46+
, fADC1 (_adc1)
47+
, fADC2 (_adc2)
48+
, fSaturated1 (_saturated1)
49+
, fSaturated2 (_saturated2)
50+
{}
51+
52+
CRTStripHit::~CRTStripHit() {}
53+
54+
uint32_t CRTStripHit::Channel() const { return fChannel; }
55+
uint32_t CRTStripHit::Ts0() const { return fTs0; }
56+
uint32_t CRTStripHit::Ts1() const { return fTs1; }
57+
uint32_t CRTStripHit::UnixS() const { return fUnixS; }
58+
double CRTStripHit::Pos() const { return fPos; }
59+
double CRTStripHit::Error() const { return fErr; }
60+
uint16_t CRTStripHit::ADC1() const { return fADC1; }
61+
uint16_t CRTStripHit::ADC2() const { return fADC2; }
62+
bool CRTStripHit::Saturated1() const { return fSaturated1; }
63+
bool CRTStripHit::Saturated2() const { return fSaturated2; }
64+
}
65+
}
66+
67+
#endif

sbnobj/SBND/CRT/CRTStripHit.hh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* \class CRTStripHit
3+
*
4+
* \brief Product to store 2D CRT "strip hit"
5+
*
6+
* \author Henry Lay (h.lay@lancaster.ac.uk)
7+
*
8+
*/
9+
10+
#ifndef SBND_CRTSTRIPHIT_HH
11+
#define SBND_CRTSTRIPHIT_HH
12+
13+
#include <stdint.h>
14+
15+
namespace sbnd::crt {
16+
17+
class CRTStripHit {
18+
19+
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
22+
uint32_t fUnixS; // Unixtime of event [s]
23+
double fPos; // Lateral position within strip [cm]
24+
double fErr; // Error on lateral position [cm]
25+
uint16_t fADC1; // ADC 1st SiPM
26+
uint16_t fADC2; // ADC 2nd SiPM
27+
bool fSaturated1; // Did 1st SiPM record a saturated value?
28+
bool fSaturated2; // Did 2nd SiPM record a saturated value?
29+
30+
public:
31+
32+
CRTStripHit();
33+
34+
CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
35+
double _err, uint16_t _adc1, uint16_t _adc2);
36+
37+
CRTStripHit(uint32_t _channel, uint32_t _ts0, uint32_t _ts1, uint32_t _s, double _pos,
38+
double _err, uint16_t _adc1, uint16_t _adc2, bool _saturated1, bool _saturated2);
39+
40+
virtual ~CRTStripHit();
41+
42+
uint32_t Channel() const;
43+
uint32_t Ts0() const;
44+
uint32_t Ts1() const;
45+
uint32_t UnixS() const;
46+
double Pos() const;
47+
double Error() const;
48+
uint16_t ADC1() const;
49+
uint16_t ADC2() const;
50+
bool Saturated1() const;
51+
bool Saturated2() const;
52+
};
53+
}
54+
55+
#endif

0 commit comments

Comments
 (0)