LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
recob::SpacePoint Class Reference

#include "SpacePoint.h"

Public Types

using ID_t = int
 type of spacepoint ID More...
 

Public Member Functions

 SpacePoint ()
 
 SpacePoint (Double32_t const *xyz, Double32_t const *err, Double32_t chisq, int id=InvalidID)
 
ID_t ID () const
 
const Double32_t * XYZ () const
 
const Double32_t * ErrXYZ () const
 
Double32_t Chisq () const
 
geo::Point_t position () const
 Returns the position of the point in world coordinates [cm]. More...
 
double covariance (unsigned int i, unsigned int j) const
 

Static Public Member Functions

static constexpr std::size_t covIndex (unsigned int i, unsigned int j)
 Returns the internal index of correlation structure for coordinates i and j. More...
 

Static Public Attributes

static constexpr ID_t InvalidID = util::kBogusI
 Special value for an invalid ID. More...
 

Private Attributes

ID_t fID
 Default constructor. More...
 
Double32_t fXYZ [3]
 position of SpacePoint in xyz More...
 
Double32_t fErrXYZ [6]
 Error matrix (lower triangular). More...
 
Double32_t fChisq
 Chisquare. More...
 

Friends

std::ostream & operator<< (std::ostream &o, const SpacePoint &a)
 
bool operator< (const SpacePoint &a, const SpacePoint &b)
 

Detailed Description

Definition at line 23 of file SpacePoint.h.

Member Typedef Documentation

type of spacepoint ID

Definition at line 26 of file SpacePoint.h.

Constructor & Destructor Documentation

recob::SpacePoint::SpacePoint ( )

Definition at line 17 of file SpacePoint.cxx.

17 : fID(-1), fXYZ{0.0}, fErrXYZ{0.0}, fChisq(0.) {}
ID_t fID
Default constructor.
Definition: SpacePoint.h:34
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:35
Double32_t fChisq
Chisquare.
Definition: SpacePoint.h:37
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:36
recob::SpacePoint::SpacePoint ( Double32_t const *  xyz,
Double32_t const *  err,
Double32_t  chisq,
int  id = InvalidID 
)

Definition at line 20 of file SpacePoint.cxx.

References fErrXYZ, and fXYZ.

21  : fID(id), fChisq(chisq)
22  {
23  for (int i = 0; i < 3; ++i)
24  fXYZ[i] = xyz[i];
25  for (int i = 0; i < 6; ++i)
26  fErrXYZ[i] = err[i];
27  }
ID_t fID
Default constructor.
Definition: SpacePoint.h:34
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:35
Double32_t fChisq
Chisquare.
Definition: SpacePoint.h:37
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:36

Member Function Documentation

Double32_t recob::SpacePoint::Chisq ( ) const
inline

Definition at line 86 of file SpacePoint.h.

References fChisq.

Referenced by trkf::SpacePointAlg::makeSpacePoints().

87 {
88  return fChisq;
89 }
Double32_t fChisq
Chisquare.
Definition: SpacePoint.h:37
double recob::SpacePoint::covariance ( unsigned int  i,
unsigned int  j 
) const

Returns the error matrix element for two position coordinates (0 for x, 1 for y and 2 for z)

Definition at line 30 of file SpacePoint.cxx.

References covIndex(), and fErrXYZ.

31  {
32 
33  return fErrXYZ[covIndex(i, j)];
34 
35  } // SpacePoint::covariance()
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:38
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:36
constexpr std::size_t recob::SpacePoint::covIndex ( unsigned int  i,
unsigned int  j 
)
static

Returns the internal index of correlation structure for coordinates i and j.

Definition at line 38 of file SpacePoint.cxx.

Referenced by covariance().

39  {
40 
41  constexpr std::size_t offsets[3U] = {0U, 1U, 3U};
42 
43  if (i < j) std::swap(i, j);
44  return offsets[i] + j;
45 
46  } // SpacePoint::covIndex()
void swap(lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &a, lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &b)
const Double32_t * recob::SpacePoint::ErrXYZ ( ) const
inline

Definition at line 82 of file SpacePoint.h.

References fErrXYZ.

83 {
84  return fErrXYZ;
85 }
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:36
recob::SpacePoint::ID_t recob::SpacePoint::ID ( ) const
inline
geo::Point_t recob::SpacePoint::position ( ) const
inline

Returns the position of the point in world coordinates [cm].

Definition at line 91 of file SpacePoint.h.

References fXYZ.

Referenced by ShowerRecoTools::ShowerTrackTrajToSpacePoint::CalculateElement(), shower::LArPandoraShowerAlg::DistanceBetweenSpacePoints(), shower::LArPandoraShowerAlg::SpacePointPerpendicular(), and shower::LArPandoraShowerAlg::SpacePointProjection().

92 {
93  return geo::Point_t{fXYZ[0], fXYZ[1], fXYZ[2]};
94 }
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:35
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180

Friends And Related Function Documentation

bool operator< ( const SpacePoint a,
const SpacePoint b 
)
friend

Definition at line 64 of file SpacePoint.cxx.

65  {
66  if (a.ID() != b.ID()) return a.ID() < b.ID();
67 
68  return false; //They are equal
69  }
std::ostream& operator<< ( std::ostream &  o,
const SpacePoint a 
)
friend

Definition at line 51 of file SpacePoint.cxx.

52  {
53  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
54  o << " SpacePoint ID " << std::setw(5) << std::right << a.ID() << " (X,Y,Z) = (" << std::setw(5)
55  << std::right << a.XYZ()[0] << " , " << std::setw(5) << std::right << a.XYZ()[1] << " , "
56  << std::setw(5) << std::right << a.XYZ()[2] << ")";
57 
58  return o;
59  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102

Member Data Documentation

Double32_t recob::SpacePoint::fChisq
private

Chisquare.

Definition at line 37 of file SpacePoint.h.

Referenced by Chisq().

Double32_t recob::SpacePoint::fErrXYZ[6]
private

Error matrix (lower triangular).

Definition at line 36 of file SpacePoint.h.

Referenced by covariance(), ErrXYZ(), and SpacePoint().

ID_t recob::SpacePoint::fID
private

Default constructor.

SpacePoint ID

Definition at line 34 of file SpacePoint.h.

Referenced by ID().

Double32_t recob::SpacePoint::fXYZ[3]
private

position of SpacePoint in xyz

Definition at line 35 of file SpacePoint.h.

Referenced by position(), SpacePoint(), and XYZ().

constexpr ID_t recob::SpacePoint::InvalidID = util::kBogusI
static

Special value for an invalid ID.

Definition at line 29 of file SpacePoint.h.


The documentation for this class was generated from the following files: