/* * GblData.h * * Created on: Aug 18, 2011 * Author: kleinwrt */ #ifndef GBLDATA_H_ #define GBLDATA_H_ #include "VMatrix.h" #include #include #include #include #include #include #include #include typedef ROOT::Math::SMatrix SMatrix25; typedef ROOT::Math::SMatrix SMatrix27; typedef ROOT::Math::SMatrix SMatrix55; //! Namespace for the general broken lines package namespace gbl { /// Data (block) for independent scalar measurement /** * Data (block) containing value, precision and derivatives for measurements and kinks. * Created from attributes of GblPoints, used to construct linear equation system for track fit. */ class GblData { public: GblData(unsigned int aLabel, double aMeas, double aPrec); virtual ~GblData(); void addDerivatives(unsigned int iRow, const std::vector &labDer, const SMatrix55 &matDer, unsigned int iOff, const TMatrixD &derLocal, const std::vector &labGlobal, const TMatrixD &derGlobal, unsigned int nLocal, const TMatrixD &derTrans); void addDerivatives(unsigned int iRow, const std::vector &labDer, const SMatrix27 &matDer, unsigned int nLocal, const TMatrixD &derTrans); void addDerivatives(const std::vector &index, const std::vector &derivatives); void setPrediction(const VVector &aVector); double setDownWeighting(unsigned int aMethod); double getChi2() const; void printData() const; void getLocalData(double &aValue, double &aWeight, std::vector* &indLocal, std::vector* &derLocal); void getAllData(float &fValue, float &fErr, std::vector* &indLocal, std::vector* &derLocal, std::vector* &labGlobal, std::vector* &derGlobal); void getResidual(double &aResidual, double &aVariance, double &aDownWeight, std::vector* &indLocal, std::vector* &derLocal); private: unsigned int theLabel; ///< Label (of measurements point) double theValue; ///< Value (residual) double thePrecision; ///< Precision (1/sigma**2) double theDownWeight; ///< Down-weighting factor (0-1) double thePrediction; ///< Prediction from fit std::vector theParameters; ///< List of fit parameters (with non zero derivatives) std::vector theDerivatives; ///< List of derivatives for fit std::vector globalLabels; ///< Labels for global derivatives std::vector globalDerivatives; ///< Global derivatives }; } #endif /* GBLDATA_H_ */