-void AliRelAlignerKalman::ResetCovariance( const Double_t number )
-{
- //Resets the covariance to the default if arg=0 or resets the off diagonals
- //to zero and releases the diagonals by factor arg.
- if (number==0.)
- {
- //Resets the covariance of the fit to a default value
- fPXcov->UnitMatrix();
- (*fPXcov)(0,0) = .01*.01; //psi (rad)
- (*fPXcov)(1,1) = .01*.01; //theta (rad
- (*fPXcov)(2,2) = .01*.01; //phi (rad)
- (*fPXcov)(3,3) = .5*.5; //x (cm)
- (*fPXcov)(4,4) = .5*.5; //y (cm)
- (*fPXcov)(5,5) = .5*.5; //z (cm)
- (*fPXcov)(6,6) = .05*.05;//drift velocity correction
- (*fPXcov)(7,7) = 1.*1.; //offset (cm)
- }
- else
- {
- for (Int_t z=0;z<fgkNSystemParams;z++)
- {
- for (Int_t zz=0;zz<fgkNSystemParams;zz++)
- {
- if (zz==z) continue;
- (*fPXcov)(zz,z) = 0.;
- (*fPXcov)(z,zz) = 0.;
- }
- (*fPXcov)(z,z)*=number;
- }
- }
-}
+//void AliRelAlignerKalman::PrintCovarianceCorrection()
+//{
+// //Print the measurement covariance correction matrix
+// printf("Covariance correction matrix:\n");
+// for ( Int_t i=0; i<fgkNMeasurementParams; i++ )
+// {
+// for ( Int_t j=0; j<i+1; j++ )
+// {
+// printf("% -2.2f ", (*fPMeasurementCovCorr)(i,j) );
+// }//for i
+// printf("\n");
+// }//for j
+// printf("\n");
+// return;
+//}
+
+//_______________________________________________________________________________
+//Bool_t AliRelAlignerKalman::UpdateCalibration()
+//{
+// //Update the calibration with new data (in calibration mode)
+//
+// fPMes0Hist->Fill( (*fPMeasurement)(0) );
+// fPMes1Hist->Fill( (*fPMeasurement)(1) );
+// fPMes2Hist->Fill( (*fPMeasurement)(2) );
+// fPMes3Hist->Fill( (*fPMeasurement)(3) );
+// fPMesErr0Hist->Fill( TMath::Sqrt((*fPMeasurementCov)(0,0)) );
+// fPMesErr1Hist->Fill( TMath::Sqrt((*fPMeasurementCov)(1,1)) );
+// fPMesErr2Hist->Fill( TMath::Sqrt((*fPMeasurementCov)(2,2)) );
+// fPMesErr3Hist->Fill( TMath::Sqrt((*fPMeasurementCov)(3,3)) );
+// return kTRUE;
+//}
+
+//______________________________________________________________________________
+//Bool_t AliRelAlignerKalman::SetCalibrationMode( const Bool_t cp )
+//{
+// //sets the calibration mode
+// if (cp)
+// {
+// fCalibrationMode=kTRUE;
+// return kTRUE;
+// }//if (cp)
+// else
+// {
+// if (fCalibrationMode) // do it only after the calibration pass
+// {
+// CalculateCovarianceCorrection();
+// SetApplyCovarianceCorrection();
+// fCalibrationMode=kFALSE;
+// return kTRUE;
+// }//if (fCalibrationMode)
+// }//else (cp)
+// return kFALSE;
+//}
+
+//______________________________________________________________________________
+//Bool_t AliRelAlignerKalman::CalculateCovarianceCorrection()
+//{
+// //Calculates the correction to the measurement covariance
+// //using the calibration histograms
+//
+// fPMeasurementCovCorr->Zero(); //reset the correction
+//
+// Double_t s,m,c; //sigma,meansigma,correction
+//
+// //TF1* fitformula;
+// //fPMes0Hist->Fit("gaus");
+// //fitformula = fPMes0Hist->GetFunction("gaus");
+// //s = fitformula->GetParameter(2); //spread of the measurement
+// //fPMesErr0Hist->Fit("gaus");
+// //fitformula = fPMesErr0Hist->GetFunction("gaus"); //average error from cov matrices
+// //m = fitformula->GetParameter(1);
+// s = fPMes0Hist->GetRMS();
+// m = fPMesErr0Hist->GetMean();
+// c = s-m; //the difference between the average error and real spread of the data
+// if (c>0) //only correct is spread bigger than average error
+// (*fPMeasurementCovCorr)(0,0) = c*c;
+//
+// //fPMes1Hist->Fit("gaus");
+// //fitformula = fPMes1Hist->GetFunction("gaus");
+// //s = fitformula->GetParameter(2);
+// //fPMesErr1Hist->Fit("gaus");
+// //fitformula = fPMesErr1Hist->GetFunction("gaus");
+// //m = fitformula->GetParameter(1);
+// s = fPMes1Hist->GetRMS();
+// m = fPMesErr1Hist->GetMean();
+// c = s-m;
+// if (c>0) //only correct is spread bigger than average error
+// (*fPMeasurementCovCorr)(1,1) = c*c;
+//
+// //fPMes2Hist->Fit("gaus");
+// //fitformula = fPMes2Hist->GetFunction("gaus");
+// //s = fitformula->GetParameter(2);
+// //fPMesErr2Hist->Fit("gaus");
+// //fitformula = fPMesErr2Hist->GetFunction("gaus");
+// //m = fitformula->GetParameter(1);
+// s = fPMes2Hist->GetRMS();
+// m = fPMesErr2Hist->GetMean();
+// c = s-m;
+// if (c>0) //only correct is spread bigger than average error
+// (*fPMeasurementCovCorr)(2,2) = c*c;
+//
+// //fPMes3Hist->Fit("gaus");
+// //fitformula = fPMes3Hist->GetFunction("gaus");
+// //s = fitformula->GetParameter(2);
+// //fPMesErr3Hist->Fit("gaus");
+// //fitformula = fPMesErr3Hist->GetFunction("gaus");
+// //m = fitformula->GetParameter(1);
+// s = fPMes3Hist->GetRMS();
+// m = fPMesErr3Hist->GetMean();
+// c = s-m;
+// if (c>0) //only correct is spread bigger than average error
+// (*fPMeasurementCovCorr)(3,3) = c*c;
+//
+// return kTRUE;
+//}
+