//_____________________________________________________________________________
AliRsnPairNtuple::AliRsnPairNtuple(const char *name, AliRsnPairDef *def) :
- AliRsnPair(name, def),
- fValues("AliRsnValue", 0),
- fNtuple(0x0)
+ AliRsnPair(name, def),
+ fValues("AliRsnValue", 0),
+ fNtuple(0x0)
{
//
// Default constructor
//
- AliDebug(AliLog::kDebug+2,"<-");
- AliDebug(AliLog::kDebug+2,"->");
+ AliDebug(AliLog::kDebug + 2, "<-");
+ AliDebug(AliLog::kDebug + 2, "->");
}
//_____________________________________________________________________________
AliRsnPairNtuple::AliRsnPairNtuple(const AliRsnPairNtuple& copy) :
- AliRsnPair(copy),
- fValues(copy.fValues),
- fNtuple(copy.fNtuple)
+ AliRsnPair(copy),
+ fValues(copy.fValues),
+ fNtuple(copy.fNtuple)
{
//
// Default constructor
//
- AliDebug(AliLog::kDebug+2,"<-");
- AliDebug(AliLog::kDebug+2,"->");
+ AliDebug(AliLog::kDebug + 2, "<-");
+ AliDebug(AliLog::kDebug + 2, "->");
}
//_____________________________________________________________________________
AliRsnPairNtuple& AliRsnPairNtuple::operator=(const AliRsnPairNtuple& copy)
{
- AliRsnPair::operator=(copy);
-
- Int_t i, n = copy.fValues.GetEntries();
- for (i = 0; i < n; i++)
- {
- AliRsnValue *fcn = (AliRsnValue*)copy.fValues[i];
- if (fcn) AddValue(fcn);
- }
-
- fNtuple = copy.fNtuple;
-
- return (*this);
+ AliRsnPair::operator=(copy);
+
+ Int_t i, n = copy.fValues.GetEntries();
+ for (i = 0; i < n; i++) {
+ AliRsnValue *fcn = (AliRsnValue*)copy.fValues[i];
+ if (fcn) AddValue(fcn);
+ }
+
+ fNtuple = copy.fNtuple;
+
+ return (*this);
}
//_____________________________________________________________________________
// Destructor
//
- AliDebug(AliLog::kDebug+2,"<-");
- AliDebug(AliLog::kDebug+2,"->");
+ AliDebug(AliLog::kDebug + 2, "<-");
+ AliDebug(AliLog::kDebug + 2, "->");
}
//_____________________________________________________________________________
// and then fill the list of required values using it.
//
- AliDebug(AliLog::kDebug+2,"<-");
-
- // compute all values
- Int_t i, n = fValues.GetEntries();
- TArrayF values(n);
- AliRsnValue *value = 0x0;
- Bool_t computeOK = kFALSE;
- for (i = 0; i < n; i++)
- {
- values[i] = -1E10;
- value = (AliRsnValue*)fValues[i];
- switch (value->GetTargetType())
- {
- case AliRsnTarget::kMother:
- value->SetSupportObject(fPairDef);
- computeOK = value->Eval(&fMother);
- break;
- case AliRsnTarget::kEvent:
- computeOK = value->Eval(AliRsnTarget::GetCurrentEvent());
- break;
- default:
- AliError(Form("Allowed targets are mothers and events; cannot use axis '%s' which has target '%s'", value->GetName(), value->GetTargetTypeName()));
- computeOK = kFALSE;
- }
- if (computeOK) values[i] = ((Float_t)value->GetComputedValue());
- }
-
- fNtuple->Fill(values.GetArray());
-
- AliDebug(AliLog::kDebug+2,"->");
+ AliDebug(AliLog::kDebug + 2, "<-");
+
+ // compute all values
+ Int_t i, n = fValues.GetEntries();
+ TArrayF values(n);
+ AliRsnValue *value = 0x0;
+ Bool_t computeOK = kFALSE;
+ for (i = 0; i < n; i++) {
+ values[i] = -1E10;
+ value = (AliRsnValue*)fValues[i];
+ switch (value->GetTargetType()) {
+ case AliRsnTarget::kMother:
+ value->SetSupportObject(fPairDef);
+ computeOK = value->Eval(&fMother);
+ break;
+ case AliRsnTarget::kEvent:
+ computeOK = value->Eval(AliRsnTarget::GetCurrentEvent());
+ break;
+ default:
+ AliError(Form("Allowed targets are mothers and events; cannot use axis '%s' which has target '%s'", value->GetName(), value->GetTargetTypeName()));
+ computeOK = kFALSE;
+ }
+ if (computeOK) values[i] = ((Float_t)value->GetComputedValue());
+ }
+
+ fNtuple->Fill(values.GetArray());
+
+ AliDebug(AliLog::kDebug + 2, "->");
}
//_____________________________________________________________________________
// All generated histograms are stored into the output TList.
//
- AliDebug(AliLog::kDebug+2,"<-");
-
- TString nameList("");
-
- Int_t i, n = fValues.GetEntries();
- AliRsnValue *val = 0;
- for (i = 0; i < n; i++)
- {
- val = (AliRsnValue*)fValues.At(i);
- nameList += val->GetName();
- if (i < n - 1) nameList += ':';
- }
-
- if (fNtuple) delete fNtuple;
- fNtuple = new TNtuple(Form("%sntp%s", prefix, GetName()), "", nameList.Data());
- if (list) list->Add(fNtuple);
-
- AliDebug(AliLog::kDebug+2,"->");
+ AliDebug(AliLog::kDebug + 2, "<-");
+
+ TString nameList("");
+
+ Int_t i, n = fValues.GetEntries();
+ AliRsnValue *val = 0;
+ for (i = 0; i < n; i++) {
+ val = (AliRsnValue*)fValues.At(i);
+ nameList += val->GetName();
+ if (i < n - 1) nameList += ':';
+ }
+
+ if (fNtuple) delete fNtuple;
+ fNtuple = new TNtuple(Form("%sntp%s", prefix, GetName()), "", nameList.Data());
+ if (list) list->Add(fNtuple);
+
+ AliDebug(AliLog::kDebug + 2, "->");
}
//_____________________________________________________________________________
// Adds a new computing function.
//
- RSNTARGET target = val->GetTargetType();
- if (target != AliRsnTarget::kMother && target != AliRsnTarget::kEvent)
- {
- AliError(Form("Allowed targets are mothers and events; cannot use axis '%s' which has target '%s'", val->GetName(), val->GetTargetTypeName()));
- return kFALSE;
- }
-
- Int_t size = fValues.GetEntries();
- new (fValues[size]) AliRsnValue(*val);
-
- return kTRUE;
+ RSNTARGET target = val->GetTargetType();
+ if (target != AliRsnTarget::kMother && target != AliRsnTarget::kEvent) {
+ AliError(Form("Allowed targets are mothers and events; cannot use axis '%s' which has target '%s'", val->GetName(), val->GetTargetTypeName()));
+ return kFALSE;
+ }
+
+ Int_t size = fValues.GetEntries();
+ new(fValues[size]) AliRsnValue(*val);
+
+ return kTRUE;
}