From 1702b05404d6dacc096b5eadcefe32d902ea3090 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 5 Jul 2006 07:46:17 +0000 Subject: [PATCH] Using TMath::Abs and TMath::Sqrt instead of fabs and sqrt --- MUON/AliMillepede.cxx | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/MUON/AliMillepede.cxx b/MUON/AliMillepede.cxx index 10a4115d580..da4870ee99e 100644 --- a/MUON/AliMillepede.cxx +++ b/MUON/AliMillepede.cxx @@ -578,7 +578,7 @@ Int_t AliMillepede::LocalFit(int iFit, double localParams[], bool bSingleFit) AliDebug(1," Result of local fit : (index/parameter/error)"); for (i=0; i= fResCutInit && fIter <= 1) { + if (TMath::Abs(lMeas) >= fResCutInit && fIter <= 1) { AliDebug(2,"Rejected track !!!!!"); fNLocalFitsRejected++; fIndexLocEq.Reset(); fNIndexLocEq=0; // reset stores and go to the next track @@ -660,7 +660,7 @@ Int_t AliMillepede::LocalFit(int iFit, double localParams[], bool bSingleFit) return 0; } - if (fabs(lMeas) >= fResCut && fIter > 1) { + if (TMath::Abs(lMeas) >= fResCut && fIter > 1) { AliDebug(2,"Rejected track !!!!!"); fNLocalFitsRejected++; fIndexLocEq.Reset(); fNIndexLocEq=0; // reset stores and go to the next track @@ -919,7 +919,7 @@ Int_t AliMillepede::GlobalFit(double par[], double error[], double pull[]) fDeltaPar[i] += fVecBGlo[i]; // Update global parameters values (for iterations) AliDebug(1,Form("fDeltaPar[%d] = %.6f", i, fDeltaPar[i])); AliDebug(1,Form("fMatCGlo[%d][%d] = %.6f", i, i, fMatCGlo[i][i])); - AliDebug(1,Form("err = %.6f", sqrt(fabs(fMatCGlo[i][i])))); + AliDebug(1,Form("err = %.6f", TMath::Sqrt(TMath::Abs(fMatCGlo[i][i])))); step[i] = fVecBGlo[i]; @@ -942,7 +942,7 @@ Int_t AliMillepede::GlobalFit(double par[], double error[], double pull[]) fNLocalFitsRejected = 0; if (fChi2CutFactor != fChi2CutRef) { - fChi2CutFactor = sqrt(fChi2CutFactor); + fChi2CutFactor = TMath::Sqrt(fChi2CutFactor); if (fChi2CutFactor < 1.2*fChi2CutRef) { fChi2CutFactor = fChi2CutRef; fIter = fMaxIter - 1; // Last iteration @@ -1008,8 +1008,8 @@ Int_t AliMillepede::GlobalFit(double par[], double error[], double pull[]) for (j=0; j=0 && iPar= rowMax[i]) rowMax[i] = fabs(matV[i][j]); // Max elemt of row i - if (fabs(matV[j][i]) >= colMax[i]) colMax[i] = fabs(matV[j][i]); // Max elemt of column i + if (TMath::Abs(matV[i][j]) >= rowMax[i]) rowMax[i] = TMath::Abs(matV[i][j]); // Max elemt of row i + if (TMath::Abs(matV[j][i]) >= colMax[i]) colMax[i] = TMath::Abs(matV[j][i]); // Max elemt of column i } } @@ -1102,9 +1102,9 @@ int AliMillepede::SpmInv(double matV[][fgkMaxGloPC], double vecB[], int nGlo) for (Int_t i=0; istd::max(fabs(vPivot),eps*diagV[j]))) { + if (bUnUsed[j] && (TMath::Abs(matV[j][j])>std::max(TMath::Abs(vPivot),eps*diagV[j]))) { vPivot = matV[j][j]; iPivot = j; } @@ -1157,7 +1157,7 @@ int AliMillepede::SpmInv(double matV[][fgkMaxGloPC], double vecB[], int nGlo) for (Int_t i=0; iTMath::Max(fabs(vPivot),eps*diagV[j]))) { + if (bUnUsed[j] && (TMath::Abs(matV[j][j])>TMath::Max(TMath::Abs(vPivot),eps*diagV[j]))) { vPivot = matV[j][j]; iPivot = j; } @@ -1374,12 +1374,12 @@ Int_t AliMillepede::PrintGlobalParameters() const AliInfo("-----------------------------------------------------------------------------------"); for (int i=0; i 0) { - lGlobalCor = sqrt(fabs(1.0-1.0/(fMatCGlo[i][i]*fDiagCGlo[i]))); + if (TMath::Abs(fMatCGlo[i][i]*fDiagCGlo[i]) > 0) { + lGlobalCor = TMath::Sqrt(TMath::Abs(1.0-1.0/(fMatCGlo[i][i]*fDiagCGlo[i]))); AliInfo(Form("%d\t %.6f\t %.6f\t %.6f\t %.6f\t %.6f\t %.6f", i,fInitPar[i],fInitPar[i]+fDeltaPar[i],fDeltaPar[i],fVecBGlo[i],lError,lGlobalCor)); } @@ -1427,8 +1427,8 @@ double AliMillepede::Chi2DoFLim(int nSig, int nDoF) return table[lNSig-1][nDoF-1]; } else { // approximation - return ((sn[lNSig-1]+sqrt(float(2*nDoF-3)))* - (sn[lNSig-1]+sqrt(float(2*nDoF-3))))/float(2*nDoF-2); + return ((sn[lNSig-1]+TMath::Sqrt(float(2*nDoF-3)))* + (sn[lNSig-1]+TMath::Sqrt(float(2*nDoF-3))))/float(2*nDoF-2); } } } -- 2.43.0