]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Minor fixes
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Nov 2010 21:52:09 +0000 (21:52 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Nov 2010 21:52:09 +0000 (21:52 +0000)
PWG2/FORWARD/analysis2/DrawRes.C
PWG2/FORWARD/analysis2/Pass1.C
PWG2/FORWARD/analysis2/Pass2.C

index 0af8d481389392db41abbeabc0df8e08562708b6..359f98da92b51cf4713f3e94fd3f92514733a56e 100644 (file)
@@ -50,6 +50,8 @@ public:
   Double_t           fVtxEff;
   /** Title to put on the plot */
   TString            fTitle;
+  /** Do HHD comparison */
+  Bool_t             fDoHHD;
 
   //__________________________________________________________________
   /** 
@@ -62,7 +64,8 @@ public:
       fOut(0), 
       fSum(0),
       fVtxEff(0),
-      fTitle("")
+      fTitle(""),
+      fDoHHD(kTRUE)
   {}
   //__________________________________________________________________
   /** 
@@ -103,7 +106,7 @@ public:
   Bool_t Run(const char* file="AliAODs.root", 
             Double_t vzMin=-10, Double_t vzMax=10, Int_t rebin=1,
             Int_t mask=AliAODForwardMult::kInel, Int_t energy=900,
-            const char* title="")
+            const char* title="", Bool_t doHHD=false, Bool_t doComp=false)
   {
     TString trgName;
     if    (mask & AliAODForwardMult::kInel)    trgName.Append("inel-");
@@ -120,7 +123,7 @@ public:
     fTitle = title;
     if (!Open(file, outName)) return kFALSE;
     if (!Process(vzMin,vzMax,mask)) return kFALSE;
-    if (!Finish(rebin, mask, energy)) return kFALSE;
+    if (!Finish(rebin, mask, energy,doHHD,doComp)) return kFALSE;
 
     return kTRUE;
   }
@@ -235,7 +238,8 @@ public:
    * 
    * @return true on success, false otherwise 
    */
-  Bool_t Finish(Int_t rebin, Int_t mask, Int_t energy)
+  Bool_t Finish(Int_t rebin, Int_t mask, Int_t energy, 
+               Bool_t doHHD, Bool_t doComp)
   {
     fOut->cd();
 
@@ -253,14 +257,15 @@ public:
     dndeta->SetMarkerSize(1);
     dndeta->SetFillStyle(0);
     Rebin(dndeta, rebin);
-    DrawIt(dndeta, mask, energy);
+    DrawIt(dndeta, mask, energy, doHHD, doComp);
 
     return kTRUE;
   }
   //__________________________________________________________________
   /** 
    */
-  void DrawIt(TH1* dndeta, Int_t mask, Int_t energy)
+  void DrawIt(TH1* dndeta, Int_t mask, Int_t energy, 
+             Bool_t doHHD, Bool_t doComp)
   {
     // --- 1st part - prepare data -----------------------------------
     TH1* sym = Symmetrice(dndeta);
@@ -271,20 +276,28 @@ public:
     stack->Add(sym);
 
     // Get the data from HHD's analysis - if available 
-    TString hhdName(fOut->GetName());
-    hhdName.ReplaceAll("dndeta", "hhd");    
-    TH1* hhd    = GetHHD(hhdName.Data(), mask & AliAODForwardMult::kNSD);
+    TH1* hhd    = 0;
     TH1* hhdsym = 0;
-    if (hhd) { 
-      // Symmetrice and add to stack 
-      hhdsym = Symmetrice(hhd);
-      stack->Add(hhd);
-      stack->Add(hhdsym);
+    Info("DrawIt", "Will %sdraw HHD results", (doHHD ? "" : "not "));
+    if (doHHD) {
+      TString hhdName(fOut->GetName());
+      hhdName.ReplaceAll("dndeta", "hhd");    
+      hhd    = GetHHD(hhdName.Data(), mask & AliAODForwardMult::kNSD);
+      hhdsym = 0;
+      if (hhd) { 
+       // Symmetrice and add to stack 
+       hhdsym = Symmetrice(hhd);
+       stack->Add(hhd);
+       stack->Add(hhdsym);
+      }
+      else 
+       Warning("DrawIt", "No HHD data found");
     }
 
     // Get graph of 'other' data - e.g., UA5, CMS, ... - and check if
     // there's any graphs.  Set the pad division based on that.
-    TMultiGraph* other    = GetData(energy, mask);
+    Info("DrawIt", "Will %sdraw other results", (doComp ? "" : "not "));
+    TMultiGraph* other    = (doComp ? GetData(energy, mask) : 0);
     THStack*     ratios   = MakeRatios(dndeta, sym, hhd, hhdsym, other);
 
     // Check if we have ratios 
@@ -292,6 +305,8 @@ public:
     // --- 2nd part - Draw in canvas ---------------------------------
     // Make a canvas 
     gStyle->SetOptTitle(0);
+    gStyle->SetTitleFont(132, "xyz");
+    gStyle->SetLabelFont(132, "xyz");
     TCanvas* c = new TCanvas("c", "C", 900, 800);
     c->SetFillColor(0);
     c->SetBorderMode(0);
@@ -332,28 +347,32 @@ public:
     l->SetFillColor(0);
     l->SetFillStyle(0);
     l->SetBorderSize(0);
+    l->SetTextFont(132);
     p1->cd();
 
     // Put a title on top 
     TLatex* tit = new TLatex(0.10, 0.95, fTitle.Data());
     tit->SetNDC();
+    tit->SetTextFont(132);
     tit->SetTextSize(0.05);
     tit->Draw();
 
     // Put a nice label in the plot 
-    TLatex* tt = new TLatex(.5, .50
+    TLatex* tt = new TLatex(.93, .93
                            Form("#sqrt{s}=%dGeV, %s", energy,
                                 AliAODForwardMult::GetTriggerString(mask)));
     tt->SetNDC();
-    tt->SetTextAlign(22);
+    tt->SetTextFont(132);
+    tt->SetTextAlign(33);
     tt->Draw();
 
     // Mark the plot as preliminary 
-    TLatex* pt = new TLatex(.5, .42, "Preliminary");
+    TLatex* pt = new TLatex(.93, .88, "Preliminary");
     pt->SetNDC();
+    pt->SetTextFont(22);
     pt->SetTextSize(0.07);
     pt->SetTextColor(kRed+1);
-    pt->SetTextAlign(22);
+    pt->SetTextAlign(33);
     pt->Draw();
     c->cd();
 
@@ -391,7 +410,8 @@ public:
       l2->SetFillColor(0);
       l2->SetFillStyle(0);
       l2->SetBorderSize(0);
-      
+      l2->SetTextFont(132);
+
       // Make a nice band from 0.9 to 1.1 
       TGraphErrors* band = new TGraphErrors(2);
       band->SetPoint(0, sym->GetXaxis()->GetXmin(), 1);
@@ -412,6 +432,8 @@ public:
     TString imgName(fOut->GetName());
     imgName.ReplaceAll(".root", ".png");
     c->SaveAs(imgName.Data());
+    imgName.ReplaceAll(".png", ".C");
+    c->SaveAs(imgName.Data());
 
     stack->Write();
     if (other)  other->Write();
index 34bf28988d8c59494810050f5690551d9d63ee00..05a432eba05ed38124d59997c43f6a9ab001122e 100644 (file)
@@ -9,7 +9,7 @@
  * @ingroup pwg2_forward_analysis_scripts
  */
 void
-Pass1(const char* file="AliESDs.root", 
+Pass1(const char* esddir=".", 
       Int_t       nEvents=1000, 
       Int_t       nCutBins=1, 
       Int_t       correctionCut=0.1,
@@ -17,7 +17,7 @@ Pass1(const char* file="AliESDs.root",
 {
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/RunManager.C"); 
 
-  RunManager(file, kFALSE, nEvents, nCutBins, correctionCut, proof);
+  RunManager(esddir, kFALSE, nEvents, nCutBins, correctionCut, proof);
 }
 //
 // EOF
index 14fc2d2d81f01c667b3871c27030293720014d36..694b697bd711f3e57e20b8ada0838482642fc1d0 100644 (file)
@@ -19,7 +19,9 @@ Pass2(const char* file="AliAODs.root",
       Double_t    vzMin=-10, 
       Double_t    vzMax=10, 
       Int_t       rebin=5, 
-      const char* title="")
+      const char* title="",
+      bool        hhd=false,
+      bool        comp=true)
 {
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/Compile.C"); 
   Compile("$ALICE_ROOT/PWG2/FORWARD/analysis2/DrawRes.C","g"); 
@@ -51,13 +53,16 @@ Pass2(const char* file="AliAODs.root",
         "  Trigger mask: 0x%02x (%s)\n"
         "  Energy:       %dGeV\n"
         "  Title:        %s\n"
+        "  HHD comp.:    %s\n"
+        "  Other comp.:  %s\n"
          "--------------------------------------\n",
-        file, vzMin, vzMax, rebin, trgMask, trgs.Data(), energy, title);
+        file, vzMin, vzMax, rebin, trgMask, trgs.Data(), energy, title,
+        hhd ? "yes" : "no", comp ? "yes" : "no");
   
   DrawRes dr;
   TStopwatch t;
   t.Start();
-  dr.Run(file, vzMin, vzMax, rebin, trgMask, energy, title);
+  dr.Run(file, vzMin, vzMax, rebin, trgMask, energy, title, hhd, comp);
   t.Stop();
   t.Print();  
 }