Fix for MixInfo Histogram to show correctly values in first bin.
authormvala <mvala@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Feb 2011 13:21:04 +0000 (13:21 +0000)
committermvala <mvala@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Feb 2011 13:21:04 +0000 (13:21 +0000)
ANALYSIS/EventMixing/AliMixEventPool.cxx
ANALYSIS/EventMixing/AliMixEventPool.h
ANALYSIS/EventMixing/AliMixInfo.cxx

index 9052a79..8769515 100644 (file)
@@ -238,11 +238,12 @@ void AliMixEventPool::SearchIndexRecursive(Int_t num, Int_t *i, Int_t *d, Int_t
 }
 
 //_________________________________________________________________________________________________
-void AliMixEventPool::SetCutValuesFromBinIndex(Int_t index)
+Bool_t AliMixEventPool::SetCutValuesFromBinIndex(Int_t index)
 {
    //
    // Sets cut value from bin index
    //
+
    Int_t numCuts = fListOfEventCuts.GetEntriesFast();
    Int_t *lenght = new Int_t[numCuts];
    Int_t *indexes = new Int_t[numCuts];
@@ -258,10 +259,10 @@ void AliMixEventPool::SetCutValuesFromBinIndex(Int_t index)
    }
 
    if (index < 0 || index >= timesNum) {
-      AliError(Form("index=%d is out of range !!!", index));
+//       AliError(Form("index=%d is out of range !!!", index));
       delete [] lenght;
       delete [] indexes;
-      return;
+      return kFALSE;
    }
 
    Long64_t indexNum = index;
@@ -285,4 +286,6 @@ void AliMixEventPool::SetCutValuesFromBinIndex(Int_t index)
 
    delete [] lenght;
    delete [] indexes;
+
+   return kTRUE;
 }
index 4caec6c..54c6197 100644 (file)
@@ -43,7 +43,7 @@ public:
    TObjArray  *GetListOfEntryLists() { return &fListOfEntryList; }
    TObjArray  *GetListOfEventCuts() { return &fListOfEventCuts; }
 
-   void        SetCutValuesFromBinIndex(Int_t index);
+   Bool_t      SetCutValuesFromBinIndex(Int_t index);
    void        SetBufferSize(Int_t buffer) { fBufferSize = buffer; }
    void        SetMixNumber(Int_t numMix) { fMixNumber = numMix; }
    Int_t       GetBufferSize() const { return fBufferSize; }
index 5b93668..6d6930a 100644 (file)
@@ -319,24 +319,25 @@ void AliMixInfo::DynamicExec(AliMixInfo *const mixInfo)
 
    Int_t mixNum = 1;
    if (text) {
-      text->SetName("mixInfoText");
-      text->SetTextAlign(12);
-      text->SetToolTipText("Mixing Info about current binX");
-//         text->SetTextSize(0.1);
-//         text->SetTextColor(3);
-      text->SetBorderSize(2);
-      text->AddText(Form("binX=%d", binX));
-      text->AddText(Form("numMain=%.0f", numMain));
-      text->AddText(Form("numMix=%.0f", numMix));
-      text->AddText(Form("BINCONTENT=%d", hist2DValue));
+
 
       if (mixInfo) {
 
          AliMixEventPool *evPool = (AliMixEventPool *) mixInfo->GetEventPool("mixEventPool");
          if (evPool) {
             mixNum = evPool->GetMixNumber();
-            if (binX - 1 > 0)
-               evPool->SetCutValuesFromBinIndex(binX - 1);
+            if (binX - 1 >= 0) {
+               if (!evPool->SetCutValuesFromBinIndex(binX - 1)) return;
+
+            }
+            text->SetName("mixInfoText");
+            text->SetTextAlign(12);
+            text->SetToolTipText("Mixing Info about current binX");
+            text->SetBorderSize(2);
+            text->AddText(Form("binX=%d", binX));
+            text->AddText(Form("numMain=%.0f", numMain));
+            text->AddText(Form("numMix=%.0f", numMix));
+            text->AddText(Form("BINCONTENT=%d", hist2DValue));
             TObjArray *eventCuts = evPool->GetListOfEventCuts();
             if (eventCuts) {