BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesPointErr.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: BesPointErr.cxx,v 1.2 2009/12/23 02:59:56 zhangy Exp $
4//
5// Description:
6// Class BbrPointErr
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//------------------------------------------------------------------------
22// File BbrPointErr.cc
23// Source file for class BbrPointErr
24//
25// For advice, input, or any questions then please contact either
26// Bob Jacobsen <Bob_Jacobsen@lbl.gov> or
27// Forest Rouse <rouse@ucdhep.ucdavis.edu>
28//
29// =====================================================================
30// Name Change description
31// Date
32// Version
33// =====================================================================
34// #include "BaBar/BaBar.h"
35
36#include "MdcRecoUtil/BesPointErr.h"
37#include "MdcRecoUtil/DifArray.h"
38#include "MdcRecoUtil/DifNumber.h"
39#include <float.h>
40#include <stdio.h>
41using std::istream;
42using std::ostream;
43
45 BesPointErr pe( HepPoint3D( v.x() + w.x(), v.y() + w.y(), v.z() + w.z() ),
46 ( v.covMatrix() + w.covMatrix() ) );
47 return pe;
48}
49
51 BesPointErr pe( HepPoint3D( v.x() + w.x(), v.y() + w.y(), v.z() + w.z() ),
52 ( v.covMatrix() + w.covMatrix() ) );
53 return pe;
54}
55
57 BesPointErr pe( HepPoint3D( v.x() - w.x(), v.y() - w.y(), v.z() - w.z() ),
58 ( v.covMatrix() + w.covMatrix() ) );
59 return pe;
60}
61
63 BesVectorErr ve( Hep3Vector( v.x() - w.x(), v.y() - w.y(), v.z() - w.z() ),
64 ( v.covMatrix() + w.covMatrix() ) );
65 return ve;
66}
67
68ostream& operator<<( ostream& stream, const BesPointErr& verr ) {
69 stream << (const HepPoint3D&)verr << ", " << verr.covMatrix();
70
71 return stream;
72}
73
74istream& operator>>( istream& stream, BesPointErr& verr ) {
75 BesError mat( verr.SIZE );
76 stream >> (HepPoint3D&)verr >> mat;
77 verr.setCovMatrix( mat );
78
79 return stream;
80}
81
83 // protect against 0's
84 double xv = x() == 0 ? FLT_MIN : x();
85 double yv = y() == 0 ? FLT_MIN : y();
86 double zv = z() == 0 ? FLT_MIN : z();
87 DifNumber xDF( xv, X + 1, 3 ), yDF( yv, Y + 1, 3 ), zDF( zv, Z + 1, 3 );
88 DifArray pars( 3, NUM_PCOORDINATES );
89 pars[Rho] = sqrt( xDF * xDF + yDF * yDF + zDF * zDF );
90 pars[Phi] = atan2( yDF, xDF );
91 pars[Theta] = acos( zDF / pars[Rho] );
92 return covMatrix().similarity( pars.jacobian() );
93}
94
96 // protect against 0's
97 double xv = x() == 0 ? FLT_MIN : x();
98 double yv = y() == 0 ? FLT_MIN : y();
99 double zv = z() == 0 ? FLT_MIN : z();
100 DifNumber xDF( xv, X + 1, 3 ), yDF( yv, Y + 1, 3 ), zDF( zv, Z + 1, 3 );
101 DifArray pars( 3, NUM_CCOORDINATES );
102 pars[C_Rho] = sqrt( xDF * xDF + yDF * yDF );
103 pars[C_Phi] = atan2( yDF, xDF );
104 pars[C_Zeta] = zDF;
105 return covMatrix().similarity( pars.jacobian() );
106}
ostream & operator<<(ostream &stream, const BesPointErr &verr)
BesPointErr operator+(const BesPointErr &v, const BesVectorErr &w)
BesPointErr operator-(const BesPointErr &v, const BesVectorErr &w)
istream & operator>>(istream &stream, BesPointErr &verr)
HepGeom::Point3D< double > HepPoint3D
Double_t x[10]
double w
**********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:49
BesError covRTPMatrix() const
BesError covRZPMatrix() const
HepMatrix jacobian() const
Definition DifArray.cxx:70