}
//______________________________________________________________________________________
-void AliParamSolver::AddEquation(const Double_t* dGl,const Double_t *dLc,const Double_t *res, const Double_t *covI)
+void AliParamSolver::AddEquation(const Double_t* dGl,const Double_t *dLc,const Double_t *res, const Double_t *covI,Double_t sclErrI)
{
// add the measured point to chi2 normal equations
// Input:
// dLc : 3-vector of derivative for each coordinate vs local param
// res : residual of the point (extrapolated - measured)
// covI: 3 x (3+1)/2 matrix of the (inverted) errors (symmetric)
- //
+ // sclErrI: scaling coefficient to apply to inverted errors (used if >0)
// The contribution of the point to chi2 is V * covI * V
// with component of the vector V(i) = dGl[i]*glob + dLc[i]*loc - res[i]
//
cDl[kX] = covI[kXX]*dLc[kX] + covI[kXY]*dLc[kY] + covI[kXZ]*dLc[kZ];
cDl[kY] = covI[kXY]*dLc[kX] + covI[kYY]*dLc[kY] + covI[kYZ]*dLc[kZ];
cDl[kZ] = covI[kXZ]*dLc[kX] + covI[kYZ]*dLc[kY] + covI[kZZ]*dLc[kZ];
+ if (sclErrI>0) { cDl[kX] *= sclErrI; cDl[kY] *= sclErrI; cDl[kZ] *= sclErrI;}
//
for (int i=fNGlobal;i--;) {
const double *dGli = dGl+i*3; // derivatives of XYZ vs i-th global param
cDgi[kX] = covI[kXX]*dGli[kX] + covI[kXY]*dGli[kY] + covI[kXZ]*dGli[kZ];
cDgi[kY] = covI[kXY]*dGli[kX] + covI[kYY]*dGli[kY] + covI[kYZ]*dGli[kZ];
cDgi[kZ] = covI[kXZ]*dGli[kX] + covI[kYZ]*dGli[kY] + covI[kZZ]*dGli[kZ];
+ if (sclErrI>0) { cDgi[kX] *= sclErrI; cDgi[kY] *= sclErrI; cDgi[kZ] *= sclErrI;}
//
mtG[i] = cDl[kX]*dGli[kX] + cDl[kY]*dGli[kY] + cDl[kZ]*dGli[kZ]; // dR/dGl_i * cov * dR/dLoc
}
AliParamSolver& operator=(const AliParamSolver& src);
~AliParamSolver();
//
- void AddEquation(const Double_t* dGl,const Double_t *dLc,const Double_t *res,const Double_t *covI);
+ void AddEquation(const Double_t* dGl,const Double_t *dLc,const Double_t *res,const Double_t *covI,Double_t sclErrI=-1.);
void AddConstraint(Int_t parID, Double_t val, Double_t err2inv);
Bool_t Solve(Bool_t obtainCov=kFALSE);
Bool_t SolveGlobals(Bool_t obtainCov=kFALSE);