CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
KalFitAlg/KalFitAlg-00-15-08/src/lpav/Lpav.cxx
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// Implimentation:
9// <Notes on implimentation>
10//
11// Author: KATAYAMA Nobuhiko
12// Created: Fri Feb 6 10:21:46 JST 1998
13
14// system include files
15
16#include <cmath>
17#include <iostream>
18
19// user include files
20#include "KalFitAlg/lpav/Lpav.h"
21using CLHEP::HepVector;
22using CLHEP::Hep3Vector;
23using CLHEP::HepMatrix;
24using CLHEP::HepSymMatrix;
25//
26// constants, enums and typedefs
27//
28
29extern "C" {
30 float prob_ (float *, int*);
31}
32
33
34static double err_dis_inv(double x, double y, double w, double a, double b) {
35 if (a==0 && b==0) {
36 return w;
37 } else {
38 double f = x * b - y * a;
39 double rsq = x*x+y*y;
40 f *= f;
41 return w*rsq/f;
42 }
43}
44
45//
46// static data member definitions
47//
48
49//
50// constructors and destructor
51//
53{
54 clear();
55}
56
57// Lpav::Lpav( const Lpav& )
58// {
59// }
60
62{
63}
64
65//
66// assignment operators
67//
68// const Lpav& Lpav::operator=( const Lpav& )
69// {
70// }
71
72//
73// comparison operators
74//
75// bool Lpav::operator==( const Lpav& ) const
76// {
77// }
78
79// bool Lpav::operator!=( const Lpav& ) const
80// {
81// }
82
83//
84// member functions
85//
86void Lpav::calculate_average(double xi, double yi, double wi) {
87 if(m_wsum<=0) return;
88 m_wsum_temp = m_wsum + wi;
89 double rri(xi * xi + yi * yi);
90 double wrri(wi * rri);
91 double wsum_inv(1/m_wsum_temp);
92 m_xav = (m_xsum + wi * xi) * wsum_inv;
93 m_yav = (m_ysum + wi * yi) * wsum_inv;
94
95 double xxav((m_xxsum + wi * xi * xi) * wsum_inv);
96 double yyav((m_yysum + wi * yi * yi) * wsum_inv);
97 double xyav((m_xysum + wi * xi * yi) * wsum_inv);
98 double xrrav((m_xrrsum + xi * wrri) * wsum_inv);
99 double yrrav((m_yrrsum + yi * wrri) * wsum_inv);
100 double rrrrav((m_rrrrsum + wrri * rri) * wsum_inv);
101
102 calculate_average_n(xxav, yyav, xyav, xrrav, yrrav, rrrrav);
103
104}
105
107 if(m_wsum<=0) return;
108 m_wsum_temp = m_wsum;
109 double wsum_inv(1/m_wsum_temp);
110 m_xav = m_xsum * wsum_inv;
111 m_yav = m_ysum * wsum_inv;
112
113 double xxav(m_xxsum * wsum_inv);
114 double yyav(m_yysum * wsum_inv);
115 double xyav(m_xysum * wsum_inv);
116 double xrrav(m_xrrsum * wsum_inv);
117 double yrrav(m_yrrsum * wsum_inv);
118 double rrrrav(m_rrrrsum * wsum_inv);
119
120 calculate_average_n(xxav, yyav, xyav, xrrav, yrrav, rrrrav);
121}
122
123void Lpav::calculate_average_n(double xxav, double yyav, double xyav,
124 double xrrav, double yrrav, double rrrrav) {
125 double xxav_p = xxav - m_xav * m_xav;
126 double yyav_p = yyav - m_yav * m_yav;
127 double xyav_p = xyav - m_xav * m_yav;
128 double rrav_p = xxav_p + yyav_p;
129
130 double a = std::fabs(xxav_p - yyav_p);
131 double b = 4 * xyav_p * xyav_p;
132 double asqpb = a * a + b;
133 double rasqpb = std::sqrt(asqpb);
134 double splus = 1 + a / rasqpb;
135 double sminus = b / (asqpb*splus);
136 splus = std::sqrt(0.5*splus);
137 sminus = std::sqrt(0.5*sminus);
138//C
139//C== First require : SIGN(C**2 - S**2) = SIGN(XXAV - YYAV)
140//C
141 if ( xxav_p <= yyav_p ) {
142 m_cosrot = sminus;
143 m_sinrot = splus;
144 } else {
145 m_cosrot = splus;
146 m_sinrot = sminus;
147 }
148//C
149//C== Require : SIGN(S) = SIGN(XYAV)*SIGN(C) (Assuming SIGN(C) > 0)
150//C
151 if (xyav_p < 0) m_sinrot = - m_sinrot;
152//*
153//* We now have the smallest angle that guarantees <X**2> > <Y**2>
154//*
155//* To get the SIGN of the charge right, the new X-AXIS must point
156//* outward from the orgin. We are free to change signs of both
157//* COSROT and SINROT simultaneously to accomplish this.
158//*
159//* Choose SIGN of C wisely to be able to get the sign of the charge
160//*
161 if ( m_cosrot*m_xav + m_sinrot*m_yav <= 0 ) {
162 m_cosrot = - m_cosrot;
163 m_sinrot = - m_sinrot;
164 }
165 m_rscale = std::sqrt(rrav_p);
166 double cos2 = m_cosrot * m_cosrot;
167 double sin2 = m_sinrot * m_sinrot;
168 double cs2 = 2 * m_sinrot * m_cosrot;
169 double rrav_p_inv(1/rrav_p);
170 m_xxavp = (cos2 * xxav_p + cs2 * xyav_p + sin2 * yyav_p) * rrav_p_inv;
171 m_yyavp = (cos2 * yyav_p - cs2 * xyav_p + sin2 * xxav_p) * rrav_p_inv;
172
173 double xav2 = m_xav * m_xav;
174 double yav2 = m_yav * m_yav;
175 double xrrav_p = (xrrav - 2 * xxav * m_xav + xav2 * m_xav -
176 2 * xyav * m_yav + m_xav * yav2) - m_xav * rrav_p;
177 double yrrav_p = (yrrav - 2 * yyav * m_yav + yav2 * m_yav -
178 2 * xyav * m_xav + m_yav * xav2) - m_yav * rrav_p;
179 m_xrravp = ( m_cosrot * xrrav_p + m_sinrot * yrrav_p) * rrav_p_inv/m_rscale;
180 m_yrravp = (- m_sinrot * xrrav_p + m_cosrot * yrrav_p) * rrav_p_inv/m_rscale;
181
182 double rrav = xxav + yyav;
183 double rrrrav_p = rrrrav
184 - 2 * m_yav * yrrav - 2 * m_xav * xrrav
185 + rrav * (xav2 + yav2)
186 - 2 * m_xav * xrrav_p - xav2 * rrav_p
187 - 2 * m_yav * yrrav_p - yav2 * rrav_p;
188 m_rrrravp = rrrrav_p * rrav_p_inv * rrav_p_inv;
189 m_xyavp = 0;
190}
191
192void Lpav::calculate_average3(double xi, double yi, double wi) {
193 if(m_wsum<=0) return;
194 m_wsum_temp = m_wsum + wi;
195 double wsum_inv(1/m_wsum_temp);
196 double rri(xi * xi + yi * yi);
197 m_xav = (m_xsum + wi * xi) * wsum_inv;
198 m_yav = (m_ysum + wi * yi) * wsum_inv;
199
200 m_rscale = 1;
201 m_cosrot = 1;
202 m_sinrot = 0;
203 m_xxavp = (m_xxsum + wi * xi * xi) * wsum_inv;
204 m_xyavp = (m_xysum + wi * xi * yi) * wsum_inv;
205 m_yyavp = (m_yysum + wi * yi * yi) * wsum_inv;
206 double wrri(wi * rri);
207 m_xrravp = (m_xrrsum + xi * wrri) * wsum_inv;
208 m_yrravp = (m_yrrsum + yi * wrri) * wsum_inv;
209 m_rrrravp = (m_rrrrsum + rri * wrri) * wsum_inv;
210}
211
213 if(m_wsum<=0) return;
214 m_wsum_temp = m_wsum;
215 double wsum_inv(1/m_wsum_temp);
216 m_xav = m_xsum * wsum_inv;
217 m_yav = m_ysum * wsum_inv;
218
219 m_rscale = 1;
220 m_cosrot = 1;
221 m_sinrot = 0;
222 m_xxavp = m_xxsum * wsum_inv;
223 m_xyavp = m_xysum * wsum_inv;
224 m_yyavp = m_yysum * wsum_inv;
225 m_xrravp = m_xrrsum * wsum_inv;
226 m_yrravp = m_yrrsum * wsum_inv;
227 m_rrrravp = m_rrrrsum * wsum_inv;
228}
229
230
231//
232// const member functions
233//
234
235//
236// static member functions
237//
238
239
240std::ostream &operator<<(std::ostream &o, const Lpav &a) {
241// o << "wsum=" << a.m_wsum << " xsum=" << a.m_xsum << " ysum=" << a.m_ysum
242// << " xxsum=" << a.m_xxsum << " xysum=" << a.m_xysum
243// << " yysum=" << a.m_yysum
244// << " xrrsum=" << a.m_xrrsum << " yrrsum=" << a.m_yrrsum
245// << " rrrrsum=" << a.m_rrrrsum;
246// o << " rscale=" << a.m_rscale
247// << " xxavp=" << a.m_xxavp << " yyavp=" << a.m_yyavp
248// << " xrravp=" << a.m_xrravp << " yrravp=" << a.m_yrravp
249// << " rrrravp=" << a.m_rrrravp << " cosrot=" << a.m_cosrot
250// << " sinrot=" << a.m_sinrot
251// << endl;
252 o << " nc=" << a.m_nc << " chisq=" << a.m_chisq << " " << (Lpar&) a;
253 return o;
254}
255
256double Lpav::solve_lambda(void) {
257 if (m_rscale<=0) return -1;
258 double xrrxrr = m_xrravp * m_xrravp;
259 double yrryrr = m_yrravp * m_yrravp;
260 double rrrrm1 = m_rrrravp - 1;
261 double xxyy = m_xxavp * m_yyavp;
262
263 double c0 = rrrrm1 * xxyy - xrrxrr * m_yyavp - yrryrr * m_xxavp;
264 double c1 = - rrrrm1 + xrrxrr + yrryrr - 4 * xxyy;
265 double c2 = 4 + rrrrm1 - 4 * xxyy;
266 double c4 = - 4;
267//
268//C COEFFICIENTS OF THE DERIVATIVE - USED IN NEWTON-RAPHSON ITERATIONS
269//
270 double c2d = 2 * c2;
271 double c4d = 4 * c4;
272//
273 double lambda = 0;
274
275 double chiscl = m_wsum_temp * m_rscale * m_rscale;
276 double dlamax = 0.001 / chiscl;
277 const int ntry = 5;
278 int itry = 0;
279 double dlambda = dlamax;
280 while ( itry<ntry && std::fabs(dlambda) >= dlamax) {
281 double cpoly = c0 + lambda * ( c1 + lambda *
282 ( c2 + lambda * lambda * c4));
283 double dcpoly = c1 + lambda * ( c2d + lambda * lambda * c4d);
284 dlambda = - cpoly / dcpoly;
285 lambda += dlambda;
286 itry ++;
287 }
288 lambda = lambda<0 ? 0 : lambda;
289 return lambda;
290}
291
292double Lpav::solve_lambda3(void) {
293 if (m_rscale<=0) return -1;
294 double xrrxrr = m_xrravp * m_xrravp;
295 double yrryrr = m_yrravp * m_yrravp;
296 double rrrrm1 = m_rrrravp - 1;
297 double xxyy = m_xxavp * m_yyavp;
298
299 double a = m_rrrravp;
300 double b = xrrxrr + yrryrr - m_rrrravp * (m_xxavp + m_yyavp);
301 double c = m_rrrravp * m_xxavp * m_yyavp
302 - m_yyavp * xrrxrr - m_xxavp * yrryrr
303 + 2 * m_xyavp * m_xrravp * m_yrravp - m_rrrravp * m_xyavp * m_xyavp;
304 if (c>=0 && b<=0) {
305 return (-b-std::sqrt(b*b-4*a*c))/2/a;
306 } else if (c>=0 && b>0) {
307 std::cerr << " returning " <<-1<<std::endl;
308 return -1;
309 } else if (c<0) {
310 return (-b+std::sqrt(b*b-4*a*c))/2/a;
311 }
312 return -1;
313}
314
316 double lambda = solve_lambda();
317// changed on Oct-13-93
318// if (lambda<=0) return -1;
319 if (lambda<0) return -1;
320 double h11 = m_xxavp - lambda;
321 double h22 = m_yyavp - lambda;
322 if (h11==0.0) return -1;
323 double h14 = m_xrravp;
324 double h24 = m_yrravp;
325 double h34 = 1 + 2 * lambda;
326 double rootsq = (h14*h14/h11/h11) + 4 * h34;
327 if ( std::fabs(h22) > std::fabs(h24) ) {
328 if(h22==0.0) return -1;
329 double ratio = h24/h22;
330 rootsq += ratio * ratio ;
331 m_kappa = 1/std::sqrt(rootsq);
332 m_beta = - ratio * m_kappa;
333 } else {
334 if(h24==0.0) return -1;
335 double ratio = h22 / h24;
336 rootsq = 1 + ratio * ratio * rootsq;
337 m_beta = 1 / std::sqrt(rootsq);
338 m_beta = h24>0 ? -m_beta : m_beta;
339 m_kappa = -ratio * m_beta;
340 }
341 m_alpha = - (h14/h11)*m_kappa;
342 m_gamma = - h34 * m_kappa;
343// if (lambda<0.0001) {
344// cout << " lambda=" << lambda << " h34=" << h34
345// << " rootsq=" << rootsq << " h22=" << h22
346// << " h11=" << h11 << " h14=" << h14 << " h24=" << h24 <<
347// " " << *this << endl;
348// }
349//
350//C TRANSFORM THESE INTO THE LAB COORDINATE SYSTEM
351//
352//C FIRST GET KAPPA AND GAMMA BACK TO REAL DIMENSIONS
353//
354 scale(m_rscale);
355//
356//C NEXT ROTATE ALPHA AND BETA
357//
358 rotate(m_cosrot, -m_sinrot);
359//
360//C THEN TRANSLATE BY (XAV,YAV)
361//
362 move(-m_xav, -m_yav);
363 if (m_yrravp < 0) neg();
364 if (lambda>=0) m_chisq = lambda * m_wsum_temp * m_rscale * m_rscale;
365 return lambda;
366}
367
369 double lambda = solve_lambda3();
370// changed on Oct-13-93
371// if (lambda<=0) return -1;
372 if (lambda<0) return -1;
373 double h11 = m_xxavp - lambda;
374 double h22 = m_yyavp - lambda;
375 double h14 = m_xrravp;
376 double h24 = m_yrravp;
377 m_gamma = 0;
378 double h12 = m_xyavp;
379 double det = h11*h22-h12*h12;
380 if (det!=0) {
381 double r1 = (h14*h22-h24*h12)/(det);
382 double r2 = (h24*h11-h14*h12)/(det);
383 double kinvsq = r1*r1 + r2*r2;
384 m_kappa = std::sqrt(1/kinvsq);
385 if(h11!=0) m_alpha = -m_kappa * r1;
386 else m_alpha = 1;
387 if(h22!=0) m_beta = -m_kappa * r2;
388 else m_beta = 1;
389 } else {
390 m_kappa = 0;
391 if (h11!=0 && h22!=0) {
392 m_beta = 1/std::sqrt(1+h12*h12/h11/h11);
393 m_alpha = std::sqrt(1-m_beta*m_beta);
394 } else if (h11!=0) {
395 m_beta = 1;
396 m_alpha = 0;
397 } else {
398 m_beta = 0;
399 m_alpha = 1;
400 }
401 }
402 if((m_alpha*m_xav + m_beta*m_yav) *
403 (m_beta*m_xav - m_alpha*m_yav)<0) neg();
404// if (std::fabs(m_alpha)<0.01 && std::fabs(m_beta)<0.01) {
405// cout << " lambda=" << lambda << " " << *this << endl;
406// }
407 if (lambda>=0) m_chisq = lambda * m_wsum_temp * m_rscale * m_rscale;
408 return lambda;
409}
410
411double Lpav::fit(double x, double y, double w) {
412 if (m_nc<=3) return -1;
413 m_chisq = -1;
414 double q;
415 if (m_nc<4) {
417 double q = calculate_lpar3();
418 if (q>0) m_chisq = q * m_wsum_temp * m_rscale * m_rscale;
419 } else {
420 calculate_average(x,y,w);
421 q = calculate_lpar();
422 if (q>0) m_chisq = q * m_wsum_temp * m_rscale * m_rscale;
423 }
424 return m_chisq;
425}
426
427double Lpav::fit(void) {
428 if (m_nc<=3) return -1;
429 m_chisq = -1;
430 double q;
431 if (m_nc<4) {
433 q = calculate_lpar3();
434 if (q>0) m_chisq = q * m_wsum_temp * m_rscale * m_rscale;
435 } else {
437 q = calculate_lpar();
438 if (q>0) m_chisq = q * m_wsum_temp * m_rscale * m_rscale;
439 }
440 return m_chisq;
441}
442
443HepSymMatrix Lpav::cov(int inv) const
444#ifdef BELLE_OPTIMIZED_RETURN
445return vret(4);
446{
447#else
448{
449 HepSymMatrix vret(4);
450#endif
451 vret(1,1) = m_xxsum;
452 vret(2,1) = m_xysum;
453 vret(2,2) = m_yysum;
454 vret(3,1) = m_xsum;
455 vret(3,2) = m_ysum;
456 vret(3,3) = m_wsum;
457 vret(4,1) = m_xrrsum;
458 vret(4,2) = m_yrrsum;
459 vret(4,3) = m_xxsum + m_yysum;
460 vret(4,4) = m_rrrrsum;
461 if(inv==0) {
462// int i=vret.Inv();
463 int i;
464 vret.invert(i);
465 if (i!=0) {
466 std::cerr << "Lpav::cov:could not invert nc=" << m_nc << vret;
467#ifdef HAVE_EXCEPTION
468 THROW(Lpav::cov,Singular);
469#endif
470 }
471 }
472 return vret;
473}
474
475HepSymMatrix Lpav::cov_c(int inv) const
476#ifdef BELLE_OPTIMIZED_RETURN
477return vret(3);
478{
479#else
480{
481 HepSymMatrix vret(3);
482#endif
483#ifdef HAVE_EXCEPTION
484 try {
485#endif
486 vret = cov(1).similarity(dldc());
487#ifdef HAVE_EXCEPTION
488 }
489 catch (Lpav::Singular) {
490 THROW(Lpav::cov_c1,Singular_c);
491 }
492#endif
493 if(inv==0) {
494// int i = vret.Inv();
495 int i;
496 vret.invert(i);
497 if (i!=0) {
498 std::cerr << "Lpav::cov_c:could not invert " << vret;
499#ifdef HAVE_EXCEPTION
500 THROW(Lpav::cov_c2,Singular_c);
501#endif
502 }
503 }
504 return vret;
505}
506
507int Lpav::extrapolate(double r, double&phi, double &dphi) const {
508 double x, y;
509 if (m_chisq<0) return -1;
510 if (xy(r, x, y)!=0) return -1;
511 phi = std::atan2(y,x);
512 if (phi<0) phi += (2*M_PI);
513 HepVector v(4);
514 v(1) = x;
515 v(2) = y;
516 v(3) = 1;
517 v(4) = r * r;
518// HepSymMatrix l = cov().similarityT(v);
519#ifdef HAVE_EXCEPTION
520 try {
521#endif
522// HepSymMatrix l = cov().similarity(v.T());
523// // cout << "delta d^2=" << l(1,1);
524// if (l(1,1)>0) {
525 double l = cov().similarity(v);
526 if(l>0) {
527 double ls = std::sqrt(l);
528 dphi = ls / r;
529 // cout << " delta d=" << ls << " dphi=" << dphi;
530 }
531#ifdef HAVE_EXCEPTION
532 }
533 catch (Lpav::Singular) {
534 return -1;
535 }
536#endif
537// cout << endl;
538 return 0;
539}
540
541double Lpav::similarity(double x, double y) const {
542 if (m_nc<=3) return -1;
543 HepVector v(4);
544 v(1) = x;
545 v(2) = y;
546 v(3) = 1;
547 v(4) = x * x + y * y;
548 double l;
549#ifdef HAVE_EXCEPTION
550 try {
551#endif
552 l = cov().similarity(v);
553#ifdef HAVE_EXCEPTION
554 }
555 catch (Lpav::Singular) {
556 return -1;
557 }
558#endif
559 return l;
560}
561
562void Lpav::add(double xi, double yi, double w, double a, double b) {
563 register double wi = err_dis_inv(xi, yi, w, a, b);
564 add(xi, yi, wi);
565}
566
567void Lpav::add_point(register double xi, register double yi,
568 register double wi) {
569 m_wsum += wi;
570 m_xsum += wi * xi;
571 m_ysum += wi * yi;
572 m_xxsum += wi * xi * xi;
573 m_yysum += wi * yi * yi;
574 m_xysum += wi * xi * yi;
575 register double rri = ( xi * xi + yi * yi );
576 register double wrri = wi * rri;
577 m_xrrsum += wrri * xi;
578 m_yrrsum += wrri * yi;
579 m_rrrrsum += wrri * rri;
580 m_nc += 1;
581}
582
583void Lpav::add_point_frac(double xi, double yi, double w, double a) {
584 register double wi = w * a;
585 m_wsum += wi;
586 m_xsum += wi * xi;
587 m_ysum += wi * yi;
588 m_xxsum += wi * xi * xi;
589 m_yysum += wi * yi * yi;
590 m_xysum += wi * xi * yi;
591 register double rri = ( xi * xi + yi * yi );
592 register double wrri = wi * rri;
593 m_xrrsum += wrri * xi;
594 m_yrrsum += wrri * yi;
595 m_rrrrsum += wrri * rri;
596 m_nc += a;
597}
598
599void Lpav::sub(double xi, double yi, double w, double a, double b) {
600 register double wi = err_dis_inv(xi, yi, w, a, b);
601 m_wsum -= wi;
602 m_xsum -= wi * xi;
603 m_ysum -= wi * yi;
604 m_xxsum -= wi * xi * xi;
605 m_yysum -= wi * yi * yi;
606 m_xysum -= wi * xi * yi;
607 register double rri = ( xi * xi + yi * yi );
608 register double wrri = wi * rri;
609 m_xrrsum -= wrri * xi;
610 m_yrrsum -= wrri * yi;
611 m_rrrrsum -= wrri * rri;
612 m_nc -= 1;
613}
614
615const Lpav & Lpav::operator+=(const Lpav &la1) {
616 m_wsum += la1.m_wsum;
617 m_xsum += la1.m_xsum;
618 m_ysum += la1.m_ysum;
619 m_xxsum += la1.m_xxsum;
620 m_yysum += la1.m_yysum;
621 m_xysum += la1.m_xysum;
622 m_xrrsum += la1.m_xrrsum;
623 m_yrrsum += la1.m_yrrsum;
624 m_rrrrsum += la1.m_rrrrsum;
625 m_nc += la1.m_nc;
626 return *this;
627}
628
629Lpav operator+(const Lpav &la1, const Lpav &la2)
630#ifdef BELLE_OPTIMIZED_RETURN
631return la;
632{
633#else
634{
635 Lpav la;
636#endif
637 la.m_wsum = la1.m_wsum + la2.m_wsum;
638 la.m_xsum = la1.m_xsum + la2.m_xsum;
639 la.m_ysum = la1.m_ysum + la2.m_ysum;
640 la.m_xxsum = la1.m_xxsum + la2.m_xxsum;
641 la.m_yysum = la1.m_yysum + la2.m_yysum;
642 la.m_xysum = la1.m_xysum + la2.m_xysum;
643 la.m_xrrsum = la1.m_xrrsum + la2.m_xrrsum;
644 la.m_yrrsum = la1.m_yrrsum + la2.m_yrrsum;
645 la.m_rrrrsum = la1.m_rrrrsum + la2.m_rrrrsum;
646 la.m_nc = la1.m_nc + la2.m_nc;
647 return la;
648}
649
650double Lpav::prob() const {
651 if (m_nc<=3) return 0;
652 if (m_chisq<0) return 0;
653 float c = m_chisq;
654 int nci = (int)m_nc - 3;
655 double p = (double) prob_(&c, &nci);
656 return p;
657}
658
659double Lpav::chi_deg() const {
660 if (m_nc<=3) return -1;
661 else return m_chisq/(m_nc-3);
662}
663
664double Lpav::delta_chisq(double x, double y, double w) const {
665 double sim = similarity(x,y);
666 if(sim<0) return -1;
667 double d = d0(x,y);
668 double delta = std::sqrt(d) * w / (1 + sim * w);
669 return delta;
670}
671
Double_t x[10]
float prob_(float *, int *)
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
Definition: KKsem.h:33
std::ostream & operator<<(std::ostream &o, const Lpav &a)
Lpav operator+(const Lpav &la1, const Lpav &la2)
float prob_(float *, int *)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
#define M_PI
Definition: TConstant.h:4
double d(double x, double y) const
double phi(double r, int dir=0) const
void add_point(double x, double y, double w=1)
HepSymMatrix cov_c(int=0) const
void add_point_frac(double x, double y, double w, double f)
double delta_chisq(double x, double y, double w=1) const
int extrapolate(double, double &, double &) const
const Lpav & operator+=(const Lpav &)
double similarity(double, double) const
HepSymMatrix cov(int=0) const
TCanvas * c1
Definition: tau_mode.c:75