// npoints : array of 3 elements with the number of points to compute in each of 3 dimension
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
// precD : optional array with precisions per output dimension (if >fgkMinPrec will override common prec)
- if (DimOut<1) {Error("AliCheb3D","Requested output dimension is %d\nStop\n",fDimOut); exit(1);}
+ if (DimOut<1) AliFatalF("Requested output dimension is %d",fDimOut);
for (int i=3;i--;) {
fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
fNPoints[i] = 0;
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
// precD : optional array with precisions per output dimension (if >fgkMinPrec will override common prec)
//
- 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);}
+ if (DimOut<1) AliFatalF("Requested output dimension is %d",fDimOut);
for (int i=3;i--;) {
fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
fNPoints[i] = 0;
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
// precD : optional array with precisions per output dimension (if >fgkMinPrec will override common prec)
//
- 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);}
+ if (DimOut<1) AliFatalF("Requested output dimension is %d",fDimOut);
for (int i=3;i--;) {
fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
fNPoints[i] = 0;
// prec : max allowed absolute difference between the user function and computed parameterization on the requested grid
// precD : optional array with precisions per output dimension (if >fgkMinPrec will override common prec)
//
- 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);}
+ if (DimOut!=3) AliFatalF("This constructor works only for 3D fits, %dD fit was requested",fDimOut);
+ if (DimOut<1) AliFatalF("Requested output dimension is %d",fDimOut);
for (int i=3;i--;) {
fBMin[i] = fBMax[i] = fBScale[i] = fBOffset[i] = 0;
fNPoints[i] = 0;
fBMax[i] = bmax[i];
fBScale[i] = bmax[i]-bmin[i];
if (fBScale[i]<=0) {
- AliFatal(Form("Boundaries for %d-th dimension are not increasing: %+.4e %+.4e\nStop\n",i,fBMin[i],fBMax[i]));
+ AliFatalF("Boundaries for %d-th dimension are not increasing: %+.4e %+.4e\nStop\n",i,fBMin[i],fBMax[i]);
}
fBOffset[i] = bmin[i] + fBScale[i]/2.0;
fBScale[i] = 2./fBScale[i];
if (fUsrMacro) delete fUsrMacro;
TString tmpst = fUsrFunName;
tmpst += "+"; // prepare filename to compile
- if (gROOT->LoadMacro(tmpst.Data())) {Error("SetUsrFunction","Failed to load user function from %s\nStop\n",name); exit(1);}
+ if (gROOT->LoadMacro(tmpst.Data())) AliFatalF("Failed to load user function from %s",name);
fUsrMacro = new TMethodCall();
tmpst = tmpst.Data() + tmpst.Last('/')+1; //Strip away any path preceding the macro file name
int dot = tmpst.Last('.');
fMaxCoefs = 1;
for (int id=3;id--;) {
fNPoints[id] = npoints[id];
- if (fNPoints[id]<kMinPoints) {
- Error("DefineGrid","at %d-th dimension %d point is requested, at least %d is needed\nStop\n",id,fNPoints[id],kMinPoints);
- exit(1);
- }
+ if (fNPoints[id]<kMinPoints) AliFatalF("at %d-th dimension %d point is requested, at least %d is needed",id,fNPoints[id],kMinPoints);
ntot += fNPoints[id];
fMaxCoefs *= fNPoints[id];
}
{
// load coefficients data from stream
//
- if (!stream) {AliFatal("No stream provided.\nStop");}
+ if (!stream) AliFatal("No stream provided");
TString buffs;
Clear();
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("START")) {AliFatal(Form("Expected: \"START <fit_name>\", found \"%s\"\nStop\n",buffs.Data()));}
+ if (!buffs.BeginsWith("START")) AliFatalF("Expected: \"START <fit_name>\", found \"%s\"",buffs.Data());
SetName(buffs.Data()+buffs.First(' ')+1);
//
AliCheb3DCalc::ReadLine(buffs,stream); // N output dimensions
fDimOut = buffs.Atoi();
- if (fDimOut<1) {AliFatal(Form("Expected: '<number_of_output_dimensions>', found \"%s\"\nStop\n",buffs.Data()));}
+ if (fDimOut<1) AliFatalF("Expected: '<number_of_output_dimensions>', found \"%s\"",buffs.Data());
//
SetDimOut(fDimOut);
//
AliCheb3DCalc::ReadLine(buffs,stream); // Interpolation abs. precision
fPrec = buffs.Atof();
- if (fPrec<=0) {AliFatal(Form("Expected: '<abs.precision>', found \"%s\"\nStop\n",buffs.Data()));}
+ if (fPrec<=0) AliFatalF("Expected: '<abs.precision>', found \"%s\"",buffs.Data());
//
for (int i=0;i<3;i++) { // Lower boundaries of interpolation region
AliCheb3DCalc::ReadLine(buffs,stream);
// check end_of_data record
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("END") || !buffs.Contains(GetName())) {
- AliFatal(Form("Expected \"END %s\", found \"%s\".\nStop\n",GetName(),buffs.Data()));
+ AliFatalF("Expected \"END %s\", found \"%s\"",GetName(),buffs.Data());
}
//
}
#include <cstdlib>
#include <TSystem.h>
#include "AliCheb3DCalc.h"
+#include "AliLog.h"
ClassImp(AliCheb3DCalc)
void AliCheb3DCalc::LoadData(FILE* stream)
{
// Load coefs. from the stream
- if (!stream) {Error("LoadData","No stream provided.\nStop"); exit(1);}
+ if (!stream) AliFatal("No stream provided");
TString buffs;
Clear();
ReadLine(buffs,stream);
- if (!buffs.BeginsWith("START")) {Error("LoadData","Expected: \"START <fit_name>\", found \"%s\"\nStop\n",buffs.Data());exit(1);}
+ if (!buffs.BeginsWith("START")) AliFatalF("Expected: \"START <fit_name>\", found \"%s\"",buffs.Data());
if (buffs.First(' ')>0) SetName(buffs.Data()+buffs.First(' ')+1);
//
ReadLine(buffs,stream); // NRows
fNRows = buffs.Atoi();
- if (fNRows<0 && !buffs.IsDigit()) {Error("LoadData","Expected: '<number_of_rows>', found \"%s\"\nStop\n",buffs.Data());exit(1);}
+ if (fNRows<0 && !buffs.IsDigit()) AliFatalF("Expected: '<number_of_rows>', found \"%s\"",buffs.Data());
//
fNCols = 0;
fNElemBound2D = 0;
fNCoefs += fCoefBound2D0[i];
}
//
- // if (fNCoefs<=0) {Error("LoadData","Negtive (%d) number of Chebychef coeffs. is obtained.\nStop\n",fNCoefs);exit(1);}
- //
InitCoefs(fNCoefs);
for (int i=0;i<fNCoefs;i++) {
ReadLine(buffs,stream);
//
// check end_of_data record
ReadLine(buffs,stream);
- if (!buffs.BeginsWith("END") || !buffs.Contains(GetName())) {
- Error("LoadData","Expected \"END %s\", found \"%s\".\nStop\n",GetName(),buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("END") || !buffs.Contains(GetName())) AliFatalF("Expected \"END %s\", found \"%s\"",GetName(),buffs.Data());
//
}
if (str.IsNull()||str.BeginsWith("#")) continue;
return;
}
- fprintf(stderr,"AliCheb3D::ReadLine: Failed to read from stream.\nStop");exit(1); // normally, should not reach here
+ AliFatalGeneral("ReadLine","Failed to read from stream"); // normally, should not reach here
}
//_______________________________________________
//
TString buffs;
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("START")) {
- Error("LoadData","Expected: \"START <name>\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("START")) AliFatalF("Expected: \"START <name>\", found \"%s\"",buffs.Data());
if (buffs.First(' ')>0) SetName(buffs.Data()+buffs.First(' ')+1);
//
// Solenoid part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("START SOLENOID")) {
- Error("LoadData","Expected: \"START SOLENOID\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("START SOLENOID")) AliFatalF("Expected: \"START SOLENOID\", found \"%s\"",buffs.Data());
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparSol = buffs.Atoi();
//
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("END SOLENOID")) {
- Error("LoadData","Expected \"END SOLENOID\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("END SOLENOID")) AliFatalF("Expected \"END SOLENOID\", found \"%s\"",buffs.Data());
//
// TPCInt part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("START TPCINT")) {
- Error("LoadData","Expected: \"START TPCINT\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("START TPCINT")) AliFatalF("Expected: \"START TPCINT\", found \"%s\"",buffs.Data());
+ //
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparTPCInt = buffs.Atoi();
//
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("END TPCINT")) {
- Error("LoadData","Expected \"END TPCINT\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("END TPCINT")) AliFatalF("Expected \"END TPCINT\", found \"%s\"",buffs.Data());
//
// TPCRatInt part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("START TPCRatINT")) {
- Error("LoadData","Expected: \"START TPCRatINT\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("START TPCRatINT")) AliFatalF("Expected: \"START TPCRatINT\", found \"%s\"",buffs.Data());
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparTPCRatInt = buffs.Atoi();
//
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("END TPCRatINT")) {
- Error("LoadData","Expected \"END TPCRatINT\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("END TPCRatINT")) AliFatalF("Expected \"END TPCRatINT\", found \"%s\"",buffs.Data());
//
// Dipole part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("START DIPOLE")) {
- Error("LoadData","Expected: \"START DIPOLE\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("START DIPOLE")) AliFatalF("Expected: \"START DIPOLE\", found \"%s\"",buffs.Data());
+ //
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparDip = buffs.Atoi();
//
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("END DIPOLE")) {
- Error("LoadData","Expected \"END DIPOLE\", found \"%s\"\nStop\n",buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("END DIPOLE")) AliFatalF("Expected \"END DIPOLE\", found \"%s\"",buffs.Data());
//
AliCheb3DCalc::ReadLine(buffs,stream);
- if (!buffs.BeginsWith("END ") && !buffs.Contains(GetName())) {
- Error("LoadData","Expected: \"END %s\", found \"%s\"\nStop\n",GetName(),buffs.Data());
- exit(1);
- }
+ if (!buffs.BeginsWith("END ") && !buffs.Contains(GetName())) AliFatalF("Expected: \"END %s\", found \"%s\"",GetName(),buffs.Data());
//
// ---------------------------------------------------------------------------
fclose(stream);