StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
prd2009QpT.C
1 
2 bool colorPlot;
3 TString iPathData;
4 
5 void prd2009QpT(bool x=false,TString y="/star/data01/pwg/stevens4/wAnalysis/xSecPaper/sl11b/data/",float canvasScale=1.0){
6 
7  TString cCore="Wprd_QPT";
8 
9  colorPlot=x;
10  iPathData=y;
11 
12  TString dataFinalRoot=iPathData+"run9setABCD.wana.hist.root";
13  TFile* fd=0;
14  fd=new TFile(dataFinalRoot); assert(fd->IsOpen());
15 
16  gStyle->SetFillStyle(0);
17  gStyle->SetPalette(1,0);
18  gStyle->SetOptStat(0);
19  gStyle->SetOptDate(0);
20  const Char_t *title = "High-energy electron charge separation with TPC";
21  c=new TCanvas(cCore,title,500*canvasScale,300*canvasScale);
22  c->SetTopMargin(0.05); c->SetBottomMargin(0.15);
23  c->SetRightMargin(0.04); c->SetLeftMargin(0.08);
24  gPad->SetGridy(false); gPad->SetGridx(false);
25  if(!colorPlot) c->SetGrayscale();
26 
27  h=pubchRecPNp;
28  //h->Draw("colz");
29 
30  TH1F* qPt_1D = (TH1F*)h->ProjectionY("name",26,100)->Clone();
31  qPt_1D->Rebin(); qPt_1D->SetLineWidth(2);
32  qPt_1D->SetTitle("; Lepton charge sign #times 1/p_{T} (c/GeV); Counts");
33  qPt_1D->SetMinimum(0.001);
34  qPt_1D->GetXaxis()->CenterTitle();
35  qPt_1D->GetXaxis()->SetTitleOffset(1.1);
36  qPt_1D->GetXaxis()->SetTitleSize(0.06);
37  qPt_1D->GetXaxis()->SetLabelSize(0.05);
38  qPt_1D->GetYaxis()->CenterTitle();
39  qPt_1D->GetYaxis()->SetTitleOffset(0.65);
40  qPt_1D->GetYaxis()->SetTitleSize(0.06);
41  qPt_1D->GetYaxis()->SetLabelSize(0.05);
42  qPt_1D->Draw();
43 
44  //add hatched histo for opposite charges
45  TH1F* minusHatch = (TH1F*)qPt_1D->Clone();
46  TH1F* plusHatch = (TH1F*)qPt_1D->Clone();
47  minusHatch->GetXaxis()->SetRangeUser(-0.1,-0.001);
48  minusHatch->SetFillStyle(3554); minusHatch->SetFillColor(kBlue);
49  minusHatch->Draw("same");
50  plusHatch->GetXaxis()->SetRangeUser(0.001,0.1);
51  plusHatch->SetFillStyle(3545); plusHatch->SetFillColor(kGreen);
52  plusHatch->Draw("same");
53 
54 
55  TLegend *leg = new TLegend(0.15,0.68,0.35,0.83);
56  leg->SetEntrySeparation(0.01);
57  leg->SetMargin(0.2);
58  leg->SetFillColor(0);
59  leg->SetTextSize(0.05);
60  leg->SetLineColor(0);
61  string extra=""; if(canvasScale>1.0) extra=" ";
62  leg->AddEntry(qPt_1D,Form("#splitline{ STAR 2009 Data}{ E_{T}^{e}>25 GeV and |%s#eta_{e}|<1}",extra),"");
63  leg->Draw("same");
64 
65  if(colorPlot) {
66  c->Print("/star/u/stevens4/wAnalysis/xSecPaper/plots/color/qPTcolor.eps");
67  c->Print("/star/u/stevens4/wAnalysis/xSecPaper/plots/color/qPTcolor.png");
68  }
69  else {
70  c->Print("/star/u/stevens4/wAnalysis/xSecPaper/plots/bw/qPTBW.eps");
71  c->Print("/star/u/stevens4/wAnalysis/xSecPaper/plots/bw/qPTBW.png");
72  }
73  return;
74 
75 }
76 
77