Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
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

SpacePoint::SpacePoint ( )

Definition at line 17 of file SpacePoint.cxx.

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

Definition at line 26 of file SpacePoint.cxx.

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  }
ID_t fID
Default constructor.
Definition: SpacePoint.h:35
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:36
Double32_t fChisq
Chisquare.
Definition: SpacePoint.h:38
void err(const char *fmt,...)
Definition: message.cpp:226
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:37

Member Function Documentation

Double32_t SpacePoint::Chisq ( ) const
inline

Definition at line 78 of file SpacePoint.h.

78 { return fChisq; }
Double32_t fChisq
Chisquare.
Definition: SpacePoint.h:38
double 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 38 of file SpacePoint.cxx.

38  {
39 
40  return fErrXYZ[covIndex(i, j)];
41 
42  } // 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:46
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:37
constexpr std::size_t SpacePoint::covIndex ( unsigned int  i,
unsigned int  j 
)
static

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

Definition at line 46 of file SpacePoint.cxx.

46  {
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()
void swap(Handle< T > &a, Handle< T > &b)
const Double32_t * SpacePoint::ErrXYZ ( ) const
inline

Definition at line 77 of file SpacePoint.h.

77 { return fErrXYZ; }
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:37
recob::SpacePoint::ID_t SpacePoint::ID ( ) const
inline

Definition at line 75 of file SpacePoint.h.

75 { return fID; }
ID_t fID
Default constructor.
Definition: SpacePoint.h:35
geo::Point_t SpacePoint::position ( ) const
inline

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

Definition at line 80 of file SpacePoint.h.

80 { return geo::Point_t{ fXYZ[0], fXYZ[1], fXYZ[2] }; }
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:36
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:184
const Double32_t * SpacePoint::XYZ ( ) const
inline

Definition at line 76 of file SpacePoint.h.

76 { return fXYZ; }
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:36

Friends And Related Function Documentation

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

Definition at line 74 of file SpacePoint.cxx.

75  {
76  if(a.ID() != b. ID())
77  return a.ID()<b.ID();
78 
79  return false; //They are equal
80 
81  }
ID_t ID() const
Definition: SpacePoint.h:75
std::ostream& operator<< ( std::ostream &  o,
const SpacePoint a 
)
friend

Definition at line 58 of file SpacePoint.cxx.

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  }
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331

Member Data Documentation

Double32_t recob::SpacePoint::fChisq
private

Chisquare.

Definition at line 38 of file SpacePoint.h.

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

Error matrix (lower triangular).

Definition at line 37 of file SpacePoint.h.

ID_t recob::SpacePoint::fID
private

Default constructor.

SpacePoint ID

Definition at line 35 of file SpacePoint.h.

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

position of SpacePoint in xyz

Definition at line 36 of file SpacePoint.h.

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: