00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: DifIndepPar.h,v 1.3 2009/12/23 02:59:56 zhangy Exp $ 00004 // 00005 // Description: 00006 // Class Header for |DifIndepPar| 00007 // Container class for a set of independ parameters 00008 // 00009 // Environment: 00010 // Software developed for the BaBar Detector at the SLAC B-Factory. 00011 // 00012 // Author List: 00013 // A. Snyder 00014 // 00015 // Copyright Information: 00016 // Copyright (C) 1996 SLAC 00017 // 00018 // History: 00019 // Migration for BESIII MDC 00020 // 00021 //------------------------------------------------------------------------ 00022 00023 #ifndef DifIndepPar_HH 00024 #define DifIndepPar_HH 00025 00026 //#include "BaBar/BaBar.hh" 00027 #include <assert.h> 00028 #include <stdlib.h> 00029 00030 #include "CLHEP/Matrix/SymMatrix.h" 00031 #include "CLHEP/Matrix/Vector.h" 00032 using CLHEP::HepVector; 00033 using CLHEP::HepSymMatrix; 00034 00035 #include <iosfwd> 00036 class DifArray; 00037 class DifNumber; 00038 00039 class DifIndepPar { 00040 00041 public: 00042 00043 DifIndepPar(int n); // create slots for n parameters 00044 DifIndepPar(const HepVector& a);// from a vector of doubles 00045 DifIndepPar(const HepVector& pvec, const HepSymMatrix& pcov);// from a vector and an error matrix 00046 DifIndepPar(const DifIndepPar& rhs);// new set via copy of existing set 00047 00048 DifArray difParameters()const; // return (by copy) array of indep parameters 00049 DifNumber difPar(int i)const; // fetch parameter i 00050 00051 HepVector& parameter() { return parvec;} 00052 const HepVector& parameter() const { return parvec;} 00053 HepSymMatrix& covariance() { return parcov;} 00054 const HepSymMatrix& covariance() const { return parcov;} 00055 int nPar()const {return parvec.num_row();} 00056 00057 //io 00058 void print(std::ostream& os = std::cout) const; 00059 void printAll(std::ostream& os = std::cout) const; 00060 00061 private: 00062 //data 00063 HepVector parvec; // Vector of parameters 00064 HepSymMatrix parcov; // Covariance matrix on the parameters 00065 00066 //private functions 00067 // void setDerives(); // make numbers point at this 00068 00069 }; 00070 00071 //io 00072 inline std::ostream& operator<<(std::ostream& o,const DifIndepPar& i){ i.print(o); return o; } 00073 00074 #endif