BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesVectorErr.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: BesVectorErr.cxx,v 1.3 2010/03/25 09:55:57 zhangy Exp $
4//
5// Description:
6// Class BbrVectorErr
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author List:
12// Forest Rouse February 1996
13// Victoria Novotny August 1996
14//
15// Copyright Information:
16// Copyright (C) 1996 U.C. Davis
17//
18// History:
19// Migration for BESIII MDC
20//
21// 2002/01/19, Sasha Telnov: added operator * (scaling by a real number)
22//
23//------------------------------------------------------------------------
24// File BbrVectorErr.cc
25// Source file for class BbrVectorErr
26//
27// For advice, input, or any questions then please contact either
28// Bob Jacobsen <[email protected]> or
29// Forest Rouse <[email protected]>
30//
31// =====================================================================
32// Name Change description
33// Date
34// Version
35// =====================================================================
36
37//#include "BaBar/BaBar.h"
38#include <float.h>
39#include <iostream>
43using std::istream;
44using std::ostream;
45//#include "BesError.h"
46
47
48//void BesVectorErr::printOn(ostream& out) const
49//{
50// out << "Bes Vector and Covariance Matrix:" << endl;
51// BesVector::printOn(out);
52// out << endl;
53// out << _covMatrix;
54//}
55
57 // protect against 0's
58 double xv = x()==0 ? FLT_MIN : x();
59 double yv = y()==0 ? FLT_MIN : y();
60 double zv = z()==0 ? FLT_MIN : z();
61 DifNumber xDF(xv,X+1,3), yDF(yv,Y+1,3), zDF(zv,Z+1,3);
63 pars[Rho] = sqrt(xDF*xDF + yDF*yDF + zDF*zDF);
64 pars[Phi] = atan2(yDF,xDF);
65 pars[Theta] = acos(zDF/pars[Rho]);
66 return covMatrix().similarity(pars.jacobian());
67}
68
70 // protect against 0's
71 double xv = x()==0 ? FLT_MIN : x();
72 double yv = y()==0 ? FLT_MIN : y();
73 double zv = z()==0 ? FLT_MIN : z();
74 DifNumber xDF(xv,X+1,3), yDF(yv,Y+1,3), zDF(zv,Z+1,3);
76 pars[C_Rho] = sqrt(xDF*xDF + yDF*yDF);
77 pars[C_Phi] = atan2(yDF,xDF);
78 pars[C_Zeta] = zDF;
79 return covMatrix().similarity(pars.jacobian());
80}
81
82double BesVectorErr::determineChisq(const Hep3Vector& refVector) const
83{
84 HepVector temp(NUM_COORDINATES, 0);
85 temp[0] = refVector.x()-this->x();
86 temp[1] = refVector.y()-this->y();
87 temp[2] = refVector.z()-this->z();
88 return _covMatrix.determineChisq(temp);
89}
90
91
93 BesVectorErr ve(Hep3Vector(v.x()+w.x(),v.y()+w.y(),v.z()+w.z()),
94 (v.covMatrix()+w.covMatrix()));
95 return ve;
96}
97
99 BesVectorErr ve(Hep3Vector(v.x()-w.x(),v.y()-w.y(),v.z()-w.z()),
100 (v.covMatrix()+w.covMatrix()));
101 return ve;
102}
103
104// Added by Sasha Telnov
106 BesVectorErr ve(Hep3Vector(a*p.x(), a*p.y(), a*p.z()),
107 (p.covMatrix()*a*a));
108 return ve;
109}
110
112 BesVectorErr ve(Hep3Vector(a*p.x(), a*p.y(), a*p.z()),
113 (p.covMatrix()*a*a));
114 return ve;
115}
116
117
118ostream & operator<<(ostream & stream, const BesVectorErr & verr) {
119 stream << (const Hep3Vector&)verr
120 << ", " << verr.covMatrix();
121
122 return stream;
123}
124
125istream & operator>>(istream & stream, BesVectorErr & verr) {
126 BesError mat(verr.SIZE);
127 stream >> (Hep3Vector&)verr >> mat;
128 verr.setCovMatrix(mat);
129
130 return stream;
131}
132
istream & operator>>(istream &stream, BesVectorErr &verr)
BesVectorErr operator-(const BesVectorErr &v, const BesVectorErr &w)
BesVectorErr operator+(const BesVectorErr &v, const BesVectorErr &w)
BesVectorErr operator*(const BesVectorErr &p, double a)
ostream & operator<<(ostream &stream, const BesVectorErr &verr)
Double_t x[10]
**********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
BesError similarity(const HepRotation &rot) const
Definition: BesError.cxx:51
double determineChisq(const HepVector &diff) const
Definition: BesError.cxx:109
BesError covRZPMatrix() const
const BesError & covMatrix() const
Definition: BesVectorErr.h:121
void setCovMatrix(const BesError &v)
Definition: BesVectorErr.h:131
double determineChisq(const Hep3Vector &refVector) const
BesError covRTPMatrix() const
HepMatrix jacobian() const
Definition: DifArray.cxx:72
double y[1000]