Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
lardataobj
lardataobj
RecoBase
SpacePoint.cxx
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////////
2
//
3
// Implementation of SpacePoint class for LArSoft
4
//
5
// msoderbe@syr.edu
6
//
7
////////////////////////////////////////////////////////////////////////////
8
9
#include "
lardataobj/RecoBase/SpacePoint.h
"
10
11
#include <iomanip>
12
#include <algorithm>
// std::swap()
13
14
namespace
recob
{
15
16
//----------------------------------------------------------------------
17
SpacePoint::SpacePoint
() :
18
fID(-1),
19
fXYZ { 0.0 },
20
fErrXYZ
{ 0.0 },
21
fChisq
(0.)
22
{
23
}
24
25
//----------------------------------------------------------------------
26
SpacePoint::SpacePoint
(Double32_t
const
*xyz,
27
Double32_t
const
*
err
,
28
Double32_t chisq,
29
int
id
)
30
:
fID
(id)
31
,
fChisq
(chisq)
32
{
33
for
(
int
i = 0; i < 3; ++i)
fXYZ
[i] = xyz[i];
34
for
(
int
i = 0; i < 6; ++i)
fErrXYZ
[i] = err[i];
35
}
36
37
//----------------------------------------------------------------------
38
double
SpacePoint::covariance
(
unsigned
int
i,
unsigned
int
j)
const
{
39
40
return
fErrXYZ
[
covIndex
(i, j)];
41
42
}
// SpacePoint::covariance()
43
44
45
//----------------------------------------------------------------------
46
constexpr std::size_t
SpacePoint::covIndex
(
unsigned
int
i,
unsigned
int
j) {
47
48
constexpr std::size_t offsets[3U] = { 0U, 1U, 3U };
49
50
if
(i < j)
std::swap
(i, j);
51
return
offsets[i] + j;
52
53
}
// SpacePoint::covIndex()
54
55
//----------------------------------------------------------------------
56
// ostream operator.
57
//
58
std::ostream&
operator<<
(std::ostream& o,
const
SpacePoint
&
a
)
59
{
60
o << std::setiosflags(std::ios::fixed) <<
std::setprecision
(2);
61
o <<
" SpacePoint ID "
<<
std::setw
(5) <<
std::right
<< a.
ID
()
62
<<
" (X,Y,Z) = ("
<<
std::setw
(5) <<
std::right
<< a.
XYZ
()[0]
63
<<
" , "
<<
std::setw
(5) <<
std::right
<< a.
XYZ
()[1]
64
<<
" , "
<<
std::setw
(5) <<
std::right
<< a.
XYZ
()[2]
65
<<
")"
;
66
67
return
o;
68
}
69
70
71
//----------------------------------------------------------------------
72
// < operator.
73
//
74
bool
operator <
(
const
SpacePoint
&
a
,
const
SpacePoint
&
b
)
75
{
76
if
(a.
ID
() != b.
ID
())
77
return
a.
ID
()<b.
ID
();
78
79
return
false
;
//They are equal
80
81
}
82
83
}
84
recob::SpacePoint::covariance
double covariance(unsigned int i, unsigned int j) const
Definition:
SpacePoint.cxx:38
recob
Reconstruction base classes.
Definition:
AdcChannelData.h:91
recob::SpacePoint::fID
ID_t fID
Default constructor.
Definition:
SpacePoint.h:35
setprecision
Q_EXPORT QTSManip setprecision(int p)
Definition:
qtextstream.h:343
recob::SpacePoint::fXYZ
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition:
SpacePoint.h:36
art::swap
void swap(Handle< T > &a, Handle< T > &b)
recob::SpacePoint::SpacePoint
SpacePoint()
Definition:
SpacePoint.cxx:17
a
const double a
Definition:
gUpMuFluxGen.cxx:164
recob::SpacePoint::covIndex
static constexpr std::size_t covIndex(unsigned int i, unsigned int j)
Returns the internal index of correlation structure for coordinates i and j.
Definition:
SpacePoint.cxx:46
recob::SpacePoint::fChisq
Double32_t fChisq
Chisquare.
Definition:
SpacePoint.h:38
recob::SpacePoint::operator<
friend bool operator<(const SpacePoint &a, const SpacePoint &b)
Definition:
SpacePoint.cxx:74
err
void err(const char *fmt,...)
Definition:
message.cpp:226
wirecell.validate.cmaps.right
right
Definition:
cmaps.py:84
setw
Q_EXPORT QTSManip setw(int w)
Definition:
qtextstream.h:331
recob::SpacePoint::fErrXYZ
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition:
SpacePoint.h:37
SpacePoint.h
recob::SpacePoint::XYZ
const Double32_t * XYZ() const
Definition:
SpacePoint.h:76
b
static bool * b
Definition:
config.cpp:1043
recob::SpacePoint::ID
ID_t ID() const
Definition:
SpacePoint.h:75
recob::SpacePoint::operator<<
friend std::ostream & operator<<(std::ostream &o, const SpacePoint &a)
Definition:
SpacePoint.cxx:58
recob::SpacePoint
Definition:
SpacePoint.h:23
Generated by
1.8.11