+Int_t AliAttrib::GetNcalfuncs() const
+{
+// Provide the number of specified calib. functions for this attribute.
+
+ if (!fCalfuncs) return 0;
+
+ Int_t n=0;
+ for (Int_t i=1; i<=fCalfuncs->GetSize(); i++)
+ {
+ if (fCalfuncs->At(i-1)) n=i;
+ }
+ return n;
+}
+///////////////////////////////////////////////////////////////////////////
+Int_t AliAttrib::GetNdecalfuncs() const
+{
+// Provide the number of specified de-calib. functions for this attribute.
+
+ if (!fDecalfuncs) return 0;
+
+ Int_t n=0;
+ for (Int_t i=1; i<=fDecalfuncs->GetSize(); i++)
+ {
+ if (fDecalfuncs->At(i-1)) n=i;
+ }
+ return n;
+}
+///////////////////////////////////////////////////////////////////////////
+TF1* AliAttrib::GetCalFunction(Int_t j) const
+{
+// Provide pointer to the calib. function of the j-th (default j=1) slot.
+// Note : The first attribute slot is at j=1.
+
+ TF1* f=0;
+ if (j>0 && j<=GetNcalfuncs()) f=(TF1*)fCalfuncs->At(j-1);
+ return f;
+}
+///////////////////////////////////////////////////////////////////////////
+TF1* AliAttrib::GetCalFunction(TString name) const
+{
+// Provide pointer to the calib. function of the name-specified slot.
+// In case no match is found, zero is returned.
+
+ TF1* f=0;
+ Int_t j=GetSlotIndex(name);
+ if (j>0) f=GetCalFunction(j);
+ return f;
+}
+///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetCalFunction(TF1* f,Int_t j)
+{
+// Set the calib. function of the j-th (default j=1) slot.
+// Note : The first attribute slot is at j=1.
+//
+// In case the value of the index j exceeds the maximum number of reserved
+// positions for the functions, the number of reserved positions for the functions
+// is increased automatically.
+//
+// In case the function pointer argument has the same value as the current function
+// pointer value, no action is taken since the user has already modified the actual
+// function.
+//
+// In case the function pointer argument is zero, the current function
+// is deleted and the pointer set to zero.
+//
+// In all other cases the current function is deleted and a new
+// copy of the input function is created which becomes the current function.
+
+ if (j<1) return;
+
+ if (!fCalfuncs)
+ {
+ fCalfuncs=new TObjArray(j);
+ fCalfuncs->SetOwner();
+ }
+
+ if (j > fCalfuncs->GetSize()) fCalfuncs->Expand(j);
+
+ TF1* fcur=(TF1*)fCalfuncs->At(j-1);
+ if (f != fcur)
+ {
+ if (fcur)
+ {
+ fCalfuncs->Remove(fcur);
+ delete fcur;
+ fcur=0;
+ }
+ if (f)
+ {
+ fcur=new TF1(*f);
+ fCalfuncs->AddAt(fcur,j-1);
+ }
+ }
+}
+///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetCalFunction(TF1* f,TString name)
+{
+// Set the calib. function of the name-specified slot.
+//
+// In case the function pointer argument has the same value as the current function
+// pointer value, no action is taken since the user has already modified the actual
+// function.
+//
+// In case the function pointer argument is zero, the current function
+// is deleted and the pointer set to zero.
+//
+// In all other cases the current function is deleted and a new
+// copy of the input function is created which becomes the current function.
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetCalFunction(f,j);
+}
+///////////////////////////////////////////////////////////////////////////
+TF1* AliAttrib::GetDecalFunction(Int_t j) const
+{
+// Provide pointer to the de-calib. function of the j-th (default j=1) slot.
+// Note : The first attribute slot is at j=1.
+
+ TF1* f=0;
+ if (j>0 && j<=GetNdecalfuncs()) f=(TF1*)fDecalfuncs->At(j-1);
+ return f;
+}
+///////////////////////////////////////////////////////////////////////////
+TF1* AliAttrib::GetDecalFunction(TString name) const
+{
+// Provide pointer to the de-calib. function of the name-specified slot.
+// In case no match is found, zero is returned.
+
+ TF1* f=0;
+ Int_t j=GetSlotIndex(name);
+ if (j>0) f=GetDecalFunction(j);
+ return f;
+}
+///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetDecalFunction(TF1* f,Int_t j)
+{
+// Set the de-calib. function of the j-th (default j=1) slot.
+// Note : The first attribute slot is at j=1.
+//
+// In case the value of the index j exceeds the maximum number of reserved
+// positions for the functions, the number of reserved positions for the functions
+// is increased automatically.
+//
+// In case the function pointer argument has the same value as the current function
+// pointer value, no action is taken since the user has already modified the actual
+// function.
+//
+// In case the function pointer argument is zero, the current function
+// is deleted and the pointer set to zero.
+//
+// In all other cases the current function is deleted and a new
+// copy of the input function is created which becomes the current function.
+
+ if (j<1) return;
+
+ if (!fDecalfuncs)
+ {
+ fDecalfuncs=new TObjArray(j);
+ fDecalfuncs->SetOwner();
+ }
+
+ if (j > fDecalfuncs->GetSize()) fDecalfuncs->Expand(j);
+
+ TF1* fcur=(TF1*)fDecalfuncs->At(j-1);
+ if (f != fcur)
+ {
+ if (fcur)
+ {
+ fDecalfuncs->Remove(fcur);
+ delete fcur;
+ fcur=0;
+ }
+ if (f)
+ {
+ fcur=new TF1(*f);
+ fDecalfuncs->AddAt(fcur,j-1);
+ }
+ }
+}
+///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetDecalFunction(TF1* f,TString name)
+{
+// Set the de-calib. function of the name-specified slot.
+//
+// In case the function pointer argument has the same value as the current function
+// pointer value, no action is taken since the user has already modified the actual
+// function.
+//
+// In case the function pointer argument is zero, the current function
+// is deleted and the pointer set to zero.
+//
+// In all other cases the current function is deleted and a new
+// copy of the input function is created which becomes the current function.
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetDecalFunction(f,j);
+}
+///////////////////////////////////////////////////////////////////////////