00001 //-------------------------------------------------------------------------- 00002 // 00003 // Description: 00004 // Code for the NeutParams neutral track parameterization class 00005 // 00006 // Environment: 00007 // Software developed for the BaBar Detector at the SLAC B-Factory. 00008 // 00009 // Author(s): Justin Albert, Valery Miftahov (based on HelixParams.cc by 00010 // Dave Brown) 00011 // 00012 //------------------------------------------------------------------------ 00013 #include "TrkBase/NeutParams.h" 00014 #include "TrkBase/TrkExchangePar.h" 00015 #include <iostream> 00016 using namespace std; 00017 // construct from vector and covariance matrix 00018 //------------------------------------------------------------------------ 00019 NeutParams::NeutParams(const HepVector& pvec,const HepSymMatrix& pcov) : 00020 TrkParams(pvec,pcov){ 00021 //------------------------------------------------------------------------ 00022 00023 // Make sure the dimensions of the input matrix and vector are correct 00024 00025 if( pvec.num_row() != _nneutprm || 00026 pcov.num_row() != _nneutprm ){ 00027 cout<<"ErrMsg(error)" << 00028 "NeutParams: incorrect constructor vector/matrix dimension" << endl; 00029 parameter() = HepVector(_nneutprm,0); 00030 covariance() = HepSymMatrix(_nneutprm,0); 00031 } 00032 } 00033 00034 // Construct from the fit parameters directly 00035 //------------------------------------------------------------------------ 00036 NeutParams::NeutParams(double n_d0,double n_phi0,double n_p,double n_z0, 00037 double n_tanDip,double n_s0) : 00038 //------------------------------------------------------------------------ 00039 TrkParams(_nneutprm) { 00040 d0() = n_d0; 00041 phi0() = n_phi0; 00042 p() = n_p; 00043 z0() = n_z0; 00044 s0() = n_s0; 00045 tanDip() = n_tanDip; 00046 } 00047 00048 00049 // Copy constructor 00050 //------------------------------------------------------------------------ 00051 NeutParams::NeutParams(const NeutParams& old) : 00052 //------------------------------------------------------------------------ 00053 TrkParams(old){ 00054 } 00055 //------------------------------------------------------------------------ 00056 double 00057 NeutParams::sinPhi0() const { 00058 //------------------------------------------------------------------------ 00059 return sin(parameter()[_phi0]); 00060 } 00061 00062 //------------------------------------------------------------------------ 00063 double 00064 NeutParams::cosPhi0() const { 00065 //------------------------------------------------------------------------ 00066 return cos(parameter()[_phi0]); 00067 } 00068 00069 //------------------------------------------------------------------------ 00070 double 00071 NeutParams::arcRatio() const { 00072 //------------------------------------------------------------------------ 00073 return sqrt(1. + parameter()[_tanDip] * parameter()[_tanDip]); 00074 } 00075 00076 //------------------------------------------------------------------------ 00077 NeutParams::~NeutParams() 00078 {} 00079 //------------------------------------------------------------------------ 00080