ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/CmsHi/JetAnalysis/macros/plotFigure.C
(Generate patch)

Comparing UserCode/CmsHi/JetAnalysis/macros/plotFigure.C (file contents):
Revision 1.3 by yilmaz, Mon Feb 4 22:02:40 2013 UTC vs.
Revision 1.6 by yilmaz, Wed Feb 13 12:47:54 2013 UTC

# Line 45 | Line 45 | void plotBalance(int cbin = 0,
45                   bool drawLeg = false);
46  
47  
48 < void drawText(const char *text, float xp, float yp);
48 > void drawText(const char *text, float xp, float yp, int size = 22);
49 > //void drawText(const char *text, float xp1, float yp1, float xp2, float yp2, int size);
50  
51   //--------------------------------------------------------------
52   // drawPatch() is a crazy way of removing 0 in the second and third
# Line 55 | Line 56 | void drawText(const char *text, float xp
56   void drawPatch(float x1, float y1, float x2, float y2);
57   //---------------------------------------------------------------------
58  
59 < void plotFigure(int iplot = 9){
59 > void plotFigure(int iplot = 0){
60    TString infname = "/d101/yetkin/analysis/d0204/ntuple_data_pPb_akPu3PF_forest71_20130204_01.root";
61 <  TString refname = "/d101/yetkin/analysis/d0204/ntuple_data_PbPb_akPu3PF_forest71_20130204_01.root";
61 >  TString refname = "/d101/yetkin/analysis/d0205/ntuple_data_PbPb_akPu3PF_forest71_20130205_01.root";
62    TString mixname = "/d101/yetkin/analysis/d0204/hijing.root";
63  
64 +  infname = "ntuple_data_pPb_akPu3PF_forest71_20130204_01.root";
65 +  refname = "ntuple_data_PbPb_akPu3PF_forest71_20130205_01.root";
66 +  mixname = "hijing.root";
67 +
68    string hfNames[] = {
69      "30<E_{T}^{HF[#eta > 4]}<70",
70      "20<E_{T}^{HF[#eta > 4]}<30",
# Line 90 | Line 95 | void plotFigure(int iplot = 9){
95     makeMultiPanelCanvas(c1,3,2,0.0,0.0,0.2,0.2,0.02);
96     TLatex *jetf_PbPb;
97  
98 <   if(iPlot == 3 || iPlot == 8 || iPlot == 11 || iPlot == 12){
98 >   if(iPlot == 3 || iPlot == 8 || iPlot == 11 || iPlot == 12 || iPlot == 13 || iPlot == 14){
99       for(int i = 0; i < 6; ++i){
100         c1->cd(i+1)->SetLogy();
101       }
# Line 99 | Line 104 | void plotFigure(int iplot = 9){
104  
105    c1->cd(1);
106  
102  jetf_PbPb = new TLatex(0.477,0.54,"Anti-k_{T} (PFlow), R=0.3");
103  jetf_PbPb->SetTextFont(63);
104  jetf_PbPb->SetTextSize(15);
105  jetf_PbPb->Draw();
106
107    for(int i = 0; i < 6; ++i){
108      c1->cd(6-i);
109      plotBalance(i,infname,refname,mixname,i==1,i==0);
110 <    double y1 = 0.07;
111 <    if(i < 3) y1 = 0.23;
112 <    y1=  0.9;
113 <    drawText(binNames[i].data(),0.3,y1);
114 <    //  drawText("(d)",0.25,0.92);
115 <  }
110 >    double y1 = 0.85;
111 >    double x1 = 0.5;
112  
113 <  c1->cd(2);
113 >    if(i == 2 || i == 5) x1 = 0.6;
114 >    drawText(binNames[i].data(),x1,y1);
115 >  }
116  
119  TLatex tsel;
120  tsel.SetNDC();
121  tsel.SetTextFont(63);
122  tsel.SetTextSize(15);
123  tsel.DrawLatex(0.15,0.75,Form("p_{T,1} > %d GeV/c",leadCut));
124  tsel.DrawLatex(0.15,0.65,Form("p_{T,2} > %d GeV/c",subleadCut));
125  tsel.DrawLatex(0.15,0.55,"#Delta#phi_{12} > #frac{2}{3}#pi");
117  
127  c1->cd(1);
128        
129  TLatex *cms = new TLatex(0.03,0.28,"CMS Preliminary");
130  if(iPlot == 3) cms = new TLatex(0.04,1.,"CMS Preliminary");
131  cms->SetTextFont(63);
132  cms->SetTextSize(17);
133  cms->Draw();
118  
119    c1->cd(1);
136  TLatex *lumi = new TLatex(0.1,0.26,"pPb L=10.6 nb^{-1}");
137  if(iPlot == 3) lumi = new TLatex(0.1,0.46,"pPb L=10.6 nb^{-1}");
138
139  lumi->SetTextFont(63);
140  lumi->SetTextSize(15);
141  lumi->Draw();
142
143  lumi = new TLatex(0.1,0.24,"PbPb L=150 #mub^{-1}");
144  if(iPlot == 3) lumi = new TLatex(0.1,0.14,"PbPb L=150 #mub^{-1}");
145
146  lumi->SetTextFont(63);
147  lumi->SetTextSize(15);
148  lumi->Draw();
120  
121 +  drawText("CMS Preliminary",0.22,0.9,18);  
122 +  drawText(Form("pPb %s",LUM_pPb),0.22,0.8,18);
123 +  if(iPlot == 0 || iPlot == 3) drawText(Form("PbPb %s",LUM_PbPb),0.22,0.7,18);
124  
125  
126    c1->cd(2);
127 <  TLatex *jetf_pp;
127 >  drawText("anti-k_{T} (R=0.3)",0.02,0.9,18);
128 >  drawText("PU subt. PF jets",0.02,0.8,18);
129 >  drawText("|#eta|<2",0.02,0.7,18);
130 >
131 >  c1->cd(3);
132 >  drawText(Form("p_{T,1} > %d GeV/c",leadCut),0.02,0.9,18);
133 >  drawText(Form("p_{T,2} > %d GeV/c",subleadCut),0.02,0.8,18);
134 >  drawText("#Delta#phi_{12} > #frac{2}{3}#pi",0.02,0.7,18);
135  
155  jetf_pp = new TLatex(0.12,0.24,"anti-k_{T}, (R=0.3) PF jets PU");
156
157  jetf_pp->SetTextFont(63);
158  jetf_pp->SetTextSize(15);
159  jetf_pp->Draw();
136  
137    const char* date = "20130127";
138  
139    string figures[150] = {"imbalance","etaDijet","",    "dphi","",
140                        "","",        "", "pudifference", "ntrk",
141 <                      "","pu1","pu2","","",
141 >                      "","pu1","pu2","trkMax1","trkMax2",
142                        "","","","","",
143                        "","eta1","eta2"
144    };
# Line 183 | Line 159 | void plotBalance(int cbin,
159                   bool drawLeg)
160   {
161  
162 +  bool showPbPb = 0;
163 +  if(iPlot == 0 || iPlot == 3) showPbPb = 1;
164 +
165    if(iPlot != 3) dijet = dijet&&deltaPhi;
166  
167    TCut centHF("");
168    TCut centNtrk("");
169  
170    if(centMode == 0){
171 +    cout<<"Obsolete centrality usage."<<endl;
172 +    return;
173      if(cbin==0) centHF = "bin>=20 && bin<26";
174      if(cbin==1) centHF = "bin>=26 && bin<27";
175      if(cbin==2) centHF = "bin>=27 && bin<28";
# Line 205 | Line 186 | void plotBalance(int cbin,
186    }
187  
188    if(centMode == 1){
189 <    if(cbin==0) centHF = "cent>=30 && cent<70";
209 <    if(cbin==1) centHF = "cent>=20 && cent<30";
210 <    if(cbin==2) centHF = "cent>=15 && cent<20";
211 <    if(cbin==3) centHF = "cent>=10 && cent<15";
212 <    if(cbin==4) centHF = "cent>=5 && cent<10";
213 <    if(cbin==5) centHF = "cent<5";
214 <
189 >    centHF = hfPlusBins[cbin];
190      centNtrk = centHF;
191    }
192  
218
219
220
221
193    cout<<"plotting ntrk bin : "<<cbin<<endl;
194  
195    // open the data file
# Line 293 | Line 264 | void plotBalance(int cbin,
264      max = 25;
265    };
266  
267 +  if(iPlot == 13 || iPlot == 14){
268 +    Nbin = 75;
269 +    max = 150;
270 +  }
271 +
272    if(iPlot == 101){
273      Nbin = 20;
274      max = 2;
# Line 386 | Line 362 | void plotBalance(int cbin,
362      ntMix->SetAlias("var","pu2");
363    }
364  
365 +  if(iPlot == 13){
366 +    nt->SetAlias("var","trkMax1");
367 +    ntReference->SetAlias("var","trkMax1");
368 +    ntMix->SetAlias("var","trkMax1");
369 +  }
370 +
371 +  if(iPlot == 14){
372 +    nt->SetAlias("var","trkMax2");
373 +    ntReference->SetAlias("var","trkMax2");
374 +    ntMix->SetAlias("var","trkMax2");
375 +  }
376 +
377    if(iPlot == 9){
378      nt->SetAlias("var","ntrk");
379      ntReference->SetAlias("var","ntrk");
# Line 513 | Line 501 | void plotBalance(int cbin,
501    if(iPlot==11) hDataMix->SetXTitle("p_{T,1}^{background}");
502    if(iPlot==12) hDataMix->SetXTitle("p_{T,2}^{background}");
503  
504 +  if(iPlot==13) hDataMix->SetXTitle("p_{T} leading track in leading jet");
505 +  if(iPlot==14) hDataMix->SetXTitle("p_{T} leading track in subleading jet");
506 +
507 +
508    if(drawXLabel){
509      if(iPlot==0) hDataMix->SetXTitle("p_{T,2}/p_{T,1}");
510      if(iPlot==3) hDataMix->SetXTitle("#Delta #phi_{1,2}");
# Line 557 | Line 549 | void plotBalance(int cbin,
549  
550          hDataMix->Draw();//"hist");
551          hDataMix->Draw("hist same");
552 <        //      hReference->Draw("same");
552 >        if(showPbPb) hReference->Draw("same");
553  
554          cout<<"PbPb ENTRIES : "<<endl;
555          cout<<hReference->GetEntries()<<endl;
# Line 582 | Line 574 | void plotBalance(int cbin,
574           cout<<" mean value of data "<<h->GetMean()<<endl;
575  
576    if(drawLeg){
577 <    TLegend *t3=new TLegend(0.06,0.6,0.53,0.95);
586 <
587 <    //   t3->AddEntry(h,Form("%s #mub^{-1}",LUM),"");
577 >    TLegend *t3=new TLegend(0.01,0.7,0.3,0.95);
578      t3->AddEntry(h,"pPb #sqrt{s}=5.02 TeV","p");
579 <    t3->AddEntry(hReference,"PbPb #sqrt{s}=2.76 TeV","p");
580 <    t3->AddEntry(hDataMix,"PYTHIA+HYDJET 1.8","lf");
579 >    if(showPbPb) t3->AddEntry(hReference,"PbPb #sqrt{s}=2.76 TeV","p");
580 >    t3->AddEntry(hDataMix,"PYTHIA+HIJING","lf");
581  
582      t3->SetFillColor(0);
583      t3->SetBorderSize(0);
# Line 607 | Line 597 | void drawPatch(float x1, float y1, float
597    t1->Draw("");
598   }
599  
600 < void drawText(const char *text, float xp, float yp){
600 > void drawText(const char *text, float xp, float yp, int size){
601    TLatex *tex = new TLatex(xp,yp,text);
602    tex->SetTextFont(63);
603 <  tex->SetTextSize(22);
614 <  //tex->SetTextSize(0.05);
603 >  tex->SetTextSize(size);
604    tex->SetTextColor(kBlack);
605    tex->SetLineWidth(1);
606    tex->SetNDC();
# Line 619 | Line 608 | void drawText(const char *text, float xp
608   }
609  
610  
611 +
612 +
613 +
614   void makeMultiPanelCanvas(TCanvas*& canv,
615                            const Int_t columns,
616                            const Int_t rows,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines