/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/src/MdcSegInfoCsmc.cxx

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: MdcSegInfoCsmc.cxx,v 1.3 2009/12/16 09:02:47 zhangy Exp $
00004 //
00005 // Description:
00006 //
00007 // Environment:
00008 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00009 //
00010 // Authors:
00011 //
00012 // Copyright (C)  1996  The Board of Trustees of  
00013 // 
00014 // History:
00015 //      Migration for BESIII MDC
00016 // The Leland Stanford Junior University.  All Rights Reserved.
00017 //------------------------------------------------------------------------
00018 //#include "BaBar/BaBar.h"
00019 #include "MdcTrkRecon/MdcSegInfoCsmc.h"
00020 #include <math.h>
00021 #include <assert.h>
00022 #include "MdcTrkRecon/mdcTwoInv.h"
00023 #include "MdcGeom/MdcSuperLayer.h"
00024 #include "MdcTrkRecon/MdcSeg.h"
00025 #include "MdcGeom/BesAngle.h"
00026 //#include "ErrLogger/ErrLog.h"
00027 using std::endl;
00028 
00029 //--------------------------------------------------------------------------
00030 bool 
00031 MdcSegInfoCsmc::parIsAngle(int i) const {
00032 //---------------------------------------------------------------------------
00033   assert (i >= 0 && i < 2);
00034   return (0 != i);   //i.e., parameter 1 is an angle
00035 }
00036 //------------------------------------------------------------------
00037 void 
00038 MdcSegInfoCsmc::calcStraight(double phi, double slope, 
00039                                   double rad, const double *inErr) {
00040 //------------------------------------------------------------------
00041   // Load the segment info obj with phi0 and d0 values, calc. assuming 
00042   // the segments lie on straight tracks.
00043   //     
00044   // d0 defined to be positive for tracks that intercept x axis on positive 
00045   //   phi (neg x) side of origin.  At least that's what I claim. */
00046   
00047   // error matrix conversion: 
00048   //   Vij(f) = SUM(n,m) ( d(fi)/d(yn) * d(fj)/d(ym) * Vnm(y) )
00049   //   The derivatives are calculated from:
00050   //       d0 = r**2 * slope / sqrt( 1 + r**2 * slope**2 )   &
00051   //       phi0 = phiseg - asin(d0 / r) 
00052   
00053   //    d0ovSlope = r**2/sqrt(1 + slope**2 * r**2) = d0 / slope
00054   //    d0ovrad = d0/r
00055   //    d0ovradsq = (d0/r)**2
00056   //    dphi0dphi = d(phi0)/d(seg-phi)
00057   //    dphi0ds   = d(phi0)/d(seg-slope)
00058   //    dd0ds   = d(d0)/d(seg-slope)
00059   //    dd0dphi = 0
00060   
00061   double d0ovSlope = -rad * rad / sqrt( 1. + slope*slope * rad*rad );
00062   double d0 = slope * d0ovSlope;
00063   _par0 = d0;
00064 
00065   double d0ovRad =  d0 / rad ;
00066   // Don't blow away arcsine:
00067   d0ovRad = ( d0ovRad > 1.0 || d0ovRad < -1.0) ? 
00068     (d0ovRad+0.00001)/fabs(d0ovRad) : d0ovRad; 
00069   BesAngle phi0 = phi - asin( d0ovRad );
00070   _par1 = phi0.posRad();
00071 
00072   // Error matrix (anal calculation).
00073   //  double dphi0dphi = 1.;
00074   double dphi0ds = -d0ovSlope * sqrt( 1. - d0ovRad*d0ovRad ) / rad;
00075   double dd0ds = d0ovSlope * ( 1. - d0ovRad*d0ovRad );
00076 
00077   // d0:
00078   _errmat[0] = inErr[2] * dd0ds * dd0ds;
00079   if (_errmat[0] < 0.) _errmat[0] = 0.;
00080 
00081   // phi0:
00082   _errmat[2] = inErr[2] * dphi0ds * dphi0ds  + inErr[0]  +  
00083     inErr[1] * 2. * dphi0ds;
00084   if (_errmat[2] < 0.) _errmat[2] = 0.;
00085   // phi0|d0:
00086   _errmat[1] = inErr[2] * dd0ds * dphi0ds + 
00087                inErr[1] * dd0ds;
00088 
00089   int error = mdcTwoInv(_errmat, _inverr);
00090   if (error) {
00091     std::cout << " ErrMsg(warning) " 
00092       << "Failed to invert matrix -- MdcSegInfo::calcStraight" << endl 
00093       << _errmat[0] << " " << _errmat[1] << " " << _errmat[2]<< std::endl;
00094   }
00095 }
00096 
00097 //------------------------------------------------------------------
00098 void 
00099 MdcSegInfoCsmc::calcStraight(const MdcSeg *parentSeg) {
00100 //------------------------------------------------------------------
00101   double slope = parentSeg->slope();
00102   double radius = parentSeg->superlayer()->rad0();
00103   double phi = parentSeg->phi();
00104   const double *inErr = parentSeg->errmat();
00105 
00106   calcStraight(phi, slope, radius, inErr);
00107 }
00108 
00109 //------------------------------------------------------------------
00110 double 
00111 MdcSegInfoCsmc::sigPhi0() const {
00112 //------------------------------------------------------------------
00113   return sqrt(_errmat[2]);
00114 }
00115 //------------------------------------------------------------------
00116 double 
00117 MdcSegInfoCsmc::sigD0() const {
00118 //------------------------------------------------------------------
00119   return sqrt(_errmat[0]);
00120 }

Generated on Tue Nov 29 23:13:34 2016 for BOSS_7.0.2 by  doxygen 1.4.7