updated plotting macros
authorjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Nov 2009 06:16:03 +0000 (06:16 +0000)
committerjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Nov 2009 06:16:03 +0000 (06:16 +0000)
PWG4/macros/electrons/makeCombinedData.C
PWG4/macros/electrons/plotNPERates.C
PWG4/macros/electrons/plotPIDCompare.C

index 1477cfb..9da100d 100644 (file)
@@ -710,8 +710,8 @@ void makeTRKElectrons(TH2F* jjtrk, TH2F* bjtrk, TH2F* wjtrk) {
   for(Int_t i = 5; i<= convtrk->GetNbinsX(); i++) {
     Double_t dither = rand2.Gaus(0.,fooconvtrk->GetBinContent(i)/2.);
     if(dither + fooconvtrk->GetBinContent(i) < fooconvtrk->GetBinContent(i)/100.) dither = 0.;   
-    //    convtrk->SetBinContent(i,fooconvtrk->GetBinContent(i)+dither);    
-    //convtrk->SetBinError(i,sqrt(fooconvtrk->GetBinContent(i)));    
+    convtrk->SetBinContent(i,fooconvtrk->GetBinContent(i)+dither);    
+    convtrk->SetBinError(i,sqrt(fooconvtrk->GetBinContent(i)));    
   }
   convtrk->Draw(); fooconvtrk->Draw("same");
 
index 0c1592f..94d0410 100644 (file)
@@ -31,8 +31,8 @@ void plotNPERates(const char* which = "EMC") {
   //  leg->AddEntry(htte,"Misidentified hadrons","l");\r
 \r
   gStyle->SetOptStat(0);\r
-  drawAnnualYields(which);\r
-  drawPtCutRates(which);\r
+  //  drawAnnualYields(which);\r
+  // drawPtCutRates(which);\r
   //drawCompareTruth();\r
 \r
 }\r
index de58969..d208803 100644 (file)
@@ -115,9 +115,15 @@ void plotPIDCompare(char* which = "EMC") {
   Double_t efinal = 0.258;\r
   TGraphErrors* eerr = new TGraphErrors();\r
   eerr->SetName("emcErr");\r
+  int count=0;\r
   for(Int_t i = 1; i <= hcorr->GetNbinsX(); i++) {\r
-    eerr->SetPoint(i-1,hcorr->GetBinCenter(i),hcorr->GetBinContent(i));\r
-    eerr->SetPointError(i-1,0.,efinal*hcorr->GetBinContent(i));\r
+    if (hcorr->GetBinCenter(i) <10.0) continue;\r
+    if (hcorr->GetBinCenter(i) >50.0) break;\r
+    cout <<"bin:"<< i << ", bin-center:"<< hcorr->GetBinCenter(i)<< endl;\r
+    eerr->SetPoint(count,hcorr->GetBinCenter(i),hcorr->GetBinContent(i));\r
+    eerr->SetPointError(count,0.,efinal*hcorr->GetBinContent(i));\r
+    if(hcorr->GetBinCenter(i) <20.0) eerr->SetPointError(count,0.,1.5*efinal*hcorr->GetBinContent(i));\r
+    count++;\r
   }\r
   eerr->SetFillColor(kRed-8);\r
   eerr->Draw("3same");\r
@@ -144,5 +150,80 @@ void plotPIDCompare(char* which = "EMC") {
   //  latex->Draw();\r
 \r
   crates->Print("NPERates_PIDCompare_all.pdf");\r
+\r
+  TCanvas* ccomp = new TCanvas("ccomp","",0,0,600,800);\r
+  ccomp->SetFillColor(0);\r
+  ccomp->SetBorderMode(0);\r
+  ccomp->SetBorderSize(2);\r
+  ccomp->SetFrameBorderMode(0);\r
+  ccomp->SetFrameBorderMode(0);\r
+  TPad*    upperPad = new TPad("upperPad", "upperPad", \r
+                              .005, .2525, .995, .995);\r
+  upperPad->SetFillColor(0);\r
+  upperPad->SetBorderMode(0);\r
+  upperPad->SetBorderSize(2);\r
+  upperPad->SetFrameBorderMode(0);\r
+  upperPad->SetFrameBorderMode(0);\r
+  TPad*    lowerPad = new TPad("lowerPad", "lowerPad", \r
+                              .005, .005, .995, .2525);\r
+  lowerPad->SetFillColor(0);\r
+  lowerPad->SetFillColor(0);\r
+  lowerPad->SetBorderMode(0);\r
+  lowerPad->SetBorderSize(2);\r
+  lowerPad->SetFrameBorderMode(0);\r
+  lowerPad->SetFrameBorderMode(0);\r
+  upperPad->Draw();        \r
+  lowerPad->Draw(); \r
+  upperPad->cd();\r
+  gPad->SetLogy();\r
+  hcorr->SetTitle("Efficiency corrected non-photonic electrons");\r
+  hcorr->SetYTitle("Annual yield in EMCAL dN/dp_{T} (GeV/c)^{-1}");\r
+  hcorr->SetXTitle("p_{T} (GeV/c)");\r
+  hcorr->GetXaxis()->SetRangeUser(10.,49.);\r
+  hcorr->GetYaxis()->SetTitleOffset(1.2);\r
+  hcorr->Draw();\r
+  eerr->Draw("3same");\r
+  hcorr->Draw("same");\r
+  allMC->Draw("same");\r
+  TLegend *myleg = new TLegend(0.3,0.7,0.9,0.9);\r
+  myleg->SetFillColor(0);\r
+  myleg->AddEntry(allMC,"MC Electrons","l");\r
+  myleg->AddEntry(hcorr,"Eff. corrected EMCAL N-P electrons","pl");\r
+  myleg->AddEntry(eerr,"Systematic uncertainty","f");\r
+  myleg->Draw();\r
+  lowerPad->cd();\r
+  TH1F* hmc = (TH1F*)allMC->Clone(); hmc->SetName("hmc");\r
+  hmc->Rebin(5); hmc->Scale(0.2);\r
+  TH1F* hmcratio = (TH1F*)hcorr->Clone();  hmcratio->SetName("hmcratio");\r
+  hmcratio->Divide(hmc);\r
+  hmcratio->SetTitle();\r
+  hmcratio->SetYTitle("MC/Data");\r
+  hmcratio->GetYaxis()->SetRangeUser(0.,2.);\r
+  hmcratio->GetYaxis()->SetNdivisions(505);\r
+  hmcratio->GetYaxis()->SetLabelSize(2.*hmcratio->GetYaxis()->GetLabelSize());\r
+  hmcratio->GetYaxis()->SetTitleSize(3.*hmcratio->GetYaxis()->GetTitleSize());\r
+  hmcratio->GetYaxis()->SetTitleOffset(0.3);\r
+  hmcratio->SetXTitle("");\r
+  hmcratio->GetXaxis()->SetLabelSize(2.*hmcratio->GetXaxis()->GetLabelSize());\r
+  hmcratio->Draw();\r
+  TGraphErrors* rerr = new TGraphErrors();\r
+  rerr->SetName("ratioErr");\r
+  count=0;\r
+  for(Int_t i = 1; i <= hmcratio->GetNbinsX(); i++) {\r
+    if (hmcratio->GetBinCenter(i) <10.0) continue;\r
+    if (hmcratio->GetBinCenter(i) >50.0) break;\r
+    rerr->SetPoint(count,hmcratio->GetBinCenter(i),hmcratio->GetBinContent(i));\r
+    rerr->SetPointError(count,0.,efinal*hmcratio->GetBinContent(i));\r
+    if(hmcratio->GetBinCenter(i) <20.0) rerr->SetPointError(count,0.,1.5*efinal*hmcratio->GetBinContent(i));\r
+    count++;\r
+  }\r
+  rerr->SetFillColor(kRed-8);\r
+  rerr->Draw("3same");\r
+  hmcratio->Draw("same");\r
+  TLine* line = new TLine(10.,1.,50.,1.);\r
+  line->SetLineStyle(2);\r
+  line->Draw();\r
+  ccomp->Print("EMCAL_NPE.pdf");\r
+  crates->cd();\r
 }\r
 \r