updated plots
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Sep 2006 16:05:41 +0000 (16:05 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Sep 2006 16:05:41 +0000 (16:05 +0000)
triggering script for particle composition study
bugfix in AlidNdEtaCorrection::GetMeasuredFraction

PWG0/dNdEta/AlidNdEtaCorrection.cxx
PWG0/dNdEta/AlidNdEtaCorrection.h
PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx
PWG0/dNdEta/AlidNdEtaSystematicsSelector.cxx
PWG0/dNdEta/drawCorrection.C [deleted file]
PWG0/dNdEta/drawPlots.C
PWG0/dNdEta/drawSystematics.C
PWG0/dNdEta/makeSystematics.C
PWG0/dNdEta/runParticleCompositionStudy.sh [new file with mode: 0755]

index b3476c7..7b7f069 100644 (file)
@@ -236,7 +236,7 @@ Float_t AlidNdEtaCorrection::GetMeasuredFraction(Float_t ptCutOff, Float_t eta,
   // find eta borders, if eta is negative assume -0.8 ... 0.8
   Int_t etaBegin = 0;
   Int_t etaEnd = 0;
-  if (eta < 0)
+  if (eta < -99)
   {
     etaBegin = generated->GetYaxis()->FindBin(-0.8);
     etaEnd = generated->GetYaxis()->FindBin(0.8);
@@ -270,6 +270,9 @@ Float_t AlidNdEtaCorrection::GetMeasuredFraction(Float_t ptCutOff, Float_t eta,
   else
     delete ptProj;
 
+  if (debug)
+    printf("AlidNdEtaCorrection::GetMeasuredFraction: pt cut off = %f, eta = %f, => fraction = %f\n", ptCutOff, eta, fraction);
+
   return fraction;
 }
 
index eb17031..fb527b8 100644 (file)
@@ -74,7 +74,7 @@ public:
 
   Float_t GetTriggerBiasCorrection(Float_t eta, Float_t pt=0) {return fTriggerBiasCorrection->GetCorrection(eta, pt);}
 
-  Float_t GetMeasuredFraction(Float_t ptCutOff, Float_t eta = -1, Bool_t debug = kFALSE);
+  Float_t GetMeasuredFraction(Float_t ptCutOff, Float_t eta = -100, Bool_t debug = kFALSE);
 
   //void SetNEvents(Long64_t events) { fNEvents = events; }
 
@@ -88,7 +88,7 @@ protected:
   AliCorrectionMatrix2D* fVertexRecoCorrection;     //-> handles the vertex reconstruction efficiency, function of n_clustersITS and vtx_z
   AliCorrectionMatrix2D* fTriggerCorrection;       //-> handles the trigger efficiency, function of n_clustersITS and vtx_z
 
-  AliCorrectionMatrix2D* fTriggerBiasCorrection;          //-> MB to desired sample
+  AliCorrectionMatrix2D* fTriggerBiasCorrection;          //-> MB to desired sample, obsolete!!!
 
   //Long64_t fNEvents;
   //Long64_t fNTriggeredEvents;
index 53f0a23..ca90821 100644 (file)
@@ -176,8 +176,6 @@ Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry)
     return kFALSE;
   }
 
-  gDebug = 2;
-
   AliHeader* header = GetHeader();
   if (!header)
   {
index 9d46ac5..2ea92c5 100644 (file)
@@ -109,7 +109,7 @@ void AlidNdEtaSystematicsSelector::SlaveBegin(TTree* tree)
 
   if (option.Contains("sigma-vertex"))
   {
-    fSigmaVertex = new TH1F("fSigmaVertex", "fSigmaVertex;Nsigma2vertex;NacceptedTracks", 10, 0.25, 5.25);
+    fSigmaVertex = new TH1F("fSigmaVertex", "fSigmaVertex;Nsigma2vertex;NacceptedTracks", 50, 0.05, 5.05);
     printf("WARNING: sigma-vertex analysis enabled. This will produce weird results in the AliESDtrackCuts histograms\n");
   }
 
@@ -442,7 +442,7 @@ void AlidNdEtaSystematicsSelector::FillSigmaVertex()
 
     Float_t sigma2Vertex = fEsdTrackCuts->GetSigmaToVertex(esdTrack);
 
-    for (Double_t nSigma = 0.5; nSigma < 5.1; nSigma += 0.5)
+    for (Double_t nSigma = 0.1; nSigma < 5.05; nSigma += 0.1)
     {
       if (sigma2Vertex < nSigma)
         fSigmaVertex->Fill(nSigma);
diff --git a/PWG0/dNdEta/drawCorrection.C b/PWG0/dNdEta/drawCorrection.C
deleted file mode 100644 (file)
index 739141c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $Id$ */
-
-void drawCorrection()
-{
-  gSystem->Load("libPWG0base");
-
-  AlidNdEtaCorrection* dNdEtaMap = new AlidNdEtaCorrection("dndeta_correction", "dndeta_correction");
-  dNdEtaMap->LoadCorrection("correction_map.root");
-
-  dNdEtaMap->DrawHistograms();
-
-  dNdEtaMap->GetMeasuredFraction(0.3, -1, kTRUE);
-}
index daade40..a369897 100644 (file)
@@ -65,6 +65,10 @@ void Prepare1DPlot(TH1* hist)
   hist->SetLineWidth(2);
   hist->SetStats(kFALSE);
 
+  hist->GetXaxis()->SetLabelOffset(0.02);
+  hist->GetXaxis()->SetTitleOffset(1.3);
+  hist->GetYaxis()->SetTitleOffset(1.3);
+
   SetRanges(hist);
 }
 
@@ -74,10 +78,10 @@ void InitPad()
   gPad->SetLeftMargin(0.15);
   //gPad->SetRightMargin(0.05);
   //gPad->SetTopMargin(0.13);
-  //gPad->SetBottomMargin(0.1);
+  gPad->SetBottomMargin(0.12);
 
-  //gPad->SetGridx();
-  //gPad->SetGridy();
+  gPad->SetGridx();
+  gPad->SetGridy();
 }
 
 void InitPadCOLZ()
@@ -105,14 +109,24 @@ void dNdEta(Bool_t onlyESD = kFALSE)
   Prepare1DPlot(histESDMB);
   Prepare1DPlot(histESDMBVtx);
 
-  histESD->SetLineColor(kRed);
-  histESDMB->SetLineColor(kBlue);
-  histESDMBVtx->SetLineColor(103);
+  histESD->SetLineColor(0);
+  histESDMB->SetLineColor(0);
+  histESDMBVtx->SetLineColor(0);
+
+  histESD->SetMarkerColor(kRed);
+  histESDMB->SetMarkerColor(kBlue);
+  histESDMBVtx->SetMarkerColor(103);
+
+  histESD->SetMarkerStyle(20);
+  histESDMB->SetMarkerStyle(21);
+  histESDMBVtx->SetMarkerStyle(22);
 
   TH2F* dummy = new TH2F("dummy", "", 100, -1.5, 1.5, 100, 0, histESDMBVtx->GetMaximum() * 1.1);
+  Prepare1DPlot(dummy);
   dummy->SetStats(kFALSE);
   dummy->SetXTitle("#eta");
-  dummy->SetYTitle("dN/d#eta");
+  dummy->SetYTitle("dN_{ch}/d#eta");
+  dummy->GetYaxis()->SetTitleOffset(1);
 
   histESDMBVtx->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
   histESDMB->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
@@ -149,6 +163,7 @@ void dNdEta(Bool_t onlyESD = kFALSE)
   histESDNoPt->SetLineColor(102);
 
   TH2* dummy2 = (TH2F*) dummy->Clone("dummy2");
+  Prepare1DPlot(dummy2);
   dummy2->GetYaxis()->SetRangeUser(0, histESD->GetMaximum() * 1.1);
 
   dummy2->DrawCopy();
@@ -161,27 +176,44 @@ void dNdEta(Bool_t onlyESD = kFALSE)
   canvas2->SaveAs("dNdEta2.gif");
   canvas2->SaveAs("dNdEta2.eps");
 
-  TCanvas* canvas3 = new TCanvas("dNdEta", "dNdEta", 1000, 500);
-  canvas3->Divide(2, 1);
+  TCanvas* canvas3 = new TCanvas("dNdEta", "dNdEta", 700, 500);
+  //InitPad();
+  gPad->SetBottomMargin(0.12);
 
-  dummy->SetTitle("a)");
-  dummy2->SetTitle("b)");
+  TLegend* legend = new TLegend(0.35, 0.2, 0.6, 0.4);
+  legend->SetFillColor(0);
+  legend->AddEntry(histESDMBVtx, "triggered, vertex");
+  legend->AddEntry(histESDMB, "triggered");
+  legend->AddEntry(histESD, "all events");
+  legend->AddEntry(histMC, "MC prediction");
 
-  canvas3->cd(1);
-  dummy->Draw();
+  dummy->DrawCopy();
   histESDMBVtx->Draw("SAME");
   histESDMB->Draw("SAME");
   histESD->Draw("SAME");
-
-  canvas3->cd(2);
-  dummy2->Draw();
   histMC->Draw("SAME");
-  histESD->Draw("SAME");
-  histESDNoPt->Draw("SAME");
-  histMCPtCut->Draw("SAME");
+
+  legend->Draw();
 
   canvas3->SaveAs("dNdEta.gif");
   canvas3->SaveAs("dNdEta.eps");
+
+  TH1* ratio = (TH1*) histMC->Clone("ratio");
+  TH1* ratioNoPt = (TH1*) histMCPtCut->Clone("ratioNoPt");
+
+  ratio->Divide(histESD);
+  ratioNoPt->Divide(histESDNoPt);
+
+  TCanvas* canvas4 = new TCanvas("ratio", "ratio", 700, 500);
+
+  ratio->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
+
+  ratio->SetLineColor(1);
+  ratioNoPt->SetLineColor(2);
+
+  ratio->Draw();
+  ratioNoPt->Draw("SAME");
+
 }
 
 void ptSpectrum()
@@ -225,9 +257,9 @@ void ptCutoff()
   AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection("dndeta_correction", "dndeta_correction");
   dNdEtaCorrection->LoadHistograms("correction_map.root","dndeta_correction");
 
-  dNdEtaCorrection->GetMeasuredFraction(0.3, -1, kTRUE);
+  dNdEtaCorrection->GetMeasuredFraction(0.3, -100, kTRUE);
 
-  TH1* hist = dynamic_cast<TH1*> (gROOT->FindObject("gene_nTrackToNPart_pt"));
+  TH1* hist = dynamic_cast<TH1*> (gROOT->FindObject("gene_dndeta_correction_nTrackToNPart_pt")->Clone("ptcutoff"));
 
   hist->GetXaxis()->SetRangeUser(0, 0.9999);
   hist->SetMinimum(0);
@@ -235,8 +267,8 @@ void ptCutoff()
   hist->SetTitle("Generated Particles");
   Prepare1DPlot(hist);
 
-  TCanvas* canvas = new TCanvas("ptCutoff", "ptCutoff", 500, 500);
-  hist->Draw();
+  TCanvas* canvas = new TCanvas("ptCutoff", "ptCutoff", 700, 500);
+  hist->DrawCopy();
 
   TLine* line = new TLine(0.3, 0 - hist->GetMaximum() * 0, 0.3, hist->GetMaximum() * 1.1);
   line->SetLineWidth(3);
@@ -245,6 +277,20 @@ void ptCutoff()
 
   canvas->SaveAs("ptCutoff.gif");
   canvas->SaveAs("ptCutoff.eps");
+
+  TH1F* factor = new TH1F("factor", ";#eta;correction factor", 10, -1, 1.000001);
+  for (Float_t eta = -0.9; eta<1; eta += 0.2)
+    factor->Fill(eta, 1.0 / dNdEtaCorrection->GetMeasuredFraction(0.3, eta, kFALSE));
+
+  TCanvas* canvas = new TCanvas("ptCutoff_factor", "ptCutoff_factor", 700, 500);
+  InitPad();
+
+  Prepare1DPlot(factor);
+  factor->GetYaxis()->SetRangeUser(1, 2);
+  factor->GetYaxis()->SetTitleOffset(1);
+  factor->Draw();
+
+  canvas->SaveAs("ptCutoff_factor.eps");
 }
 
 void TriggerBiasVtxRecon(const char* fileName = "correction_map.root", const char* folder = "dndeta_correction")
@@ -318,11 +364,34 @@ void TriggerBias(const char* fileName = "correction_map.root")
   canvas->SaveAs(Form("TriggerBiasZoom_%d.eps", gMax));
 }
 
+void TriggerBias1D(const char* fileName = "correction_map.root", const char* folderName = "dndeta_correction")
+{
+  gSystem->Load("libPWG0base");
+
+  TFile* file = TFile::Open(fileName);
+  AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection(folderName, folderName);
+  dNdEtaCorrection->LoadHistograms(fileName, folderName);
+
+  TH1* hist = dNdEtaCorrection->GetTriggerCorrection()->Get1DCorrection("x");
+
+  TCanvas* canvas = new TCanvas("TriggerBias1D", "TriggerBias1D", 500, 500);
+  InitPad();
+
+  Prepare1DPlot(hist);
+  hist->SetTitle("");
+  hist->GetYaxis()->SetTitle("correction factor");
+  hist->GetYaxis()->SetRangeUser(1, 1.5);
+  hist->GetYaxis()->SetTitleOffset(1.6);
+  hist->Draw();
+
+  canvas->SaveAs("TriggerBias1D.eps");
+}
+
 void VtxRecon()
 {
   TFile* file = TFile::Open("correction_map.root");
 
-  TH2* corr = dynamic_cast<TH2*> (file->Get("dndeta_correction/corr_vtxReco"));
+  TH2* corr = dynamic_cast<TH2*> (file->Get("dndeta_correction/corr_dndeta_correction_vtxReco"));
 
   Prepare2DPlot(corr);
   corr->SetTitle("Vertex reconstruction correction");
@@ -344,6 +413,29 @@ void VtxRecon()
   canvas->SaveAs(Form("VtxReconZoom_%d.eps", gMax));
 }
 
+void VtxRecon1D(const char* fileName = "correction_map.root", const char* folderName = "dndeta_correction")
+{
+  gSystem->Load("libPWG0base");
+
+  TFile* file = TFile::Open(fileName);
+  AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection(folderName, folderName);
+  dNdEtaCorrection->LoadHistograms(fileName, folderName);
+
+  TH1* hist = dNdEtaCorrection->GetVertexRecoCorrection()->Get1DCorrection("x");
+
+  TCanvas* canvas = new TCanvas("VtxRecon1D", "VtxRecon1D", 500, 500);
+  InitPad();
+
+  Prepare1DPlot(hist);
+  hist->SetTitle("");
+  hist->GetYaxis()->SetTitle("correction factor");
+  hist->GetYaxis()->SetRangeUser(1, 1.8);
+  hist->GetYaxis()->SetTitleOffset(1.6);
+  hist->Draw();
+
+  canvas->SaveAs("VtxRecon1D.eps");
+}
+
 void Track2ParticleAsNumber(const char* fileName = "correction_map.root")
 {
   gSystem->Load("libPWG0base");
@@ -413,29 +505,31 @@ void Track2Particle1DCreatePlots(const char* fileName = "correction_map.root", c
   AliPWG0Helper::CreateDividedProjections(gene, meas, "z", kTRUE);
 }
 
-void Track2Particle1D(const char* fileName = "correction_map.root", const char* folderName = "dndeta_correction", Float_t upperPtLimit = 9.9)
+void Track2Particle1D(const char* fileName = "correction_map.root", const char* folder = "dndeta_correction", Float_t upperPtLimit = 9.9)
 {
   gSystem->Load("libPWG0base");
 
-  Track2Particle1DCreatePlots(fileName, folderName, upperPtLimit);
+  Track2Particle1DCreatePlots(fileName, folder, upperPtLimit);
 
-  TH1* corrX = dynamic_cast<TH1*> (gROOT->FindObject("gene_nTrackToNPart_x_div_meas_nTrackToNPart_x"));
-  TH1* corrY = dynamic_cast<TH1*> (gROOT->FindObject("gene_nTrackToNPart_y_div_meas_nTrackToNPart_y"));
-  TH1* corrZ = dynamic_cast<TH1*> (gROOT->FindObject("gene_nTrackToNPart_z_div_meas_nTrackToNPart_z"));
+  TH1* corrX = dynamic_cast<TH1*> (gROOT->FindObject(Form("gene_%s_nTrackToNPart_x_div_meas_%s_nTrackToNPart_x", folder, folder)));
+  TH1* corrY = dynamic_cast<TH1*> (gROOT->FindObject(Form("gene_%s_nTrackToNPart_y_div_meas_%s_nTrackToNPart_y", folder, folder)));
+  TH1* corrZ = dynamic_cast<TH1*> (gROOT->FindObject(Form("gene_%s_nTrackToNPart_z_div_meas_%s_nTrackToNPart_z", folder, folder)));
 
   Prepare1DPlot(corrX);
   Prepare1DPlot(corrY);
   Prepare1DPlot(corrZ);
 
-  const char* title = "Track2Particle Correction";
-  corrX->SetTitle(title);
-  corrY->SetTitle(title);
-  corrZ->SetTitle(title);
+  //corrX->SetTitle("a) z projection");
+  corrY->SetTitle("a) #eta projection");
+  corrZ->SetTitle("b) p_{T} projection");
+
+  corrY->GetYaxis()->SetTitle("correction factor");
+  corrZ->GetYaxis()->SetTitle("correction factor");
 
   corrZ->GetXaxis()->SetRangeUser(0, upperPtLimit);
 
   TString canvasName;
-  canvasName.Form("Track2Particle1D_%s", folderName);
+  canvasName.Form("Track2Particle1D_%s", folder);
   TCanvas* canvas = new TCanvas(canvasName, canvasName, 1200, 400);
   canvas->Divide(3, 1);
 
@@ -451,8 +545,27 @@ void Track2Particle1D(const char* fileName = "correction_map.root", const char*
   InitPad();
   corrZ->DrawCopy();
 
-  canvas->SaveAs(Form("Track2Particle1D_%s_%d_%f.gif", fileName, gMax, upperPtLimit));
-  canvas->SaveAs(Form("Track2Particle1D_%s_%d_%f.eps", fileName, gMax, upperPtLimit));
+  canvas->SaveAs(Form("Track2Particle1D_%s_%f.gif", fileName, upperPtLimit));
+  canvas->SaveAs(Form("Track2Particle1D_%s_%f.eps", fileName, upperPtLimit));
+
+  canvasName.Form("Track2Particle1D_%s_etapt", folder);
+  TCanvas* canvas = new TCanvas(canvasName, canvasName, 1000, 500);
+  canvas->Divide(2, 1);
+
+  canvas->cd(1);
+  InitPad();
+  corrY->GetXaxis()->SetRangeUser(-0.99, 0.99);
+  corrY->GetYaxis()->SetRangeUser(1, 1.5);
+  corrY->GetYaxis()->SetTitleOffset(1.5);
+  corrY->DrawCopy();
+
+  canvas->cd(2);
+  InitPad();
+  corrZ->GetYaxis()->SetRangeUser(1, 1.5);
+  corrZ->GetYaxis()->SetTitleOffset(1.5);
+  corrZ->DrawCopy();
+
+  canvas->SaveAs(Form("Track2Particle1D_etapt_%s_%f.eps", fileName, upperPtLimit));
 }
 
 void CompareTrack2Particle1D(Float_t upperPtLimit = 9.9)
index 2285ab3..56e4fee 100644 (file)
@@ -83,8 +83,8 @@ void InitPad()
   //gPad->SetTopMargin(0.13);
   //gPad->SetBottomMargin(0.1);
 
-  //gPad->SetGridx();
-  //gPad->SetGridy();
+  gPad->SetGridx();
+  gPad->SetGridy();
 }
 
 void InitPadCOLZ()
@@ -660,18 +660,18 @@ TH1F* Sigma2VertexGaussian()
   canvas->cd(1);
   tracks->Draw("COLZ");
 
-  TH1F* ratio = new TH1F("Sigma2Vertex_ratio", "Sigma2Vertex_ratio;n sigma;included", 10, 0.25, 5.25);
-  for (Double_t nSigma = 0.5; nSigma < 5.1; nSigma += 0.5)
+  TH1F* ratio = new TH1F("Sigma2Vertex_ratio", "Sigma2Vertex_ratio;n sigma;included", 50, 0.05, 5.05);
+  for (Double_t nSigma = 0.1; nSigma < 5.05; nSigma += 0.1)
     ratio->Fill(nSigma, Sigma2VertexCount(tracks, nSigma));
   ratio->SetMarkerStyle(21);
 
   canvas->cd(2);
   ratio->DrawCopy("P");
 
-  TH1F* ratio2 = new TH1F("Sigma2Vertex_ratio2", "Sigma2Vertex_ratio2;nSigma;% included 3 sigma / % included n sigma", 10, 0.25, 5.25);
+  TH1F* ratio2 = new TH1F("Sigma2Vertex_ratio2", "Sigma2Vertex_ratio2;nSigma;% included 3 sigma / % included n sigma", 50, 0.05, 5.05);
   Double_t sigma3 = Sigma2VertexCount(tracks, 3);
-  for (Double_t nSigma = 0.5; nSigma < 5.1; nSigma += 0.5)
-    ratio2->Fill(nSigma, sigma3 / Sigma2VertexCount(tracks, nSigma));
+  for (Double_t nSigma = 0.1; nSigma < 5.05; nSigma += 0.1)
+    ratio2->Fill(nSigma, sigma3 / ratio->GetBinContent(ratio->FindBin(nSigma)));
   ratio2->SetMarkerStyle(21);
 
   canvas->cd(3);
@@ -693,7 +693,7 @@ TH1F* Sigma2VertexSimulation()
     return;
   }
 
-  TH1F* ratio = new TH1F("sigmavertexsimulation_ratio", "sigmavertexsimulation_ratio;N#sigma;% included #sigma / % included n #sigma", sigmavertex->GetNbinsX(), sigmavertex->GetXaxis()->GetXmin(), sigmavertex->GetXaxis()->GetXmax());
+  TH1F* ratio = new TH1F("sigmavertexsimulation_ratio", "sigmavertexsimulation_ratio;N#sigma;% included 3 #sigma / % included N#sigma", sigmavertex->GetNbinsX(), sigmavertex->GetXaxis()->GetXmin(), sigmavertex->GetXaxis()->GetXmax());
 
   for (Int_t i=1; i<=sigmavertex->GetNbinsX(); ++i)
     ratio->SetBinContent(i, sigmavertex->GetBinContent(sigmavertex->GetXaxis()->FindBin(3)) / sigmavertex->GetBinContent(i));
@@ -760,7 +760,7 @@ void DrawdNdEtaDifferences()
 {
   TH1* hists[5];
 
-  TLegend* legend = new TLegend(0.6, 0.73, 0.98, 0.98);
+  TLegend* legend = new TLegend(0.3, 0.73, 0.70, 0.98);
   legend->SetFillColor(0);
 
   TCanvas* canvas = new TCanvas("DrawdNdEtaDifferences", "DrawdNdEtaDifferences", 1000, 500);
@@ -770,6 +770,7 @@ void DrawdNdEtaDifferences()
 
   for (Int_t i=0; i<5; ++i)
   {
+    hists[i] = 0;
     TFile* file = 0;
     TString title;
 
@@ -783,18 +784,23 @@ void DrawdNdEtaDifferences()
       default: return;
     }
 
-    hists[i] = (TH1*) file->Get("dndeta/dndeta_dNdEta_corrected_2");
-    hists[i]->SetTitle("a)");
-
-    hists[i]->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
-    hists[i]->SetLineColor(i+1);
-    hists[i]->SetMarkerColor(i+1);
-    hists[i]->GetXaxis()->SetLabelOffset(0.015);
-    Prepare1DPlot(hists[i], kFALSE);
-    hists[i]->DrawCopy(((i > 0) ? "SAME" : ""));
-
-    legend->AddEntry(hists[i], title);
-    hists[i]->SetTitle(title);
+    if (file)
+    {
+      hists[i] = (TH1*) file->Get("dndeta/dndeta_dNdEta_corrected_2");
+      hists[i]->SetTitle("a)");
+
+      Prepare1DPlot(hists[i], kFALSE);
+      hists[i]->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
+      hists[i]->SetLineColor(i+1);
+      hists[i]->SetMarkerColor(i+1);
+      hists[i]->GetXaxis()->SetLabelOffset(0.015);
+      hists[i]->GetYaxis()->SetTitleOffset(1.5);
+      gPad->SetLeftMargin(0.12);
+      hists[i]->DrawCopy(((i > 0) ? "SAME" : ""));
+
+      legend->AddEntry(hists[i], title);
+      hists[i]->SetTitle(title);
+    }
   }
   legend->Draw();
 
@@ -806,15 +812,17 @@ void DrawdNdEtaDifferences()
 
   for (Int_t i=1; i<5; ++i)
   {
-    legend2->AddEntry(hists[i]);
-
-    hists[i]->Divide(hists[0]);
-    hists[i]->SetTitle("b)");
-    hists[i]->GetYaxis()->SetRangeUser(0.98, 1.02);
-    hists[i]->GetYaxis()->SetTitle("Ratio to standard composition");
-    hists[i]->GetYaxis()->SetTitleOffset(1.8);
-    hists[i]->DrawCopy(((i > 1) ? "SAME" : ""));
-
+    if (hists[i])
+    {
+      legend2->AddEntry(hists[i]);
+
+      hists[i]->Divide(hists[0]);
+      hists[i]->SetTitle("b)");
+      hists[i]->GetYaxis()->SetRangeUser(0.98, 1.02);
+      hists[i]->GetYaxis()->SetTitle("Ratio to standard composition");
+      hists[i]->GetYaxis()->SetTitleOffset(1.8);
+      hists[i]->DrawCopy(((i > 1) ? "SAME" : ""));
+    }
   }
 
   legend2->Draw();
index 703c586..26a3183 100644 (file)
@@ -38,52 +38,3 @@ void makeSystematics(Char_t* dataDir, Int_t nRuns=20, Int_t offset = 0, Bool_t d
 
   Int_t result = executeQuery(chain, &inputList, selector, option);
 }
-
-void runAnalysisWithDifferentMaps(Char_t* dataDir, Int_t nRuns=20, Int_t offset = 0, Bool_t debug = kFALSE, Bool_t proof = kFALSE)
-{
-  // This functions runs the dN/dEta analysis with different correction maps to gather systematics
-  // It runs with the "normal map", and with 4 other different cases where particle species are enhanced
-  // or reduced.
-  // The normal map is expected in correction_map.root, created by AlidNdEtaCorrectionSelector
-  // The others in new_compositions.root in the folders (K|p)(Boosted|Reduced), created
-  //   by AlidNdEtaSystematicsSelector and Composition() out of drawSystematics.C
-
-  gROOT->ProcessLine(".L testAnalysis2.C");
-
-  gSystem->Exec("rm analysis_esd.root");
-
-  testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "correction_map.root", "dndeta_correction");
-  if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_reference.root") != 0)
-  {
-    printf("systematics_dndeta_reference.root failed\n");
-    return;
-  }
-
-  testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "KBoosted");
-  if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_KBoosted.root") != 0)
-  {
-    printf("systematics_dndeta_KBoosted.root failed\n");
-    return;
-  }
-
-  testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "KReduced");
-  if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_KReduced.root") != 0)
-  {
-    printf("systematics_dndeta_KReduced.root failed\n");
-    return;
-  }
-
-  testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "pBoosted");
-  if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_pBoosted.root") != 0)
-  {
-    printf("systematics_dndeta_pBoosted.root failed\n");
-    return;
-  }
-
-  testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "pReduced");
-  if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_pReduced.root") != 0)
-  {
-    printf("systematics_dndeta_pReduced.root failed\n");
-    return;
-  }
-}
diff --git a/PWG0/dNdEta/runParticleCompositionStudy.sh b/PWG0/dNdEta/runParticleCompositionStudy.sh
new file mode 100755 (executable)
index 0000000..e5b2c40
--- /dev/null
@@ -0,0 +1,32 @@
+/* $Id$ */
+
+# This script runs the dN/dEta analysis with different correction maps to gather systematics
+# It runs with the "normal map", and with 4 other different cases where particle species are enhanced
+# or reduced.
+# The normal map is expected in correction_map.root, created by AlidNdEtaCorrectionSelector
+# The others in new_compositions.root in the folders (K|p)(Boosted|Reduced), created
+#   by AlidNdEtaSystematicsSelector and Composition() out of drawSystematics.C
+
+
+function run
+{
+  root -l -q testAnalysis2.C\(\"analysisInput.txt\",10000,0,kFALSE,kFALSE,kTRUE,\"$1\",\"$2\"\)
+  mv analysis_esd.root $3
+
+  if [ "$?" -ne "0" ]
+  then
+    echo "$3 failed"
+    exit
+  fi
+
+  sleep 5
+}
+
+rm analysis_esd.root
+
+#run correction_map.root dndeta_correction systematics_dndeta_reference.root
+#run new_compositions.root KBoosted systematics_dndeta_KBoosted.root
+#run new_compositions.root KReduced systematics_dndeta_KReduced.root
+run new_compositions.root pBoosted systematics_dndeta_pBoosted.root
+run new_compositions.root pReduced systematics_dndeta_pReduced.root
+