BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcSegInfoAxialO.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcSegInfoAxialO.cxx,v 1.2 2005/07/18 02:34:42 zhangy Exp $
4//
5// Description:
6//
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Authors:
12//
13//------------------------------------------------------------------------
14// #include "BaBar/BaBar.h"
15#include "MdcTrkRecon/MdcSegInfoAxialO.h"
16#include "MdcGeom/BesAngle.h"
17#include "MdcGeom/MdcSuperLayer.h"
18#include "MdcTrkRecon/MdcSeg.h"
19#include "MdcTrkRecon/mdcTwoInv.h"
20#include <assert.h>
21#include <math.h>
22// #include "ErrLogger/ErrLog.h"
23using std::endl;
24
25//--------------------------------------------------------------------------
26bool MdcSegInfoAxialO::parIsAngle( int i ) const {
27 //---------------------------------------------------------------------------
28 assert( i >= 0 && i < 2 );
29 return ( 0 == i ); // i.e., 0th parameter is an angle
30}
31//------------------------------------------------------------------
32void MdcSegInfoAxialO::calcFromOrigin( double phi, double slope, double radius,
33 const double* inErr ) {
34 //------------------------------------------------------------------
35
36 if ( slope == 0. ) slope = 0.00000001;
37 double slinv = 1. / slope;
38 _par1 = slope / sqrt( 1. + radius * radius * slope * slope ); // curve
39 double temp = 1. - _par1 * _par1 * radius * radius;
40 if ( temp < 0. ) temp = 0.;
41 double dphi0ds = -radius * _par1 * sqrt( temp ) * slinv;
42 BesAngle phi0 = phi - asin( _par1 * radius );
43 _par0 = phi0.posRad();
44
45 // phi0:
46 _errmat[0] = inErr[2] * dphi0ds * dphi0ds + inErr[0] + inErr[1] * 2. * dphi0ds;
47 if ( _errmat[0] < 0. ) _errmat[0] = 0.;
48 // curv:
49 _errmat[2] = inErr[2] * _par1 * _par1 * temp * temp * slinv * slinv;
50 if ( _errmat[2] < 0. ) _errmat[2] = 0.;
51 // phi0|curv:
52 _errmat[1] = inErr[2] * _par1 * slinv * temp * dphi0ds + inErr[1] * _par1 * slinv * temp;
53 int error = mdcTwoInv( _errmat, _inverr );
54 if ( error )
55 {
56 std::cout << " ErrMsg(warning) "
57 << "Failed to invert matrix -- MdcSegInfo::calcFromOrigin" << endl
58 << _errmat[0] << " " << _errmat[1] << " " << _errmat[2] << endl;
59 }
60}
61
62//-------------------------------------------------------------------
63void MdcSegInfoAxialO::calcFromOrigin( const MdcSeg* parentSeg ) {
64 //-------------------------------------------------------------------
65 double slope = parentSeg->slope();
66 double radius = parentSeg->superlayer()->rad0();
67 double phi = parentSeg->phi();
68 const double* inErr = parentSeg->errmat();
69
70 calcFromOrigin( phi, slope, radius, inErr );
71}
72
73//-------------------------------------------------------------------
75 //-------------------------------------------------------------------
76 return sqrt( _errmat[0] );
77}
78
79//-------------------------------------------------------------------
81 //-------------------------------------------------------------------
82 return sqrt( _errmat[2] );
83}
int mdcTwoInv(double matrix[3], double invmat[3])
void calcFromOrigin(const MdcSeg *parentSeg)
bool parIsAngle(int i) const
double sigPhi0() const
double sigCurv() const