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