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