FEDRA emulsion software from the OPERA Collaboration
SKalman.hh
Go to the documentation of this file.
1 #ifndef __SKALMAN_HH
2 #define __SKALMAN_HH
3 // ********************************************************************
4 //
5 // source:
6 //
7 // type: source code
8 //
9 // created: 10. Apr 2001
10 //
11 // author: Thorsten Glebe
12 // HERA-B Collaboration
13 // Max-Planck-Institut fuer Kernphysik
14 // Saupfercheckweg 1
15 // 69117 Heidelberg
16 // Germany
17 // E-mail: T.Glebe@mpi-hd.mpg.de
18 //
19 // Description: A fixed size class for Kalman filter Vertex fit
20 //
21 // changes:
22 // 10 Apr 2001 (TG) creation
23 // 12 Apr 2001 (TG) p(), tvec(), evec(), pvec(), F(), ES(), DS() added
24 // 18 Apr 2001 (TG) doc++ comments added, removed use_mom template parameter
25 // 24 Apr 2001 (TG) tx(), ty() added
26 // 04 Mai 2001 (TG) added Track inheritance, some functions are dummy
27 // 11 Jun 2001 (TG) added COV(), cov_tx(), cov_ty(), cov_p()
28 // 29 Jun 2001 (TG) added charge(), pz(), energy(), xf(), rap(), xfabs() removed
29 // 05 Jul 2001 (TG) collect() added
30 // 09 Jul 2001 (TG) added isValid(), valid(), invalid() from Track
31 // 10 Jul 2001 (TG) operator==() added
32 // 09 Jan 2002 (TG) changed return type of propagate() to bool
33 //
34 // ********************************************************************
35 #include <cmath>
36 #include <iosfwd>
37 #include "vt++/VtTrack.hh"
38 
39 template <unsigned int NTR> class SVertex;
40 
45 //==============================================================================
46 // SKalman
47 //==============================================================================
48 template <unsigned int NTR>
49 class SKalman : public Track {
50 public:
55  SKalman(const Track& t, const SVertex<NTR>& v);
56 
59  float x() const;
61  float y() const;
63  float x(float z) const;
65  float y(float z) const;
67  float z() const;
69  float tx() const;
71  float ty() const;
73  float p() const;
75  float pt() const;
77  float pz() const;
79  float chi2() const;
81  float phi() const;
83  float theta() const;
85  float eta() const;
87  int charge() const;
88 
90  float energy(double mass = 0.) const;
93  float xf(double mass = 0.) const;
95  float rap(double mass = 0.) const;
96 
105 
107  void collect(vector<Track*>& c) const;
108 
111  bool isValid() const;
113  void valid();
115  void invalid();
117  const SMatrix<double,5>& COV() const;
119  const SMatrix<double,5>& CINV() const;
121  bool propagate(const double z);
123  unsigned short int ndf() const;
125  float cov_x(double dz=0.) const;
127  float cov_y(double dz=0.) const;
129  float cov_tx() const;
131  float cov_ty() const;
133  float cov_p() const;
134 
137  bool operator==(const Track& rhs) const;
138 
141  const SMatrix<double,3>& KCOV() const;
143  const SMatrix<double,3>& KCINV() const;
145  const SVector<double,3>& xv() const;
147  const SMatrix<double,3>& F() const;
149  const SMatrix<double,3>& ES() const;
151  const SMatrix<double,3>& DS() const;
152 
155  bool filter(const unsigned int I);
157  bool smooth();
159  bool smoothC();
161  std::ostream& print( std::ostream& ) const;
162 
163 private:
164  const Track* track_;
166  double k_tx;
167  double k_ty;
168  double k_chi2;
180 };
181 
182 
183 //==============================================================================
184 // operator <<
185 //==============================================================================
186 template <unsigned int NTR>
187 inline std::ostream& operator<< (std::ostream& os, const SKalman<NTR>& vt) {
188  return vt.print( os );
189 }
190 
191 #include "SKalman.icc"
192 #endif
std::ostream & operator<<(std::ostream &os, const SKalman< NTR > &vt)
Definition: SKalman.hh:187
TTree * t
Definition: check_shower.C:4
Definition: SKalman.hh:49
std::ostream & print(std::ostream &) const
used by operator<<()
SVector< double, 3 > k_qv
Definition: SKalman.hh:171
float p() const
refitted momentum
bool propagate(const double z)
dummy function: do nothing
float energy(double mass=0.) const
$E = \sqrt{m^2 + p^2}$
double k_ty
Definition: SKalman.hh:167
float y(float z) const
refitted Track $y$ position at $z$
unsigned short int ndf() const
returns always 0
double k_tx
Definition: SKalman.hh:166
const SMatrix< double, 3 > & F() const
bool smooth()
smoother step
float rap(double mass=0.) const
Rapidity $y = \frac{1}{2}\ln(\frac{E+p_z}{E-p_z})$.
bool smoothC()
cov. matrices of smoothed parameters
SMatrix< double, 3 > k_CINV
Definition: SKalman.hh:173
const SMatrix< double, 5 > & CINV() const
returns a 0 matrix
float x(float z) const
refitted Track $x$ position at $z$
float phi() const
refitted azimuthal angle $\phi$ [deg]
float theta() const
refitted polar angle $\theta = \cos^{-1}(e_z)$ [deg]
float cov_y(double dz=0.) const
returns 0
double k_chi2
Definition: SKalman.hh:168
SVector< double, 3 > tvec() const
$\vec{v} = (t_x,t_y,1.)$ refitted slope vector
float cov_ty() const
returns 0
float ty() const
refitted track slope $t_y$
const Track * track_
Definition: SKalman.hh:164
SVector< double, 3 > pvec() const
$\vec{v} = (p_x,p_y,p_z)$ refitted mom. vector
float tx() const
refitted track slope $t_x$
SMatrix< double, 3 > k_C
Definition: SKalman.hh:172
SMatrix< double, 3 > k_W
Definition: SKalman.hh:176
void invalid()
does nothing
const SMatrix< double, 3 > & KCINV() const
SMatrix< double, 3 > k_ES
Definition: SKalman.hh:178
const SMatrix< double, 3 > & ES() const
const SMatrix< double, 3 > & KCOV() const
void collect(vector< Track * > &c) const
collect pointers
float cov_x(double dz=0.) const
returns 0
SKalman(const Track &t, const SVertex< NTR > &v)
SVector< double, 3 > xvec() const
vertex position
SVector< double, 3 > evec() const
$\vec{v} = (e_x,e_y,e_z)$ unit vector along refitted track
SVector< double, 5 > k_pc
Definition: SKalman.hh:174
float chi2() const
Kalman $\chi^2$. Use only if you know what it is!
SMatrix< double, 3 > k_F
Definition: SKalman.hh:177
SVector< double, 3 > k_xv
Definition: SKalman.hh:170
float pz() const
momentum along $z$: $p / \sqrt{t_x^2+t_y^2+1}$
void valid()
does nothing
float z() const
refitted Track $z$ position (= vertex $z$ position)
const SMatrix< double, 3 > & DS() const
SMatrix< double, 3 > k_DS
Definition: SKalman.hh:179
float xf(double mass=0.) const
bool isValid() const
returns always true
SVector< double, 3 > k_qvs
Definition: SKalman.hh:169
const SVertex< NTR > * vtx_
Definition: SKalman.hh:165
bool filter(const unsigned int I)
filter step
float y() const
refitted Track $y$ position (= vertex $y$ position)
float x() const
refitted Track $x$ position (= vertex $x$ position)
SMatrix< double, 3, 5 > k_WBG
Definition: SKalman.hh:175
bool operator==(const Track &rhs) const
compare Track pointers
const SVector< double, 3 > & xv() const
const SMatrix< double, 5 > & COV() const
returns a 0 matrix
float cov_p() const
returns 0
int charge() const
particle charge: -1 for neg. +1 for pos. & neutrals
float cov_tx() const
returns 0
float pt() const
refitted transverse Track momentum $p_t$
float eta() const
refitted rapidity $\eta = -\log\tan(\theta/2.)$
Definition: SVertex.hh:73
Definition: Track.h:10
double dz
Definition: Track.h:46
float mass
Definition: check_vertex.C:21