BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
DifNumber.cxx File Reference
#include "MdcRecoUtil/DifNumber.h"
#include "MdcRecoUtil/DifIndepPar.h"

Go to the source code of this file.

Functions

double correlation (const DifNumber &a, const DifNumber &b)
 
double correlation (const DifNumber &a, const DifNumber &b, const HepSymMatrix &e)
 
DifNumber solveQuad (const DifNumber &a, const DifNumber &b, const DifNumber &c, int pref, Code &code)
 

Variables

const DifNumber zero (0.0)
 
const DifNumber one (1.0)
 

Function Documentation

◆ correlation() [1/2]

double correlation ( const DifNumber a,
const DifNumber b 
)

Definition at line 72 of file DifNumber.cxx.

73{
74 return (a.indepPar()==0||b.indepPar()==0||a.indepPar()!=b.indepPar())?0:a.correlation(b,a.indepPar()->covariance());
75}
double correlation(const DifNumber &b, const HepSymMatrix &e) const
Definition: DifNumber.cxx:53

Referenced by DifFourVector::errorMatrix(), and DifVector::errorMatrix().

◆ correlation() [2/2]

double correlation ( const DifNumber a,
const DifNumber b,
const HepSymMatrix &  e 
)

Definition at line 78 of file DifNumber.cxx.

79{ return a.correlation(b,e); }

◆ solveQuad()

DifNumber solveQuad ( const DifNumber a,
const DifNumber b,
const DifNumber c,
int  pref,
Code code 
)

Definition at line 90 of file DifNumber.cxx.

96{
97 DifNumber descr=b*b-4.0*a*c;
98 if(descr<0.0) { // solution not real
99 code.setFail(1341);
100 return DifNumber(0.0);
101 }
102 if(a.number()==0.0){
103 if(b.number()==0.0) {
104 code.setFail(1342);
105 return DifNumber(0.0);
106 }
107 code.setSuccess(40);
108 return -c/b+a*c/pow(b,3);
109 }
110 code.setSuccess(40);
111 descr=sqrt(descr);
112 DifNumber s=-b;
113
114 if(pref==+1) { // positive solution
115 s+=descr;
116 }else if(pref==-1){ // negative solution
117 s-=descr;
118 }else if(pref==0) { // smallest solution
119 if(s>0.0) {s-=descr;}else {s+=descr;}
120 }else { // illegal prefrence
121 code.setFail(1343);
122 return DifNumber(0.0);
123 }
124 s/=2.0*a;
125 return s;
126}
XmlRpcServer s
Definition: HelloServer.cpp:11

Variable Documentation

◆ one

const DifNumber one(1.0) ( 1.  0)
extern

◆ zero

const DifNumber zero(0.0) ( 0.  0)
extern