CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
KalFitAlg/KalFitAlg-00-15-20/KalFitAlg/lpav/Lpav.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// Package: <package>
4// Module: Lpav
5//
6// Description: <one line class summary>
7//
8// Usage:
9// <usage>
10//
11// Author: KATAYAMA Nobuhiko
12// Created: Fri Feb 6 10:21:38 JST 1998
13
14#if !defined(KALFIT_LPAV_H_INCLUDED)
15#define KALFIT_LPAV_H_INCLUDED
16
17// system include files
18#include <iosfwd>
19
20// user include files
21#include "CLHEP/Matrix/SymMatrix.h"
22#include "KalFitAlg/lpav/Lpar.h"
23
24 using CLHEP::HepVector;
25 using CLHEP::Hep3Vector;
26 using CLHEP::HepMatrix;
27 using CLHEP::HepSymMatrix;
28
29using namespace CLHEP;
30
31
32namespace KalmanFit{
33// forward declarations
34
35class Lpav : public Lpar
36{
37 // friend classes and functions
38
39 public:
40 // constants, enums and typedefs
41
42 // Constructors and destructor
43 Lpav();
44 virtual ~Lpav();
45
46 // member functions
47 void calculate_average(void);
48 void calculate_average3(void);
49 void calculate_average(double x, double y, double w=1);
50 void calculate_average3(double x, double y, double w=1);
51 double calculate_lpar(void);
52 double calculate_lpar3(void);
53 double fit();
54 double fit(double x, double y, double w=1);
55 inline void clear();
56 void add_point(double x, double y, double w=1);
57 void add_point_frac(double x, double y, double w, double f);
58
59 // const member functions
60 double nc() const { return m_nc; }
61 HepSymMatrix cov(int=0) const;
62 HepSymMatrix cov_c(int=0) const;
63 int extrapolate(double, double&, double&) const;
64 double similarity(double, double) const;
65 double delta_chisq(double x, double y, double w=1) const;
66 double chisq() const { return m_chisq; }
67 double prob() const;
68 double chi_deg() const;
69
70 // static member functions
71
72 // assignment operator(s)
73 inline const Lpav& operator=( const Lpav& );
74 const Lpav& operator=( const Lpar& );
75 const Lpav& operator+=( const Lpav& );
76
77 friend std::ostream& operator<<(std::ostream &o, const Lpav &s);
78 friend Lpav operator+(const Lpav &, const Lpav &);
79 class Singular {}; // exception class, no covarience matrix.
80 class Singular_c {}; // exception class, no covarience matrix_c
81
82 protected:
83 // protected member functions
84
85 // protected const member functions
86
87 private:
88 // Constructors and destructor
89 inline Lpav( const Lpav& );
90
91 // comparison operators
92 bool operator==( const Lpav& ) const;
93 bool operator!=( const Lpav& ) const;
94
95 // private member functions
96 void add(double x, double y, double w=1, double a=0, double b=0);
97 void sub(double x, double y, double w=1, double a=0, double b=0);
98 void calculate_average_n(double xxav, double yyav, double xyav,
99 double xrrav, double yrrav, double rrrrav);
100 double chisq(double chisq) { m_chisq = chisq; return m_chisq; }
101 double nc(double nc) { m_nc = nc; return m_nc; }
102 double solve_lambda(void);
103 double solve_lambda3(void);
104
105 // private const member functions
106
107 // data members
108 double m_wsum;
109 double m_xsum;
110 double m_ysum;
111 double m_xxsum;
112 double m_yysum;
113 double m_xysum;
114 double m_xrrsum;
115 double m_yrrsum;
116 double m_rrrrsum;
117
118 double m_wsum_temp;
119 double m_xav;
120 double m_yav;
121 double m_xyavp;
122
123 double m_rscale;
124 double m_xxavp;
125 double m_yyavp;
126 double m_xrravp;
127 double m_yrravp;
128 double m_rrrravp;
129 double m_sinrot;
130 double m_cosrot;
131
132 double m_nc;
133 double m_chisq;
134
135 // static data members
136
137};
138
139// inline function definitions
140inline const Lpav & Lpav::operator=(const Lpav &lp) {
141 Lpar::operator=(lp);
142 m_wsum = lp.m_wsum;
143 m_xsum = lp.m_xsum;
144 m_ysum = lp.m_ysum;
145 m_xxsum = lp.m_xxsum;
146 m_yysum = lp.m_yysum;
147 m_xysum = lp.m_xysum;
148 m_xrrsum = lp.m_xrrsum;
149 m_yrrsum = lp.m_yrrsum;
150 m_rrrrsum = lp.m_rrrrsum;
151
152 m_wsum_temp = lp. m_wsum_temp;
153 m_xav = lp.m_xav;
154 m_yav = lp.m_yav;
155 m_xyavp = lp.m_xyavp;
156
157 m_rscale = lp. m_rscale;
158 m_xxavp = lp.m_xxavp;
159 m_yyavp = lp.m_yyavp;
160 m_xrravp = lp.m_xrravp;
161 m_yrravp = lp.m_yrravp;
162 m_rrrravp = lp.m_rrrravp;
163 m_sinrot = lp.m_sinrot;
164 m_cosrot = lp.m_cosrot;
165
166 m_nc = lp. m_nc;
167 m_chisq = lp.m_chisq;
168 return *this;
169}
170
171inline Lpav::Lpav(const Lpav &lp) : Lpar(lp) {
172 m_wsum = lp.m_wsum;
173 m_xsum = lp.m_xsum;
174 m_ysum = lp.m_ysum;
175 m_xxsum = lp.m_xxsum;
176 m_yysum = lp.m_yysum;
177 m_xysum = lp.m_xysum;
178 m_xrrsum = lp.m_xrrsum;
179 m_yrrsum = lp.m_yrrsum;
180 m_rrrrsum = lp.m_rrrrsum;
181
182 m_wsum_temp = lp. m_wsum_temp;
183 m_xav = lp.m_xav;
184 m_yav = lp.m_yav;
185 m_xyavp = lp.m_xyavp;
186
187 m_rscale = lp. m_rscale;
188 m_xxavp = lp.m_xxavp;
189 m_yyavp = lp.m_yyavp;
190 m_xrravp = lp.m_xrravp;
191 m_yrravp = lp.m_yrravp;
192 m_rrrravp = lp.m_rrrravp;
193 m_sinrot = lp.m_sinrot;
194 m_cosrot = lp.m_cosrot;
195
196 m_nc = lp. m_nc;
197 m_chisq = lp.m_chisq;
198 return;
199}
200
201inline void Lpav::clear() {
202 m_wsum = m_xsum = m_ysum = m_xxsum = m_yysum = m_xysum
203 = m_xrrsum = m_yrrsum = m_rrrrsum = m_rscale = m_nc = 0;
204 m_chisq = -1;
205}
206}
207#endif /* KALFIT_LPAV_H_INCLUDED */
208
Double_t x[10]
XmlRpcServer s
friend std::ostream & operator<<(std::ostream &o, const Lpav &s)
friend Lpav operator+(const Lpav &, const Lpav &)
void add_point_frac(double x, double y, double w, double f)
void add_point(double x, double y, double w=1)
double delta_chisq(double x, double y, double w=1) const
int extrapolate(double, double &, double &) const
const Lpav & operator=(const Lpar &)