Skip to content

Commit b890453

Browse files
authored
Merge pull request #84 from SBNSoftware/feature/hlay_crt_clustering_spacepoint
Add CRTSpacePoint object
2 parents f1c355f + 4d110ca commit b890453

2 files changed

Lines changed: 109 additions & 0 deletions

File tree

sbnobj/SBND/CRT/CRTSpacePoint.cxx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#ifndef SBND_CRTSPACEPOINT_CXX
2+
#define SBND_CRTSPACEPOINT_CXX
3+
4+
#include "sbnobj/SBND/CRT/CRTSpacePoint.hh"
5+
6+
namespace sbnd {
7+
8+
namespace crt {
9+
10+
CRTSpacePoint::CRTSpacePoint()
11+
: fPos ({0., 0., 0.})
12+
, fPosErr ({0., 0., 0.})
13+
, fPE (0.)
14+
, fTime (0.)
15+
, fTimeErr (0.)
16+
, fComplete (false)
17+
{}
18+
19+
CRTSpacePoint::CRTSpacePoint(double _x, double _ex, double _y, double _ey, double _z, double _ez,
20+
double _pe, double _time, double _etime, bool _complete)
21+
: fPos ({_x, _y, _z})
22+
, fPosErr ({_ex, _ey, _ez})
23+
, fPE (_pe)
24+
, fTime (_time)
25+
, fTimeErr (_etime)
26+
, fComplete (_complete)
27+
{}
28+
29+
CRTSpacePoint::CRTSpacePoint(geo::Point_t _pos, geo::Point_t _err, double _pe, double _time, double _etime, bool _complete)
30+
: fPos (_pos)
31+
, fPosErr (_err)
32+
, fPE (_pe)
33+
, fTime (_time)
34+
, fTimeErr (_etime)
35+
, fComplete (_complete)
36+
{}
37+
38+
CRTSpacePoint::~CRTSpacePoint() {}
39+
40+
double CRTSpacePoint::X() const { return fPos.X(); }
41+
double CRTSpacePoint::XErr() const { return fPosErr.X(); }
42+
double CRTSpacePoint::Y() const { return fPos.Y(); }
43+
double CRTSpacePoint::YErr() const { return fPosErr.Y(); }
44+
double CRTSpacePoint::Z() const { return fPos.Z(); }
45+
double CRTSpacePoint::ZErr() const { return fPosErr.Z(); }
46+
geo::Point_t CRTSpacePoint::Pos() const { return fPos; }
47+
geo::Point_t CRTSpacePoint::Err() const { return fPosErr; }
48+
double CRTSpacePoint::PE() const { return fPE; }
49+
double CRTSpacePoint::Time() const { return fTime; }
50+
double CRTSpacePoint::TimeErr() const { return fTimeErr; }
51+
bool CRTSpacePoint::Complete() const { return fComplete; }
52+
}
53+
}
54+
55+
#endif

sbnobj/SBND/CRT/CRTSpacePoint.hh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* \class CRTSpacePoint
3+
*
4+
* \brief Product to store the characterisation of a cluster
5+
*
6+
* \author Henry Lay (h.lay@lancaster.ac.uk)
7+
*
8+
*/
9+
10+
#ifndef SBND_CRTSPACEPOINT_HH
11+
#define SBND_CRTSPACEPOINT_HH
12+
13+
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
14+
15+
namespace sbnd::crt {
16+
17+
class CRTSpacePoint {
18+
19+
geo::Point_t fPos; // position [cm]
20+
geo::Point_t fPosErr; // positional error [cm]
21+
double fPE; // total PE
22+
double fTime; // time [ns]
23+
double fTimeErr; // time error [ns]
24+
bool fComplete; // whether or not the cluster was 3D and contained overlaps
25+
26+
public:
27+
28+
CRTSpacePoint();
29+
30+
CRTSpacePoint(double _x, double _ex, double _y, double _ey, double _z, double _ez, double _pe,
31+
double _time, double _etime, bool _complete);
32+
33+
CRTSpacePoint(geo::Point_t _pos, geo::Point_t _err, double _pe, double _time, double _etime, bool _complete);
34+
35+
virtual ~CRTSpacePoint();
36+
37+
double X() const;
38+
double XErr() const;
39+
double Y() const;
40+
double YErr() const;
41+
double Z() const;
42+
double ZErr() const;
43+
geo::Point_t Pos() const;
44+
geo::Point_t Err() const;
45+
double PE() const;
46+
double Time() const;
47+
double TimeErr() const;
48+
bool Complete() const;
49+
50+
CRTSpacePoint& operator= (CRTSpacePoint const&) = default;
51+
};
52+
}
53+
54+
#endif

0 commit comments

Comments
 (0)