BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Ext_errmx.h
Go to the documentation of this file.
1//
2// File: Ext_errmx.h
3//
4// Description: Extrapolation error matrix( x, y, z, px, py, pz ).
5// The used coordinate system is the cartesian BESIII
6// coordinate system.
7//
8// Modified from BELLE by Wang Liangliang.
9//
10// Date: 2005.3.30
11//
12//
13
14#ifndef _Ext_Errmx_Flag_
15#define _Ext_Errmx_Flag_
16
17#include <iosfwd>
18
19#ifndef CLHEP_THREEVECTOR_H
20# include "CLHEP/Vector/ThreeVector.h"
21#endif
22
23#include "CLHEP/Matrix/Matrix.h"
24#include "CLHEP/Matrix/SymMatrix.h"
25#include "CLHEP/Matrix/Vector.h"
26
27using namespace CLHEP;
28
29static const int Ndim_err( 6 ); // Error matrix dimension.
30
31// Track error matrix handler.
32
33class Ext_errmx {
34
35public:
36 // Constructor
37 Ext_errmx();
38
39 // Copy constructor
40 Ext_errmx( const Ext_errmx& errmx );
41
42 // Constructor, initializing by HepSymMatrix error matrix.
43 Ext_errmx( const HepSymMatrix& err );
44
45 // Destructor
46 virtual ~Ext_errmx(){};
47
48 // Put the error matrix with a double array format.
49 void put_err( const double error[] );
50
51 // Put the error matrix with a HepSymMatrix format.
52 inline void put_err( const HepSymMatrix& err );
53
54 // Get the error matrix from the object.
55 inline const HepSymMatrix& get_err() const;
56
57 // Get the error along the readout direction.
58 double get_plane_err( const Hep3Vector& np, const Hep3Vector& nr ) const;
59
60 /** Get the 2D projected error vector on the detector plane.
61 \begin{itemize}
62 \item np: track direction unit vector.
63 \item nr: readout direction unit vector.
64 \item nt: ( np x nr ) unit vector.
65 \item HepVector(1)= error(sigma) along the nr.
66 \item HepVector(2)= error(sigma) along the nt.
67 \end{itemize}
68 */
69 const HepVector& get_plane_errs( const Hep3Vector& np, const Hep3Vector& nr,
70 const Hep3Vector& nt ) const;
71
72 /** Get 2D projected track error perpendicular to a given
73 vector at the current point. pv: a given vector,
74 momentum vector for example.
75 \begin{itemize}
76 \item view=1.
77 \begin{itemize}
78 \item Hep3Vector(1)= error(1 sigma) along the direction
79 which is perpendicular to pv on the xy plane.
80 \item Hep3Vector(2)= error(1 sigma) along the direction
81 which is (pv) x (HepVector(1) direction).
82 \end{itemize}
83 \item view=2.
84 \begin{itemize}
85 \item Hep3Vector(1)= error(1 sigma) along the direction
86 which is perpendicular to pv on the zy plane.
87 \item Hep3Vector(2)= error(1 sigma) along the direction
88 which is (pv) x (HepVector(1) direction).
89 \end{itemize}
90 \item view=3.
91 \begin{itemize}
92 \item Hep3Vector(1)= error(1 sigma) along the direction
93 which is perpendicular to pv on the zx plane.
94 \item Hep3Vector(2)= error(1 sigma) along the direction
95 which is (pv) x (HepVector(1) direction).
96 \end{itemize}
97 \end{itemize}
98 */
99 const Hep3Vector* get_tvs( const int view, const Hep3Vector& pv ) const;
100
101 /** Get the 2D projected track error perpendicular to
102 a given vector at the current point. pv: a given vector,
103 momentum vector, for example.
104 \begin{itemize}
105 \item Hep3Vector(1)= error(1 sigma) along the direction which is
106 perpendicular to pv on the plane formed by pv and z-axis.
107 \item Hep3Vector(2)= error(1 sigma) along the direction which is
108 (pv) x (HepVector(1) direction).
109 \end{itemize}
110 */
111 const Hep3Vector* get_tvs( const Hep3Vector& pv ) const;
112
113 // Check the validity of the error matrix.
114 bool valid( bool msg ) const;
115
116 // = Operator.
117 Ext_errmx& operator=( const Ext_errmx& errmx );
118
119 // << Operator.
120 friend std::ostream& operator<<( std::ostream& s, const Ext_errmx& errmx );
121
122protected:
123 // Setup m\_err3 and m\_R for get\_plane\_err(s).
124 void set_plane_errs( const Hep3Vector& nx, const Hep3Vector& ny,
125 const Hep3Vector& nz ) const;
126
127 // 6x6 symmetry error matrix(x,y,z,px,py,pz).
128 HepSymMatrix m_err;
129
130private:
131 mutable bool m_valid; // Valid flag.
132 mutable HepSymMatrix m_err3; // 3x3 sub error matrix(x,y,z).
133 mutable HepVector m_err2; // 2D projected error.
134 mutable Hep3Vector m_nv[2]; // 2D projected error direction.
135 mutable HepMatrix m_R; // 3x3 rotation matrix: BCS -> TCS
136};
137
138/*
139 Put the error matrix.
140*/
141inline void Ext_errmx::put_err( const HepSymMatrix& err ) {
142 m_err = err;
143 m_valid = 1;
144}
145
146/*
147 Get the error matrix.
148*/
149inline const HepSymMatrix& Ext_errmx::get_err() const { return m_err; }
150
151#endif /* _Ext_Errmx_Flag_ */
XmlRpcServer s
HepSymMatrix m_err
Definition Ext_errmx.h:128
virtual ~Ext_errmx()
Definition Ext_errmx.h:46
void put_err(const double error[])
Definition Ext_errmx.cxx:47
const HepSymMatrix & get_err() const
Definition Ext_errmx.h:149
bool valid(bool msg) const
Ext_errmx & operator=(const Ext_errmx &errmx)
friend std::ostream & operator<<(std::ostream &s, const Ext_errmx &errmx)
const Hep3Vector * get_tvs(const int view, const Hep3Vector &pv) const
void set_plane_errs(const Hep3Vector &nx, const Hep3Vector &ny, const Hep3Vector &nz) const
Definition Ext_errmx.cxx:60
const HepVector & get_plane_errs(const Hep3Vector &np, const Hep3Vector &nr, const Hep3Vector &nt) const
double get_plane_err(const Hep3Vector &np, const Hep3Vector &nr) const
Definition Ext_errmx.cxx:83