18 #include "boost/io/ios_state.hpp"
69 CLHEP::HepMatrix SPDT =
m_SPD.T();
70 CLHEP::HepMatrix M =
m_SPD * SPDT;
75 std::cout <<
" add f*p: F2_sigPed=" <<
m_sigPedF2 <<
", Ped_const=" <<
m_pedConst <<
", F2_sigPile="
87 CLHEP::HepMatrix MI = M.inverse(
err);
92 for (
int i = 0;
i < 10;
i++) {
97 std::cout <<
" Camp: ";
103 double err = sqrt(MI[
i][
i]);
108 std::cout <<
" SPD: ";
110 std::cout <<
" SPDT: ";
112 CLHEP::HepMatrix Ident = M * MI;
113 std::cout <<
" M*MI: ";
115 std::cout <<
" MISPD: ";
117 std::cout <<
" errDiag=";
121 std::cout << std::endl;
127 bool debugFitAmp = lDebug;
130 CLHEP::HepVector& digits = tResult.
getDigRef();
133 CLHEP::HepVector& Err = tResult.
getErrRef();
134 CLHEP::HepVector& residuals = tResult.
getResidRef();
138 std::cout <<
" In FitAmp: MISPD=" << std::endl;
149 predict =
m_SPD.T() * Amp;
152 residuals = digits - predict;
153 chisq = residuals.normsq() / (sigDig * sigDig);
157 chisq = chisq + Amp[iamp] * Amp[iamp] *
m_sigPileF2;
169 std::cout <<
" predict: ";
171 std::cout <<
" residuals: ";
192 boost::io::ios_base_all_saver coutsave(std::cout);
193 int nrow =
mat.num_row();
194 int ncol =
mat.num_col();
195 std::cout <<
" nrow=" << nrow <<
", ncol=" << ncol << std::endl;
196 std::streamsize oldprec = std::cout.precision(4);
197 for (
int irow = 0; irow < nrow; irow++) {
198 std::cout <<
" irow=" << irow <<
": Mat=";
200 std::cout << std::setw(7) <<
mat[irow][
icol];
202 std::cout << std::endl;
204 std::cout.precision(oldprec);
208 int nr =
vec.num_row();
209 int nc =
vec.num_col();
210 std::cout <<
" nr=" << nr <<
", nc=" <<
nc <<
", vec=";
211 for (
int i = 0;
i < nr;
i++) {
212 std::cout <<
vec[
i] <<
" ";
214 std::cout << std::endl;