BOSS 7.0.5
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 <math.h>
17#include <assert.h>
18#include "MdcTrkRecon/mdcTwoInv.h"
19#include "MdcTrkRecon/MdcSeg.h"
20#include "MdcGeom/MdcSuperLayer.h"
21#include "MdcGeom/BesAngle.h"
22//#include "ErrLogger/ErrLog.h"
23using std::endl;
24
25//--------------------------------------------------------------------------
26bool
28//---------------------------------------------------------------------------
29 assert (i >= 0 && i < 2);
30 return (0 == i); //i.e., 0th parameter is an angle
31}
32//------------------------------------------------------------------
33void
35 double radius, const double *inErr) {
36//------------------------------------------------------------------
37
38 if (slope == 0.) slope = 0.00000001;
39 double slinv = 1./slope;
40 _par1 = slope / sqrt(1. + radius*radius * slope*slope); //curve
41 double temp = 1. - _par1*_par1 * radius*radius;
42 if (temp < 0.) temp = 0.;
43 double dphi0ds = -radius * _par1 * sqrt(temp) * slinv;
44 BesAngle phi0 = phi - asin(_par1 * radius);
45 _par0 = phi0.posRad();
46
47 // phi0:
48 _errmat[0] = inErr[2] * dphi0ds * dphi0ds + inErr[0] +
49 inErr[1] * 2. * dphi0ds;
50 if (_errmat[0] < 0.) _errmat[0] = 0.;
51 // curv:
52 _errmat[2] = inErr[2] * _par1*_par1 * temp*temp * slinv*slinv;
53 if (_errmat[2] < 0.) _errmat[2] = 0.;
54 // phi0|curv:
55 _errmat[1] = inErr[2] *_par1 * slinv * temp * dphi0ds +
56 inErr[1] *_par1 * slinv * temp;
57 int error = mdcTwoInv(_errmat, _inverr);
58 if (error) {
59 std::cout << " ErrMsg(warning) "
60 << "Failed to invert matrix -- MdcSegInfo::calcFromOrigin" << endl
61 << _errmat[0] << " " << _errmat[1] << " " << _errmat[2]<< endl;
62 }
63}
64
65//-------------------------------------------------------------------
66void
68//-------------------------------------------------------------------
69 double slope = parentSeg->slope();
70 double radius = parentSeg->superlayer()->rad0();
71 double phi = parentSeg->phi();
72 const double *inErr = parentSeg->errmat();
73
74 calcFromOrigin(phi, slope, radius, inErr);
75}
76
77//-------------------------------------------------------------------
78double
80//-------------------------------------------------------------------
81return sqrt(_errmat[0]);}
82
83//-------------------------------------------------------------------
84double
86//-------------------------------------------------------------------
87return sqrt(_errmat[2]);}
88
89
90
91
int mdcTwoInv(double matrix[3], double invmat[3])
void calcFromOrigin(const MdcSeg *parentSeg)
bool parIsAngle(int i) const
double sigPhi0() const
double sigCurv() const
const MdcSuperLayer * superlayer() const
void slope()
Definition: slope.cxx:12