#include "AliRsnListOutput.h"
-
ClassImp(AliRsnListOutput)
//________________________________________________________________________________________
fNValues(0),
fList(0x0),
fIndex(-1),
+ fCheckHistRange(kTRUE),
fArray(0)
{
//
fNValues(copy.fNValues),
fList(copy.fList),
fIndex(copy.fIndex),
+ fCheckHistRange(copy.fCheckHistRange),
fArray(0)
{
//
fNValues = copy.fNValues;
fList = copy.fList;
fIndex = copy.fIndex;
+ fCheckHistRange = copy.fCheckHistRange;
fArray = copy.fArray;
Reset();
// resize the output array
fArray.Set(fNValues);
+
+ Bool_t isPair=kFALSE;
+
// create the name
- TString name(Form("%s_%s", prefix, GetName()));
+ TString name(GetName());
+ if (!name.CompareTo("pair")) isPair = kTRUE;
+ if (isPair) name = "";
+ else name.Prepend(".");
+ name.Prepend(prefix);
+
+// TString name(Form("%s.%s", prefix, GetName()));
AliRsnValue *val = 0x0;
for (i = 0; i < fNValues; i++) {
val = GetValue(i);
AliError(Form("Slot %d in value list is NULL", i));
return kFALSE;
}
- name += '_';
- name += val->GetName();
+ if (!isPair) {
+ name += '_';
+ name += val->GetName();
+ }
}
// allowed objects
// and, if successful, insert into the list
switch (fType) {
case kHistoDefault:
- name.Append("_hist");
+// name.Append("_hist");
object = CreateHistogram(name.Data());
break;
case kHistoSparse:
- name.Append("_hsparse");
+// name.Append("_hsparse");
object = CreateHistogramSparse(name.Data());
break;
case kCFContainer:
- name.Append("_cf");
+// name.Append("_cf");
object = CreateCFContainer(name.Data());
break;
default:
hist->Sumw2();
// update the various axes using the definitions given in the array of axes here
+ AliRsnValue *val = 0x0;
for (i = 0; i < fNValues; i++) {
+ val = GetValue(i);
+ if (val) hist->GetAxis(i)->SetName(val->GetName());
hist->GetAxis(i)->Set(nbins[i], array[i].GetArray());
}
return kTRUE;
} else if (obj->InheritsFrom(THnSparse::Class())) {
THnSparseF *h = (THnSparseF *)obj;
+ if (fCheckHistRange) {
+ for (Int_t iAxis = 0; iAxis<h->GetNdimensions(); iAxis++) {
+ if (fArray.At(iAxis)>h->GetAxis(iAxis)->GetXmax() || fArray.At(iAxis)<h->GetAxis(iAxis)->GetXmin()) return kFALSE;
+ }
+ }
h->Fill(fArray.GetArray());
return kTRUE;
} else if (obj->InheritsFrom(AliCFContainer::Class())) {
return kTRUE;
} else if (obj->InheritsFrom(THnSparse::Class())) {
THnSparseF *h = (THnSparseF *)obj;
+ if (fCheckHistRange) {
+ for (Int_t iAxis = 0; iAxis<h->GetNdimensions(); iAxis++) {
+ if (values[iAxis]>h->GetAxis(iAxis)->GetXmax() || values[iAxis]<h->GetAxis(iAxis)->GetXmin()) return kFALSE;
+ }
+ }
h->Fill(values);
return kTRUE;
} else {