]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Minor fixes
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Nov 2013 15:55:21 +0000 (15:55 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Nov 2013 15:55:21 +0000 (15:55 +0000)
PWGLF/FORWARD/analysis2/scripts/SummaryAODDrawer.C
PWGLF/FORWARD/analysis2/scripts/SummaryDrawer.C
PWGLF/FORWARD/analysis2/scripts/SummaryMultDistsDrawer.C
PWGLF/FORWARD/analysis2/scripts/SummaryUnfoldedDrawer.C
PWGLF/FORWARD/analysis2/scripts/UnfoldMultDists.C

index abb8691552c59ec695f9f63c851f53f91a023460..bb9adc5ea81076d7a06959044cb2f7c19afc367b 100644 (file)
@@ -52,7 +52,11 @@ public:
 
     // --- Get top-level collection ----------------------------------
     fSums = GetCollection(file, "ForwardSums");
-    if (!fSums) return;
+    if (!fSums) {
+      Info("Run", "Trying old name Forward");
+      fSums = GetCollection(file, "Forward");
+      if (!fSums) return;
+    }
 
     // --- Do the results ----------------------------------------------
     fResults = GetCollection(file, "ForwardResults");
@@ -65,7 +69,10 @@ public:
     DrawTitlePage(file);
 
     // --- Possibly make a chapter here ------------------------------
-    if (what & kCentral && GetCollection(file, "CentralSums")) 
+    TCollection* centralSums = GetCollection(file, "CentralSums", false);
+    if (!centralSums) 
+      centralSums = GetCollection(file, "Central", false);
+    if (what & kCentral && centralSums) 
       MakeChapter("Forward");
     
     // --- Set pause flag --------------------------------------------
@@ -114,7 +121,7 @@ protected:
     ltx->SetTextAlign(22);
     ltx->Draw();
 
-    TCollection* fwd = GetCollection(f, "ForwardSums");
+    TCollection* fwd = fSums; // GetCollection(f, "ForwardSums");
     TCollection* cen = GetCollection(f, "CentralSums");
     Double_t y = .6;
     
index 6b8b4b998b06c75490431d6f3db7df237ae1814d..12005fa238267263a220c15caafaf485bb697095 100644 (file)
@@ -59,7 +59,8 @@ public:
     kLegend = 0x10, 
     kGridx  = 0x100, 
     kGridy  = 0x200, 
-    kGridz  = 0x400
+    kGridz  = 0x400,
+    kSilent = 0x800
   };
   enum { 
     kLandscape         = 0x100, 
@@ -737,6 +738,24 @@ protected:
     // THStack* tmp = static_cast<THStack*>(o->Clone());
     o->Draw(options);
     if (title && title[0] != '\0') o->GetHistogram()->SetTitle(title);
+    TAxis*   xAxis = o->GetXaxis();
+    TH1*     h     = 0;
+    Int_t    nBins = xAxis->GetNbins();
+    Double_t xMin  = xAxis->GetXmin();
+    Double_t xMax  = xAxis->GetXmax();
+    TIter  next(o->GetHists());
+    while ((h = static_cast<TH1*>(next()))) {
+      TAxis* a = h->GetXaxis();
+      nBins    = TMath::Max(nBins, a->GetNbins()); 
+      xMin     = TMath::Min(xMin, a->GetXmin());
+      xMax     = TMath::Max(xMax, a->GetXmax());
+    }
+    if (nBins != xAxis->GetNbins() || 
+       xMin  != xAxis->GetXmin() || 
+       xMax  != xAxis->GetXmax()) {
+      xAxis->Set(nBins, xMin, xMax);
+      o->GetHistogram()->Rebuild();
+    }
   }
   /** 
    * Draw an object clone 
@@ -784,7 +803,8 @@ protected:
     if (o.Contains("colz", TString::kIgnoreCase)) 
       p->SetRightMargin(0.15);
     if (!h) {
-      Warning("DrawInPad", "Nothing to draw in pad # %s", p->GetName());
+      if (!(flags & kSilent))
+       Warning("DrawInPad", "Nothing to draw in pad # %s", p->GetName());
       return;
     }
     if (o.Contains("text", TString::kIgnoreCase)) {
index 6209d294c2bba1c44b6b52c17a4740d2f9b0714c..a255ba0aabe9826a78f11c989ac704c8105fca6a 100644 (file)
@@ -109,11 +109,13 @@ protected:
 
       fBody->Divide(2,2);
       DrawInPad(fBody, 1, GetH1(bin, "rawDist"), "",          kLogy);
-      DrawInPad(fBody, 1, GetH1(bin, "truthAccepted",false),"same", kLogy);
-      DrawInPad(fBody, 1, GetH1(bin, "truth",false),   "same", kLogy|kLegend);
+      DrawInPad(fBody, 1, GetH1(bin, "truthAccepted",false),"same", 
+               kLogy|kSilent);
+      DrawInPad(fBody, 1, GetH1(bin, "truth",false),   "same", 
+               kLogy|kLegend|kSilent);
       DrawInPad(fBody, 2, GetH1(bin, "coverage"));
       DrawInPad(fBody, 3, GetH2(bin, "corr"),     "colz");
-      DrawInPad(fBody, 4, GetH2(bin, "response",false), "colz", kLogz);
+      DrawInPad(fBody, 4, GetH2(bin, "response",false), "colz",kLogz|kSilent);
       
       PrintCanvas(Form("%+5.1f < #eta < %+5.1f", etaMin, etaMax));
     }
@@ -170,12 +172,13 @@ protected:
 
       fBody->Divide(2,3);
       DrawInPad(fBody, 1, GetH1(bin, "rawDist"),      "",     kLogy);
-      DrawInPad(fBody, 1, GetH1(bin, "truthAccepted", false),"same", kLogy);
-      DrawInPad(fBody, 1, GetH1(bin, "truth", false),"same", kLogy|kLegend);
+      DrawInPad(fBody, 1, GetH1(bin, "truthAccepted", false),
+               "same", kSilent);
+      DrawInPad(fBody, 1, GetH1(bin, "truth", false),"same", kSilent|kLegend);
       DrawInPad(fBody, 2, GetH1(bin, "coverage"));
       DrawInPad(fBody, 3, GetH2(bin, "corr"),            "colz");
-      DrawInPad(fBody, 4, GetH2(bin, "response", false), "colz", kLogz);
-      DrawInPad(fBody, 5, GetH1(bin, "triggerVertex"));
+      DrawInPad(fBody, 4, GetH2(bin, "response", false), "colz", kLogz|kSilent);
+      DrawInPad(fBody, 5, GetH1(bin, "triggerVertex", false), "", kSilent);
       
       PrintCanvas(Form("%+5.1f < #eta < %+5.1f", etaMin, etaMax));
     }
index 73f1f931f924a0c75f9dfecb8da487f0e8f1be8e..f520a7d4676840685856428daf2aea02e25bf52a 100644 (file)
@@ -138,6 +138,10 @@ struct SummaryUnfoldedDrawer : public SummaryDrawer
   void DrawResults(TDirectory* d) 
   { 
     THStack* c = GetStack(d, "corrected");
+    if (!c) {
+      Warning("DrawResults", "Stack of corrected results not found!");
+      return;
+    }
     DrawInPad(fBody, 0, c, "nostack", kLogy);
     c->GetXaxis()->SetTitle("#it{N}_{ch}");
     c->GetYaxis()->SetTitle("P(#it{N}_{ch})");
@@ -194,6 +198,7 @@ struct SummaryUnfoldedDrawer : public SummaryDrawer
        e->SetFillStyle(1001);
       }
       l->Draw();
+      if (s->GetMinimum() > -1) s->SetMinimum(-1);
       
       PrintCanvas("  Ratios");
     }
index 7d60d7d085f93b7b9444e6c984077ca074325b3d..24b87ccf6073eb0d4bbc62b50ae102e82baab346 100644 (file)
@@ -609,7 +609,7 @@ struct Unfolder
   {
     Printf("   Processing %s ...", measured->GetName());
     // Try to get the data 
-    TH1* inRaw    = GetH1(measured, "rawDist");
+    TH1* inRaw    = GetH1(measured,    "rawDist");
     TH1* inTruth  = GetH1(corrections, "truth");
     TH1* inTruthA = GetH1(corrections, "truthAccepted");
     TH1* inTrgVtx = GetH1(corrections, "triggerVertex");
@@ -635,7 +635,7 @@ struct Unfolder
     Double_t             r        = regParam;
     RooUnfold::Algorithm algo     = (RooUnfold::Algorithm)method;
     RooUnfold*           unfolder = RooUnfold::New(algo, &matrix, inRaw, r);
-    unfolder->SetVerbose(1);
+    unfolder->SetVerbose(0);
 
     // Do the unfolding and get the result
     TH1* res = unfolder->Hreco();
@@ -883,9 +883,12 @@ struct Unfolder
     Double_t eta2 = static_cast<TObjString*>(tokens->At(1))->String().Atof();
     tokens->Delete();
     
-    if (TMath::Abs(eta2-eta1) > 1e3) 
+    if (TMath::Abs(eta2+eta1) > 1e-3) {
       // Not symmetric bin 
+      // Info("Other2Stack", "bin [%f,%f] is not symmetric (%f)",
+      //      eta1, eta2, TMath::Abs(eta2-eta1));
       return;
+    }
     Double_t aEta = TMath::Abs(eta1);
 
     Int_t open, closed;