]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnPairNtuple.cxx
Removed old ME classes, since the nex event mixing has been introduced and is integra...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPairNtuple.cxx
index a887d0068de1153f0d222abd34b76c84c1c4048e..cca554ec8c6890a2be6df7512521586ba1733a4c 100644 (file)
@@ -29,47 +29,46 @@ ClassImp(AliRsnPairNtuple)
 
 //_____________________________________________________________________________
 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);
 }
 
 //_____________________________________________________________________________
@@ -79,8 +78,8 @@ AliRsnPairNtuple::~AliRsnPairNtuple()
 // Destructor
 //
 
-  AliDebug(AliLog::kDebug+2,"<-");
-  AliDebug(AliLog::kDebug+2,"->");
+   AliDebug(AliLog::kDebug + 2, "<-");
+   AliDebug(AliLog::kDebug + 2, "->");
 }
 
 //_____________________________________________________________________________
@@ -92,36 +91,34 @@ void AliRsnPairNtuple::Compute()
 // 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, "->");
 }
 
 //_____________________________________________________________________________
@@ -135,24 +132,23 @@ void AliRsnPairNtuple::Init(const char *prefix, TList *list)
 // 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, "->");
 }
 
 //_____________________________________________________________________________
@@ -162,15 +158,14 @@ Bool_t AliRsnPairNtuple::AddValue(AliRsnValue *const val)
 // 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;
 }