]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
refresh random seed on each node
authorrbertens <rbertens@cern.ch>
Thu, 24 Apr 2014 16:35:20 +0000 (18:35 +0200)
committerrbertens <rbertens@cern.ch>
Thu, 24 Apr 2014 16:35:37 +0000 (18:35 +0200)
PWG/FLOW/Tasks/AliAnalysisTaskJetFlowMC.cxx
PWG/FLOW/Tasks/AliJetFlowTools.cxx
PWG/FLOW/Tasks/AliJetFlowTools.h

index 513fd1594603c0bcbdb3fef30c4e2edd3e5283d8..5b56e66c445f377b129017d2c4f93d7dd1a62a5e 100644 (file)
@@ -8,6 +8,7 @@
 #include "TList.h"
 #include "TClonesArray.h"
 #include "TArrayI.h"
+#include "TRandom3.h"
 // aliroot includes
 #include "AliAODEvent.h"
 #include "AliAnalysisManager.h"
@@ -123,6 +124,12 @@ void AliAnalysisTaskJetFlowMC::UserCreateOutputObjects()
         fHistSFJetSpectrum = BookTH1F("fHistSFJetSpectrum", "p_{t} SF jets [GeV/c]", 100, 0, 200);
         fHistSFJetEtaPhi = BookTH2F("fHistSFJetEtaPhi", "#eta", "#varphi", 100, -1., 1., 100, 0, TMath::TwoPi());
     }
+    // reset the random seed
+    if(gRandom) {
+        delete gRandom;
+        gRandom = new TRandom3(0);
+    }
+
     fOutputList->Sort();
     PostData(1, fOutputList);
 }
index 8dee14f5348ad3907983153f651ebc37dc3f8b34..a4a1fc5127d718fb20fd46f6e0d71cf46a392f67 100644 (file)
@@ -229,8 +229,8 @@ void AliJetFlowTools::Make() {
         TString("in"),
         jetFindingEfficiency);
     resizedResponseIn->SetNameTitle("ResponseMatrixIn", "response matrix in plane");
-    resizedResponseIn->SetXTitle("p_{T, jet}^{true} [GeV/c]");
-    resizedResponseIn->SetYTitle("p_{T, jet}^{rec} [GeV/c]");
+    resizedResponseIn->SetXTitle("p_{T, jet}^{true} (GeV/#it{c})");
+    resizedResponseIn->SetYTitle("p_{T, jet}^{rec} (GeV/#it{c})");
     resizedResponseIn = ProtectHeap(resizedResponseIn);
     resizedResponseIn->Write();
     kinematicEfficiencyIn->SetNameTitle("KinematicEfficiencyIn","Kinematic efficiency, in plane");
@@ -263,8 +263,8 @@ void AliJetFlowTools::Make() {
                     TString("out"),
                     jetFindingEfficiency);
         resizedResponseOut->SetNameTitle("ResponseMatrixOut", "response matrix in plane");
-        resizedResponseOut->SetXTitle("p_{T, jet}^{true} [GeV/c]");
-        resizedResponseOut->SetYTitle("p_{T, jet}^{rec} [GeV/c]");
+        resizedResponseOut->SetXTitle("p_{T, jet}^{true} (GeV/#it{c})");
+        resizedResponseOut->SetYTitle("p_{T, jet}^{rec} (GeV/#it{c})");
         resizedResponseOut = ProtectHeap(resizedResponseOut);
         resizedResponseOut->Write();
         kinematicEfficiencyOut->SetNameTitle("KinematicEfficiencyOut","Kinematic efficiency, Out plane");
@@ -1319,24 +1319,59 @@ TH1D* AliJetFlowTools::SmoothenPrior(TH1D* spectrum, TF1* function, Double_t min
     return temp;
 }
 //_____________________________________________________________________________
-void AliJetFlowTools::Style(
+void AliJetFlowTools::Style(Bool_t legacy)
 {
     // set global style for your current aliroot session
     if(!gStyle) return;
-    gStyle->SetCanvasColor(-1); 
-    gStyle->SetPadColor(-1); 
-    gStyle->SetFrameFillColor(-1); 
-    gStyle->SetHistFillColor(-1); 
-    gStyle->SetTitleFillColor(-1); 
-    gStyle->SetFillColor(-1); 
-    gStyle->SetFillStyle(4000); 
-    gStyle->SetStatStyle(0); 
-    gStyle->SetTitleStyle(0); 
-    gStyle->SetCanvasBorderSize(0); 
-    gStyle->SetFrameBorderSize(0); 
-    gStyle->SetLegendBorderSize(0); 
-    gStyle->SetStatBorderSize(0); 
-    gStyle->SetTitleBorderSize(0);
+    // legacy style is pleasing to the eye, default is the formal ALICE style
+    if(legacy) {
+        gStyle->SetCanvasColor(-1); 
+        gStyle->SetPadColor(-1); 
+        gStyle->SetFrameFillColor(-1); 
+        gStyle->SetHistFillColor(-1); 
+        gStyle->SetTitleFillColor(-1); 
+        gStyle->SetFillColor(-1); 
+        gStyle->SetFillStyle(4000); 
+        gStyle->SetStatStyle(0); 
+        gStyle->SetTitleStyle(0); 
+        gStyle->SetCanvasBorderSize(0); 
+        gStyle->SetFrameBorderSize(0); 
+        gStyle->SetLegendBorderSize(0); 
+        gStyle->SetStatBorderSize(0); 
+        gStyle->SetTitleBorderSize(0);
+    } else {
+        gStyle->Reset("Plain");
+        gStyle->SetOptTitle(0);
+        gStyle->SetOptStat(0);
+        gStyle->SetPalette(1);
+        gStyle->SetCanvasColor(10);
+        gStyle->SetCanvasBorderMode(0);
+        gStyle->SetFrameLineWidth(1);
+        gStyle->SetFrameFillColor(kWhite);
+        gStyle->SetPadColor(10);
+        gStyle->SetPadTickX(1);
+        gStyle->SetPadTickY(1);
+        gStyle->SetPadBottomMargin(0.15);
+        gStyle->SetPadLeftMargin(0.15);
+        gStyle->SetHistLineWidth(1);
+        gStyle->SetHistLineColor(kRed);
+        gStyle->SetFuncWidth(2);
+        gStyle->SetFuncColor(kGreen);
+        gStyle->SetLineWidth(2);
+        gStyle->SetLabelSize(0.045,"xyz");
+        gStyle->SetLabelOffset(0.01,"y");
+        gStyle->SetLabelOffset(0.01,"x");
+        gStyle->SetLabelColor(kBlack,"xyz");
+        gStyle->SetTitleSize(0.05,"xyz");
+        gStyle->SetTitleOffset(1.25,"y");
+        gStyle->SetTitleOffset(1.2,"x");
+        gStyle->SetTitleFillColor(kWhite);
+        gStyle->SetTextSizePixels(26);
+        gStyle->SetTextFont(42);
+        gStyle->SetLegendBorderSize(0);
+        gStyle->SetLegendFillColor(kWhite);
+        gStyle->SetLegendFont(42);
+    }
 }
 //_____________________________________________________________________________
 void AliJetFlowTools::Style(TCanvas* c, TString style)
@@ -1360,11 +1395,15 @@ void AliJetFlowTools::Style(TCanvas* c, TString style)
     } else printf(" > Style called with unknown option %s \n    returning < \n", style.Data());
 }
 //_____________________________________________________________________________
-void AliJetFlowTools::Style(TVirtualPad* c, TString style)
+void AliJetFlowTools::Style(TVirtualPad* c, TString style, Bool_t legacy)
 {
-    // set a default style for a canvas
-    c->SetLeftMargin(.25);
-    c->SetBottomMargin(.25);
+    // set a default style for a canva
+    
+    if(legacy) {
+        c->SetLeftMargin(.25);
+        c->SetBottomMargin(.25);
+    }
+    else Style();
     if(!strcmp(style.Data(), "PEARSON")) {
         printf(" > style PEARSON pad < \n");
         gStyle->SetOptStat(0);
@@ -1392,78 +1431,81 @@ void AliJetFlowTools::Style(TVirtualPad* c, TString style)
 void AliJetFlowTools::Style(TLegend* l)
 {
     // set a default style for a legend
-//    l->SetTextSize(.06);
     l->SetFillColor(0);
-//    l->SetFillStyle(4050);
     l->SetBorderSize(0);
+    if(gStyle) l->SetTextSize(gStyle->GetTextSize()*.08);
 }
 //_____________________________________________________________________________
-void AliJetFlowTools::Style(TH1* h, EColor col, histoType type)
+void AliJetFlowTools::Style(TH1* h, EColor col, histoType type, Bool_t legacy)
 {
     // style a histo
     h->SetLineColor(col);
     h->SetMarkerColor(col);
-    h->SetLineWidth(2.);
-    h->SetMarkerSize(1.);
-    h->SetTitle("");
-    h->GetYaxis()->SetLabelSize(0.05);
-    h->GetXaxis()->SetLabelSize(0.05);
-    h->GetYaxis()->SetTitleOffset(1.5);
-    h->GetXaxis()->SetTitleOffset(1.5);
-    h->GetYaxis()->SetTitleSize(.05);
-    h->GetXaxis()->SetTitleSize(.05);
+    h->SetLineWidth(2);
+    h->SetMarkerSize(1);
+    if(legacy) {
+        h->SetTitle("");
+        h->GetYaxis()->SetLabelSize(0.05);
+        h->GetXaxis()->SetLabelSize(0.05);
+        h->GetYaxis()->SetTitleOffset(1.5);
+        h->GetXaxis()->SetTitleOffset(1.5);
+        h->GetYaxis()->SetTitleSize(.05);
+        h->GetXaxis()->SetTitleSize(.05);
+    } else Style();
     switch (type) {
         case kInPlaneSpectrum : {
             h->SetTitle("IN PLANE");
-            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} [GeV/#it{c}]");
+            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} (GeV/#it{c})");
             h->GetYaxis()->SetTitle("#frac{d#it{N}}{d#it{p}_{T}}");
         } break;
         case kOutPlaneSpectrum : {
             h->SetTitle("OUT OF PLANE");
             h->GetYaxis()->SetTitle("#frac{d#it{N}}{d#it{p}_{T}}");
-            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} [GeV/#it{c}]");
+            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} (GeV/#it{c})");
        } break;
        case kUnfoldedSpectrum : {
             h->SetTitle("UNFOLDED");
             h->GetYaxis()->SetTitle("#frac{d#it{N}}{d#it{p}_{T}}");
-            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} [GeV/#it{c}]");
+            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} (GeV/#it{c})");
        } break;
        case kFoldedSpectrum : {
             h->SetTitle("FOLDED");
             h->GetYaxis()->SetTitle("#frac{d#it{N}}{d#it{p}_{T}}");
-            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} [GeV/#it{c}]");
+            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} (GeV/#it{c})");
        } break;
        case kMeasuredSpectrum : {
             h->SetTitle("MEASURED");
             h->GetYaxis()->SetTitle("#frac{d#it{N}}{d#it{p}_{T}}");
-            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} [GeV/#it{c}]");
+            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} (GeV/#it{c})");
        } break;
        case kBar : {
             h->SetFillColor(col);
             h->SetBarWidth(.6);
-            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} [GeV/#it{c}]");
+            h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} (GeV/#it{c})");
             h->SetBarOffset(0.2);
        }
        default : break;
     }
 }
 //_____________________________________________________________________________
-void AliJetFlowTools::Style(TGraph* h, EColor col, histoType type)
+void AliJetFlowTools::Style(TGraph* h, EColor col, histoType type, Bool_t legacy)
 {
-    // style a histo
+    // style a tgraph
     h->SetLineColor(col);
     h->SetMarkerColor(col);
-    h->SetLineWidth(2.);
-    h->SetMarkerSize(1.);
+    h->SetLineWidth(2);
+    h->SetMarkerSize(1);
     h->SetTitle("");
     h->SetFillColor(kCyan);
-    h->GetYaxis()->SetLabelSize(0.05);
-    h->GetXaxis()->SetLabelSize(0.05);
-    h->GetYaxis()->SetTitleOffset(1.6);
-    h->GetXaxis()->SetTitleOffset(1.6);
-    h->GetYaxis()->SetTitleSize(.05);
-    h->GetXaxis()->SetTitleSize(.05);
-    h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} [GeV/#it{c}]");
+    if(legacy) {
+        h->GetYaxis()->SetLabelSize(0.05);
+        h->GetXaxis()->SetLabelSize(0.05);
+        h->GetYaxis()->SetTitleOffset(1.6);
+        h->GetXaxis()->SetTitleOffset(1.6);
+        h->GetYaxis()->SetTitleSize(.05);
+        h->GetXaxis()->SetTitleSize(.05);
+    } else Style();
+    h->GetXaxis()->SetTitle("#it{p}_{T}^{ch, jet} (GeV/#it{c})");
     switch (type) {
         case kInPlaneSpectrum : {
             h->SetTitle("IN PLANE");
@@ -1486,10 +1528,12 @@ void AliJetFlowTools::Style(TGraph* h, EColor col, histoType type)
             h->GetYaxis()->SetTitle("#frac{d#it{N}}{d#it{p}_{T}}");
        } break;
        case kRatio : {
-            h->GetYaxis()->SetTitle("#frac{d#it{N_{in plane}^{jet}}}{d#it{p}_{T}} / #frac{d#it{N_{out of plane}^{jet}}}{d#it{p}_{T}}");
+//            h->GetYaxis()->SetTitle("#frac{d#it{N_{in plane}^{jet}}}{d#it{p}_{T}} / #frac{d#it{N_{out of plane}^{jet}}}{d#it{p}_{T}}");
+            h->GetYaxis()->SetTitle("(d#it{N}^{ch, jet}_{in plane}/(d#it{p}_{T}d#eta))/(d#it{N}^{ch,jet}_{out of plane}/(d#it{p}_{T}d#eta))");
        } break;
        case kV2 : {
-            h->GetYaxis()->SetTitle("#it{v}_{2} = #frac{1}{#it{R}} #frac{#pi}{4} #frac{#it{N_{in plane}} - #it{N_{out of plane}}}{#it{N_{in plane}} + #it{N_{out of plane}}}");
+//            h->GetYaxis()->SetTitle("#it{v}_{2} = #frac{1}{#it{R}} #frac{#pi}{4} #frac{#it{N_{in plane}} - #it{N_{out of plane}}}{#it{N_{in plane}} + #it{N_{out of plane}}}");
+            h->GetYaxis()->SetTitle("#it{v}_{2}^{ch, jet}");
             h->GetYaxis()->SetRangeUser(-.5, 1.);
        } break;
        default : break;
@@ -2053,8 +2097,8 @@ void AliJetFlowTools::GetShapeUncertainty(
         if(relativeErrorMethodInLow) dInLow = relativeErrorMethodInLow->GetBinContent(b+1);
         if(relativeErrorMethodOutLow) dOutLow = relativeErrorMethodOutLow->GetBinContent(b+1);
         if(fSymmRMS) {  // take first category as symmetric
-            aInLow = aInUp;
-            aOutLow = aOutUp;
+            aInLow = aInUp*1.5;
+            aOutLow = aOutUp*1.5;
             if(dInLow < dInUp) dInLow = dInUp;
             if(dOutLow < dOutUp) dOutLow = dOutUp;
         }
index 0af2f2ce76b8a6cd9bd0de6812bb0f0db73769ce..6aab1658e723d0df6add9e52e659e3c14359daa4 100644 (file)
@@ -30,6 +30,7 @@ class AliUnfolding;
 #include "TVirtualPad.h"
 #include "TPaveText.h"
 #include "TLegend.h"
+#include "TLatex.h"
 //_____________________________________________________________________________
 class AliJetFlowTools {
     public: 
@@ -222,12 +223,12 @@ class AliJetFlowTools {
         static TH1D*    SmoothenPrior(TH1D* spectrum, TF1* function, Double_t min, Double_t max, Double_t start, Bool_t kill = kTRUE, Bool_t counts = kTRUE);
         // set style
         void            SetTitleFontSize(Double_t s)    {fTitleFontSize = s;}
-        static void     Style();
+        static void     Style(Bool_t legacy = kFALSE);
         static void     Style(TCanvas* c, TString style = "PEARSON");
-        static void     Style(TVirtualPad* c, TString style = "SPECTRUM");
+        static void     Style(TVirtualPad* c, TString style = "SPECTRUM", Bool_t legacy = kFALSE);
         static void     Style(TLegend* l);
-        static void     Style(TH1* h, EColor col = kBlue, histoType = kEmpty);
-        static void     Style(TGraph* h, EColor col = kBlue, histoType = kEmpty);
+        static void     Style(TH1* h, EColor col = kBlue, histoType = kEmpty, Bool_t legacy = kFALSE);
+        static void     Style(TGraph* h, EColor col = kBlue, histoType = kEmpty, Bool_t legacy = kFALSE);
         static TLegend* AddLegend(TVirtualPad* p, Bool_t style = kFALSE) {
             if(!style) return p->BuildLegend(.565, .663, .882, .883);
             else {
@@ -241,7 +242,7 @@ class AliJetFlowTools {
             t->SetFillColor(0);            
             t->SetBorderSize(0);
             t->AddText(0.,0.,text.Data());
-            t->AddText(0., 0., Form("#it{R} = 0.%i #it{k}_{T} charged jets", r));
+            t->AddText(0., 0., Form("#it{R} = 0.%i #it{k}_{T}^{-1} charged jets", r));
             t->SetTextColor(kBlack);
             t->SetTextFont(42);
             t->Draw("same");
@@ -257,6 +258,19 @@ class AliJetFlowTools {
             t->Draw("same");
             return t;
         } 
+        static TLatex*          AddLogo(Bool_t logo, Double_t xmin = .59, Double_t ymax = .81) {
+            return AddTLatex(xmin, ymax, logo ? "ALICE Preliminary" : "ALICE");
+        }
+        static TLatex*          AddSystem() {
+            return AddTLatex(0.55, 87, "Pb-Pb #sqrt{#it{s}}}_{NN} = 2.76 TeV");
+        }
+        static TLatex*          AddTLatex(Double_t xmin, Double_t ymax, TString string) {
+TLatex* tex = new TLatex(xmin, ymax, string.Data());
+            tex->SetNDC();
+            tex->SetTextFont(42);
+            tex->Draw("same");
+            return tex;
+        }
 
         static void     SavePadToPDF(TVirtualPad* pad)  {pad->SaveAs(Form("%s.pdf", pad->GetName()));}
         // interface to AliUnfolding, not necessary but nice to have all parameters in one place