BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DifVector.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: DifVector.cxx,v 1.2 2009/12/23 02:59:56 zhangy Exp $
4//
5// Description:
6// Class Implementation for |DifVector|
7// What do i do ?
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author List:
12// A. Snyder
13//
14// Copyright Information:
15// Copyright (C) 1996 SLAC
16//
17// History:
18// Migration for BESIII MDC
19//
20//------------------------------------------------------------------------
21
22#include "MdcRecoUtil/DifVector.h"
23#include "CLHEP/Vector/ThreeVector.h"
24#include "MdcRecoUtil/DifRotation.h"
25using std::cout;
26
27extern const DifVector xhat( 1, 0, 0 );
28extern const DifVector yhat( 0, 1, 0 );
29extern const DifVector zhat( 0, 0, 1 );
30extern const DifVector nullVec( 0, 0, 0 );
31
32DifVector::DifVector() : x( 0.0 ), y( 0.0 ), z( 0.0 ) {}
33
34DifVector::DifVector( const DifNumber& X, const DifNumber& Y, const DifNumber& Z )
35 : x( X ), y( Y ), z( Z ) {}
36
37DifVector::DifVector( double X, double Y, double Z ) : x( X ), y( Y ), z( Z ) {}
38
39DifVector::DifVector( const Hep3Vector& v ) : x( v.x() ), y( v.y() ), z( v.z() ) {}
40
41DifVector::DifVector( const DifVector& v ) : x( v.x ), y( v.y ), z( v.z ) {}
42
43HepSymMatrix DifVector::errorMatrix( const HepSymMatrix& e ) const {
44 HepSymMatrix temp( 3 );
45 temp( 1, 1 ) = correlation( x, x, e );
46 temp( 1, 2 ) = correlation( x, y, e );
47 temp( 1, 3 ) = correlation( x, z, e );
48 temp( 2, 2 ) = correlation( y, y, e );
49 temp( 2, 3 ) = correlation( y, z, e );
50 temp( 3, 3 ) = correlation( z, z, e );
51 return temp;
52}
53
54HepMatrix DifVector::jacobian() const {
55 int npar = x.nPar();
56 HepMatrix temp( 3, npar );
57 for ( int i = 1; i <= npar; i++ )
58 {
59 temp( 1, i ) = x.derivative( i );
60 temp( 2, i ) = y.derivative( i );
61 temp( 3, i ) = z.derivative( i );
62 } // (int i=1; i<=npar; i++)
63 return temp;
64}
65
67 r.rotate( *this );
68 return *this;
69}
70
71DifVector& DifVector::rotate( const DifNumber& a, const DifNumber& b, const DifNumber& g ) {
72 DifRotation( a, b, g ).rotate( *this );
73 return *this;
74}
75
76void DifVector::print() const {
77 /*SKIP
78 cout << "x:" << x;
79 cout << "y:" << y;
80 cout << "z:" << z;
81 */
82 // yzhang TEMP
83 cout << "Yzhang::DifVector::print x,y,z SKIPED!\n";
84}
double correlation(const DifNumber &a, const DifNumber &b)
Definition DifNumber.cxx:69
const DifVector nullVec(0, 0, 0)
const DifVector xhat(1, 0, 0)
const DifVector yhat(0, 1, 0)
const DifVector zhat(0, 0, 1)
**********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
void rotate(DifVector &v) const
DifNumber r() const
DifVector & rotate(const DifVector &axis, const DifNumber &angle)
HepSymMatrix errorMatrix(const HepSymMatrix &e) const
Definition DifVector.cxx:43
HepMatrix jacobian() const
Definition DifVector.cxx:54
void print() const
Definition DifVector.cxx:76