fUsrFunName(""),
fUsrMacro(0)
{
- for (int i=3;i--;) fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ for (int i=3;i--;) {
+ fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ fNPoints[i] = 0;
+ fGridOffs[i] = 0.;
+ }
}
//__________________________________________________________________________________________
fBScale[i] = src.fBScale[i];
fBOffset[i] = src.fBOffset[i];
fNPoints[i] = src.fNPoints[i];
+ fGridOffs[i] = src.fGridOffs[i];
}
for (int i=0;i<fDimOut;i++) {
AliCheb3DCalc* cbc = src.GetChebCalc(i);
fUsrMacro(0)
{
// read coefs from text file
- for (int i=3;i--;) fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ for (int i=3;i--;) {
+ fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ fNPoints[i] = 0;
+ fGridOffs[i] = 0.;
+ }
LoadData(inpFile);
}
fUsrMacro(0)
{
// read coefs from stream
- for (int i=3;i--;) fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ for (int i=3;i--;) {
+ fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ fNPoints[i] = 0;
+ fGridOffs[i] = 0.;
+ }
LoadData(stream);
}
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
//
if (DimOut<1) {Error("AliCheb3D","Requested output dimension is %d\nStop\n",fDimOut); exit(1);}
+ for (int i=3;i--;) {
+ fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ fNPoints[i] = 0;
+ fGridOffs[i] = 0.;
+ }
SetDimOut(DimOut);
PrepareBoundaries(bmin,bmax);
DefineGrid(npoints);
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
//
if (DimOut<1) {Error("AliCheb3D","Requested output dimension is %d\nStop\n",fDimOut); exit(1);}
+ if (DimOut<1) {Error("AliCheb3D","Requested output dimension is %d\nStop\n",fDimOut); exit(1);}
+ for (int i=3;i--;) {
+ fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ fNPoints[i] = 0;
+ fGridOffs[i] = 0.;
+ }
SetDimOut(DimOut);
PrepareBoundaries(bmin,bmax);
DefineGrid(npoints);
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
//
if (DimOut<1) {Error("AliCheb3D","Requested output dimension is %d\nStop\n",fDimOut); exit(1);}
+ if (DimOut<1) {Error("AliCheb3D","Requested output dimension is %d\nStop\n",fDimOut); exit(1);}
+ for (int i=3;i--;) {
+ fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ fNPoints[i] = 0;
+ fGridOffs[i] = 0.;
+ }
SetDimOut(DimOut);
PrepareBoundaries(bmin,bmax);
SetUsrFunction(ptr);
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
//
if (DimOut!=3) {Error("AliCheb3D","This constructor works only for 3D fits, %dD fit was requested\n",fDimOut); exit(1);}
+ if (DimOut<1) {Error("AliCheb3D","Requested output dimension is %d\nStop\n",fDimOut); exit(1);}
+ for (int i=3;i--;) {
+ fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
+ fNPoints[i] = 0;
+ fGridOffs[i] = 0.;
+ }
SetDimOut(DimOut);
PrepareBoundaries(bmin,bmax);
SetUsrFunction(ptr);
AliCheb3D* par = GetParamSol(id);
#ifndef _BRING_TO_BOUNDARY_
return par->IsInside(rphiz) ? par->Eval(rphiz,2) : 0;
-#endif
+#else
return par->Eval(rphiz,2);
+#endif
//
}
if (!res) {
const char* faildump = "fgmr_failed.dat";
int defout = dup(1);
+ if (defout<0) {
+ AliInfo("Failed on dup");
+ return gkFailed;
+ }
int slvDump = open(faildump, O_RDWR|O_CREAT, 0666);
dup2(slvDump,1);
//
fLabelsL2 = new Int_t[fNtracks];
if (m.fUsedClusT) fUsedClusT = new ULong64_t[fNtracks];
else fUsedClusT = 0;
+ if(m.fTh)memcpy(fTh,m.fTh,fNtracks*sizeof(Double_t));
+ if(m.fPhi)memcpy(fPhi,m.fPhi,fNtracks*sizeof(Double_t));
+ if(m.fDeltTh)memcpy(fDeltTh,m.fDeltTh,fNtracks*sizeof(Double_t));
+ if(m.fDeltPhi)memcpy(fDeltPhi,m.fDeltPhi,fNtracks*sizeof(Double_t));
+ if(m.fLabels)memcpy(fLabels,m.fLabels,fNtracks*sizeof(Int_t));
+ if(m.fLabelsL2)memcpy(fLabelsL2,m.fLabelsL2,fNtracks*sizeof(Int_t));
+ if(fUsedClusT) memcpy(fUsedClusT,m.fUsedClusT,fNtracks*sizeof(ULong64_t));
}
else {
fTh = 0;
fLabelssingle = new Int_t[fNsingle];
if (m.fUsedClusS) fUsedClusS = new UInt_t[fNsingle];
else fUsedClusS = 0;
+ if(m.fThsingle)memcpy(fThsingle,m.fThsingle,fNsingle*sizeof(Double_t));
+ if(m.fPhisingle)memcpy(fPhisingle,m.fPhisingle,fNsingle*sizeof(Double_t));
+ if(m.fLabelssingle)memcpy(fLabelssingle,m.fLabelssingle,fNsingle*sizeof(Int_t));
+ if(fUsedClusS) memcpy(fUsedClusS,m.fUsedClusS,fNsingle*sizeof(UInt_t));
}
else {
fThsingle = 0;
fPhisingle = 0;
fLabelssingle = 0;
}
- if(m.fTh)memcpy(fTh,m.fTh,fNtracks*sizeof(Double_t));
- if(m.fPhi)memcpy(fPhi,m.fPhi,fNtracks*sizeof(Double_t));
- if(m.fDeltTh)memcpy(fDeltTh,m.fDeltTh,fNtracks*sizeof(Double_t));
- if(m.fDeltPhi)memcpy(fDeltPhi,m.fDeltPhi,fNtracks*sizeof(Double_t));
- if(m.fLabels)memcpy(fLabels,m.fLabels,fNtracks*sizeof(Int_t));
- if(m.fLabelsL2)memcpy(fLabelsL2,m.fLabelsL2,fNtracks*sizeof(Int_t));
- if(m.fThsingle)memcpy(fThsingle,m.fThsingle,fNsingle*sizeof(Double_t));
- if(m.fPhisingle)memcpy(fPhisingle,m.fPhisingle,fNsingle*sizeof(Double_t));
- if(m.fLabelssingle)memcpy(fLabelssingle,m.fLabelssingle,fNsingle*sizeof(Int_t));
- if(fUsedClusS) memcpy(fUsedClusS,m.fUsedClusS,fNsingle*sizeof(UInt_t));
- if(fUsedClusT) memcpy(fUsedClusT,m.fUsedClusT,fNtracks*sizeof(ULong64_t));
+
fFiredChips[0] = m.fFiredChips[0];
fFiredChips[1] = m.fFiredChips[1];
for(Int_t ilayer = 0; ilayer < 6; ilayer++){
if (src.fMatrix && (fNGlobal!=src.fNGlobal || fMaxPoints<src.fNPoints)) {
fNGlobal = src.fNGlobal;
fMaxGlobal = src.fMaxGlobal;
- if (fMatrix) delete fMatrix;
- if (fSolGlo) delete[] fSolGlo;
- if (fSolLoc) delete[] fSolLoc;
- if (fRHSGlo) delete[] fRHSGlo;
- if (fRHSLoc) delete[] fRHSLoc;
- if (fMatGamma) delete[] fMatGamma;
- if (fMatG) delete[] fMatG;
- if (fCovDGl) delete[] fCovDGl;
+ if (fMatrix) delete fMatrix; fMatrix = 0;
+ if (fSolGlo) delete[] fSolGlo; fSolGlo = 0;
+ if (fSolLoc) delete[] fSolLoc; fSolLoc = 0;
+ if (fRHSGlo) delete[] fRHSGlo; fRHSGlo = 0;
+ if (fRHSLoc) delete[] fRHSLoc; fRHSLoc = 0;
+ if (fMatGamma) delete[] fMatGamma; fMatGamma = 0;
+ if (fMatG) delete[] fMatG; fMatG = 0;
+ if (fCovDGl) delete[] fCovDGl; fCovDGl = 0;
Init(src.fMaxPoints);
}
if (src.fMatrix) {
if (n>0 && n==fMaxGlobal) return;
fMaxGlobal = n;
fNGlobal = n;
- if (fMatrix) delete fMatrix;
- if (fSolGlo) delete[] fSolGlo;
- if (fSolLoc) delete[] fSolLoc;
- if (fRHSGlo) delete[] fRHSGlo;
- if (fRHSLoc) delete[] fRHSLoc;
- if (fMatGamma) delete[] fMatGamma;
- if (fMatG) delete[] fMatG;
- if (fCovDGl) delete[] fCovDGl;
+ if (fMatrix) delete fMatrix; fMatrix = 0;
+ if (fSolGlo) delete[] fSolGlo; fSolGlo = 0;
+ if (fSolLoc) delete[] fSolLoc; fSolLoc = 0;
+ if (fRHSGlo) delete[] fRHSGlo; fRHSGlo = 0;
+ if (fRHSLoc) delete[] fRHSLoc; fRHSLoc = 0;
+ if (fMatGamma) delete[] fMatGamma; fMatGamma = 0;
+ if (fMatG) delete[] fMatG; fMatG = 0;
+ if (fCovDGl) delete[] fCovDGl; fCovDGl = 0;
n = TMath::Max(16,fMaxPoints);
Init(n);
//
int nmainel = src.GetSizeBooked()*(src.GetSizeBooked()+1);
memcpy(fElems,src.fElems,nmainel*sizeof(Double_t));
if (src.GetSizeAdded()) { // transfer extra rows to main matrix
- Double_t *pnt = fElems + nmainel*sizeof(Double_t);
+ Double_t *pnt = fElems + nmainel;//*sizeof(Double_t);
int ncl = src.GetSizeBooked() + 1;
for (int ir=0;ir<src.GetSizeAdded();ir++) {
ncl += ir;
memcpy(pnt,src.fElemsAdd[ir],ncl*sizeof(Double_t));
- pnt += ncl*sizeof(Double_t);
+ pnt += ncl;//*sizeof(Double_t);
}
}
//
}
}
//
- for (Int_t i=0; i<nGlo; i++) for (Int_t j=0; j<nGlo; j++) {
- double vl = TMath::Sqrt(colMax[i])*TMath::Sqrt(rowMax[j]); // Correct matrix V
- if (i>=j) (*this)(i,j) *= vl;
- else (*fgBuffer)(j,i) *= vl;
- }
+ if (stabilize) for (Int_t i=0; i<nGlo; i++) for (Int_t j=0; j<nGlo; j++) {
+ double vl = TMath::Sqrt(colMax[i])*TMath::Sqrt(rowMax[j]); // Correct matrix V
+ if (i>=j) (*this)(i,j) *= vl;
+ else (*fgBuffer)(j,i) *= vl;
+ }
//
for (Int_t j=0; j<nGlo; j++) {
rowMax[j] = 0.0;