update for 2012-02-27 meeting.
authorhqvigsta <hqvigsta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Mar 2013 10:56:24 +0000 (10:56 +0000)
committerhqvigsta <hqvigsta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Mar 2013 10:56:24 +0000 (10:56 +0000)
PWGGA/PHOSTasks/PHOS_PbPb/macros/production/DrawMNN.C
PWGGA/PHOSTasks/PHOS_PbPb/macros/production/DrawPSBSFitParams.C

index 0499abd..42056a9 100644 (file)
@@ -9,6 +9,7 @@ void DrawMNN()
   gStyle->SetOptFit(1);
   TH1* hist = output.GetHistogram(example1);
   hist->SetAxisRange(0.05, 0.3);
+  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
   hist->Draw();
   canv->SaveAs("imgs/kMB_pt003_hPi0M11.pdf");
 
@@ -17,6 +18,7 @@ void DrawMNN()
   gStyle->SetOptFit(1);
   TH1* hist = output.GetHistogram(example2);
   hist->SetAxisRange(0.05, 0.3);
+  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
   hist->Draw();
   canv->SaveAs(Form("imgs/kMB_pt003_hPi0M12.pdf", example2));
 
@@ -27,6 +29,7 @@ void DrawMNN()
   gStyle->SetOptFit(1);
   TH1* hist = output.GetHistogram(badM11);
   hist->SetAxisRange(0.05, 0.3);
+  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
   hist->Draw();
   canv->SaveAs(Form("imgs/kCentral_pt003_hPi0M11.pdf", badM11));
 
@@ -36,6 +39,7 @@ void DrawMNN()
   gStyle->SetOptFit(1);
   TH1* hist = output.GetHistogram(badM22);
   hist->SetAxisRange(0.05, 0.3);
+  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
   hist->Draw();
   canv->SaveAs(Form("imgs/kCentral_pt003_hPi0M22.pdf", badM22));
 
@@ -45,6 +49,7 @@ void DrawMNN()
   gStyle->SetOptFit(1);
   TH1* hist = output.GetHistogram(badM33);
   hist->SetAxisRange(0.05, 0.3);
+  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
   hist->Draw();
   canv->SaveAs(Form("imgs/kCentral_pt003_hPi0M33.pdf", badM33));
   
@@ -68,8 +73,9 @@ void DrawMNN()
     hM12->SetLineColor(kCyan+1);
     hM12->GetYaxis()->SetRangeUser(0.12, 0.15);
     hM12->SetTitle(Form("#pi^{0} Peak Mean, %s", triggers.Data()));
-    hM12->GetYaxis()->SetTitle("Peak Mean");
-    hM12->GetXaxis()->SetTitle("p_T");
+    hM12->GetYaxis()->SetTitle("Peak #mu");
+    hM12->GetYaxis()->SetTitleOffset(1.3);
+    hM12->GetXaxis()->SetTitle("p_{T}");
     gStyle->SetOptStat(0);
     hM12->Draw();
 
@@ -129,8 +135,9 @@ void DrawMNN()
     hW12->SetLineColor(kCyan+1);
     hW12->GetYaxis()->SetRangeUser(0., 0.012);
     hW12->SetTitle(Form("#pi^{0} Peak Width, %s", triggers.Data()));
-    hM12->GetYaxis()->SetTitle("Peak Width");
-    hM12->GetXaxis()->SetTitle("p_T");
+    hW12->GetYaxis()->SetTitle("Peak #sigma");
+    hW12->GetYaxis()->SetTitleOffset(1.3);
+    hW12->GetXaxis()->SetTitle("p_{T}");
     gStyle->SetOptStat(0);
     hW12->Draw();
 
index f44cfc3..542798d 100644 (file)
 #include "TCanvas.h"
 
 
-const char* pids[12] = {"Bothcore", "Allcore", "Allwou", "Disp2", "Dispwou","Dispcore", "CPV2", "CPVcore", "Both", "Disp", "CPV", "All"};
-Int_t markers[12] =  {  25,          24,       24,        32,     30,         32,         26,        26,     21,     23,     22,    20};
-Float_t markerSizes[12] =  {  1.2,   0.8,      1.2,     0.8,      1.2,        1.6,        0.8,       1.2,     1.,     1,       1,     1.  };
-Int_t colors[12] =    {kMagenta-4, kGray, kGray+1, kBlue-9, kBlue-7, kBlue-4,   kRed-7,   kRed-4, kMagenta+1, kBlue, kRed, kBlack};
-TH1* hists[12] = {0};
-int from =0;
 
 namespace RawProduction {
   class Output;
 }
 
 
-void DrawPSBSFitMethodeParams(const RawProduction::Output& output, const char* trigger, int cent)
+void DrawAbs(const RawProduction::Output& output, const char* trigger, int cent, TStringToken& names) 
+{
+  names.NextToken();
+
+  const char* pid = "All";
+  char canvName[256] = Form("PSBS_Abs_%s_c%03i_%s_%s", trigger, cent, pid, names.Data());
+  TCanvas* canv = new TCanvas(canvName, canvName);  
+  TLegend* leg = new TLegend(0.6,0.8,0.95,0.95);
+
+  TH1* hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, pid, names.Data()));
+  if(names.Contains("mr")) hist->SetTitle(Form("Peak Position, %s, %s, %s", trigger, RawProduction::GetCentString(cent), pid));
+  if(names.Contains("sr")) hist->SetTitle(Form("Peak Width, %s, %s, %s", trigger, RawProduction::GetCentString(cent), pid));
+  if(names.Contains("mr")) hist->GetYaxis()->SetRangeUser(0.12, 0.15);
+  if(names.Contains("mr")) hist->GetYaxis()->SetTitle("Peak #mu");
+  if(names.Contains("sr")) hist->GetYaxis()->SetRangeUser(0., 0.012);
+  if(names.Contains("sr")) hist->GetYaxis()->SetTitle("Peak #sigma");
+  hist->GetXaxis()->SetTitle("p_{T}");
+  //Printf(hist->GetTitle());
+  hist->SetMarkerStyle(21);
+  //hist->SetMarkerSize(1.5);
+  hist->SetMarkerColor(kBlack);
+  hist->SetLineColor(kBlack);
+  hist->Draw();
+  leg->AddEntry(hist, "Pol1, Ratio", "lep");
+  
+  int marker = 21;
+  Color_t color[3] = {kRed, kBlue, kMagenta};
+  while( names.NextToken() ) {
+    hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "All", names.Data()));
+    //Printf(hist->GetName());
+    hist->SetMarkerStyle(++marker);
+    hist->SetMarkerColor(color[marker-22]);
+    hist->SetLineColor(color[marker-22]);
+    hist->Draw("same");
+    char legName[256] = "";
+    if(names.Contains("1")) sprintf(legName, "Pol1");
+    if(names.Contains("2")) sprintf(legName, "Pol2");
+    if( marker <23 ) sprintf(legName, "%s, Ratio", legName);
+    leg->AddEntry(hist, legName, "lep");
+  }
+  
+  hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, pid, names.Data()));
+  hist->Draw("same");
+
+  leg->Draw();
+  
+  canv->SaveAs(Form("imgs/%s.png", canvName));
+  canv->SaveAs(Form("imgs/%s.pdf", canvName));
+}
+
+void DrawRatios(const RawProduction::Output& output, const char* trigger, int cent)
 {
   TStringToken graphs("mr1;sr1;mr1r;sr1r;mr2;sr2;mr2r;sr2r", ";");
   while( graphs.NextToken() ) {
     const char* graph = graphs.Data();
-    
-    TCanvas* canv = new TCanvas(Form("%s_c%03i_%s", trigger, cent, graph), Form("%s_c%03i_%s", trigger, cent, graph));
-    TH1* hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, pids[from], graph));
-    hists[from] = hist;
-    
-    if(graphs.Contains("mr")) hist->GetYaxis()->SetRangeUser(0.11, 0.15);
-    if(graphs.Contains("sr")) hist->GetYaxis()->SetRangeUser(0, 0.012);
-    
-    if(graphs.Contains("r1")) hist->SetTitle( Form("%s, Pol1", hist->GetTitle()) );
-    if(graphs.Contains("r2")) hist->SetTitle( Form("%s, Pol1", hist->GetTitle()) );
-    hist->SetMarkerStyle(markers[from]);
-    hist->SetMarkerColor(colors[from]);
-    hist->SetLineColor(colors[from]);
+
+    // ratio
+    TCanvas* canv = new TCanvas(Form("%s_c%03i_%s_ratio", trigger, cent, graph), Form("%s_c%03i_%s_ratio", trigger, cent, graph));
+    TLegend* leg = new TLegend(0.6,0.8,0.95,0.95);
+
+    hAll = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "All", graph));
+
+
+    TH1* hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "CPV", graph));
+    hist = (TH1*) hist->Clone(Form("dAll_%s", hist->GetName()));
+    if(graphs.Contains("mr1")) hist->SetTitle( "Peak Position, Pol1" );
+    if(graphs.Contains("mr2")) hist->SetTitle( "Peak Position, Pol2" );
+    if(graphs.Contains("mr1r")) hist->SetTitle( "Peak Position, Pol1, Ratio" );
+    if(graphs.Contains("mr2r")) hist->SetTitle( "Peak Position, Pol2, Ratio" );
+    if(graphs.Contains("sr1")) hist->SetTitle( "Peak Width, Pol1" );
+    if(graphs.Contains("sr2")) hist->SetTitle( "Peak Width, Pol2" );
+    if(graphs.Contains("sr1r")) hist->SetTitle( "Peak Width, Pol1, Ratio" );
+    if(graphs.Contains("sr2r")) hist->SetTitle( "Peak Width, Pol2, Ratio" );
+    hist->SetTitle(Form("%s, %s, centrality: %s", hist->GetTitle(), trigger, RawProduction::GetCentString(cent)));
+    if(graphs.Contains("mr")) hist->GetYaxis()->SetRangeUser(0.9, 1.05);
+    if(graphs.Contains("mr")) hist->GetYaxis()->SetTitle("Peak #mu");
+    if(graphs.Contains("sr")) hist->GetYaxis()->SetRangeUser(0.4, 1.4);
+    if(graphs.Contains("sr")) hist->GetYaxis()->SetTitle("Peak #sigma");
+    hist->GetXaxis()->SetTitle("p_{T}");
+    hist->Divide(hAll);
+    hist->SetMarkerStyle(22);
+    hist->SetMarkerColor(kRed);
+    hist->SetLineColor(kRed);
     hist->Draw();
+    leg->AddEntry(hist, "CPV/All", "lep");
+
+    hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "Disp", graph));
+    hist = (TH1*) hist->Clone(Form("dAll_%s", hist->GetName()));
+    hist->Divide(hAll);
+    hist->SetMarkerStyle(23);
+    hist->SetMarkerColor(kBlue);
+    hist->SetLineColor(kBlue);
+    hist->Draw("same");
+    leg->AddEntry(hist, "Disp/All", "lep");
+
+    hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "Both", graph));
+    hist = (TH1*) hist->Clone(Form("dAll_%s", hist->GetName()));
+    hist->Divide(hAll);
+    hist->SetMarkerStyle(21);
+    hist->SetMarkerColor(kMagenta);
+    hist->SetLineColor(kMagenta);
+    hist->Draw("same");
+    leg->AddEntry(hist, "Both/All", "lep");
+
     
-    
-    for(int index=from+1; index<12; index++  ) {
-      hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, pids[index], graph));
-      hists[index] = hist;
-      hist->SetMarkerStyle(markers[index]);
-      hist->SetMarkerSize(markerSizes[index]);
-      hist->SetMarkerColor(colors[index]);
-      hist->SetLineColor(colors[index]);
-      hist->Draw("same");
-      
-    }
-    
-    TLegend* leg = new TLegend(0.8,0.6,0.95,0.95);
-    for(int index=11; index>=from; index--  )
-      leg->AddEntry(hists[index], pids[index], "lep");
     leg->Draw();
-    canv->SaveAs(Form("imgs/PSBSFits_%s_c%03i_%s.png", trigger, cent, graph));
-    canv->SaveAs(Form("imgs/PSBSFits_%s_c%03i_%s.pdf", trigger, cent, graph));
-
-
-
-    // // core
-    // canv = new TCanvas(Form("%s_c%03i_%s_core", trigger, cent, graph), Form("%s_c%03i_%s_core", trigger, cent, graph));
-    // leg = new TLegend(0.8,0.6,0.95,0.95);
-
-    // hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "Allcore", graph));
-    // if(graphs.Contains("mr")) hist->GetYaxis()->SetRangeUser(0.11, 0.15);
-    // if(graphs.Contains("sr")) hist->GetYaxis()->SetRangeUser(0, 0.012);
-    // if(graphs.Contains("r1")) hist->SetTitle( Form("%s, Pol1", hist->GetTitle()) );
-    // if(graphs.Contains("r2")) hist->SetTitle( Form("%s, Pol2", hist->GetTitle()) );
-    // hist->SetMarkerStyle(20);
-    // hist->SetMarkerColor(kBlack);
-    // hist->SetLineColor(kBlack);
-    // hist->Draw();
-    // leg->AddEntry(hist, "Allcore", "lep");
-
-    // hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "CPVcore", graph));
-    // hist->SetMarkerStyle(22);
-    // //hist->SetMarkerSize();
-    // hist->SetMarkerColor(kRed);
-    // hist->SetLineColor(kRed);
-    // hist->Draw("same");
-    // leg->AddEntry(hist, "CPVcore", "lep");
-
-    // hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "Dispcore", graph));
-    // hist->SetMarkerStyle(23);
-    // //hist->SetMarkerSize();
-    // hist->SetMarkerColor(kBlue);
-    // hist->SetLineColor(kBlue);
-    // hist->Draw("same");
-    // leg->AddEntry(hist, "Dispcore", "lep");
-
-    // hist = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "Bothcore", graph));
-    // hist->SetMarkerStyle(21);
-    // //hist->SetMarkerSize();
-    // hist->SetMarkerColor(kMagenta);
-    // hist->SetLineColor(kMagenta);
-    // hist->Draw("same");
-    // leg->AddEntry(hist, "Bothcore", "lep");
 
+    canv->SaveAs(Form("imgs/PSBSFits_ratio_%s_c%03i_%s.png", trigger, cent, graph));
+    canv->SaveAs(Form("imgs/PSBSFits_ratio_%s_c%03i_%s.pdf", trigger, cent, graph));
     
-    // leg->Draw();
 
-    // canv->SaveAs(Form("imgs/PSBSFits_core_%s_c%03i_%s.png", trigger, cent, graph));
-    // canv->SaveAs(Form("imgs/PSBSFits_core_%s_c%03i_%s.pdf", trigger, cent, graph));
 
 
     // core, ratio
@@ -105,16 +125,20 @@ void DrawPSBSFitMethodeParams(const RawProduction::Output& output, const char* t
     leg = new TLegend(0.6,0.8,0.95,0.95);
 
     hAll = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "All", graph));
-    if(graphs.Contains("r1")) hist->SetTitle( Form("%s, Pol1", hist->GetTitle()) );
-    if(graphs.Contains("r2")) hist->SetTitle( Form("%s, Pol2", hist->GetTitle()) );
 
     hAllcore = output.GetHistogram(Form("%s/c%03i/%s/%s", trigger, cent, "Allcore", graph));
 
     hist = hAllcore;
     hist = (TH1*) hist->Clone(Form("dAll_%s", hist->GetName()));
     hist->Divide(hAll);
+    if(graphs.Contains("r1")) hist->SetTitle( Form("%s, Pol1", hist->GetTitle()) );
+    if(graphs.Contains("r2")) hist->SetTitle( Form("%s, Pol2", hist->GetTitle()) );
+    hist->SetTitle(Form("%s, %s, centrality: %s", hist->GetTitle(), trigger, RawProduction::GetCentString(cent)));
     if(graphs.Contains("mr")) hist->GetYaxis()->SetRangeUser(0.9, 1.05);
+    if(graphs.Contains("mr")) hist->GetYaxis()->SetTitle("Peak #mu");
     if(graphs.Contains("sr")) hist->GetYaxis()->SetRangeUser(0.4, 1.4);
+    if(graphs.Contains("sr")) hist->GetYaxis()->SetTitle("Peak #sigma");
+    hist->GetXaxis()->SetTitle("p_{T}");
     hist->SetMarkerStyle(20);
     hist->SetMarkerColor(kBlack);
     hist->SetLineColor(kBlack);
@@ -154,8 +178,21 @@ void DrawPSBSFitMethodeParams(const RawProduction::Output& output, const char* t
     canv->SaveAs(Form("imgs/PSBSFits_ratio_core_%s_c%03i_%s.png", trigger, cent, graph));
     canv->SaveAs(Form("imgs/PSBSFits_ratio_core_%s_c%03i_%s.pdf", trigger, cent, graph));
     
-    }
   }
+}
+
+
+void DrawPSBSFitMethodeParams(const RawProduction::Output& output, const char* trigger, int cent)
+{
+  TStringToken mrst("mr1r;mr2r;mr1;mr2", ";");
+  DrawAbs(output, trigger, cent, mrst);
+
+  TStringToken srst("sr1r;sr2r;sr1;sr2", ";");
+  DrawAbs(output, trigger, cent, srst);
+  
+    
+  DrawRatios(output, trigger, cent);
+}
 
 void DrawPSBSFitParams()
 {
@@ -164,8 +201,17 @@ void DrawPSBSFitParams()
   gStyle->SetOptStat(0);
   
   
-  DrawPSBSFitMethodeParams(output, "kCentral", -1);
   DrawPSBSFitMethodeParams(output, "kMB", -10);
   DrawPSBSFitMethodeParams(output, "kPHOSPb", -10);
-  
+
+  DrawPSBSFitMethodeParams(output, "kCentral", -1);
+  DrawPSBSFitMethodeParams(output, "kMB", -1);
+  DrawPSBSFitMethodeParams(output, "kPHOSPb", -1);
+
+  DrawPSBSFitMethodeParams(output, "kSemiCentral", -11);
+  DrawPSBSFitMethodeParams(output, "kMB", -11);
+  DrawPSBSFitMethodeParams(output, "kPHOSPb", -11);
+
+  DrawPSBSFitMethodeParams(output, "kPHOSPb", -6);
+  DrawPSBSFitMethodeParams(output, "kMB", -6);
 }