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.1 by yilmaz, Tue Jan 29 00:37:01 2013 UTC vs.
Revision 1.6 by yilmaz, Wed Feb 13 12:47:54 2013 UTC

# Line 1 | Line 1
1   #if !defined(__CINT__) || defined(__MAKECINT__)
2  
3   #include <iostream>
4 + #include <string>
5   #include "TCanvas.h"
6   #include "TError.h"
7   #include "TPad.h"
# Line 17 | Line 18
18   #include "TLatex.h"
19   #include "TString.h"
20  
21 + using namespace std;
22 +
23   #endif
24  
25 < #include "weightMix.C"
25 > #include "CommonParameters.h"
26  
27   static int iPlot = -99;
28  
29 + int centMode = 1;
30 + int entryMode = 0;
31  
32   //---------------------------------------------------------------------
33   void makeMultiPanelCanvas(TCanvas*& canv, const Int_t columns,
# Line 36 | Line 41 | void plotBalance(int cbin = 0,
41                   TString infname = "file1.root",
42                   TString refname = "file2.root",
43                   TString mixname = "file3.root",
39                 bool useWeight = true,
44                   bool drawXLabel = false,
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 51 | 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 = 3){
60 <  TString infname = "/d101/yetkin/analysis/d0128/data_pPb.root";
61 <  TString refname = "/d101/yetkin/analysis/d0128/data_PbPb.root";
62 <  TString mixname = "/d101/yetkin/analysis/d0128/mix_hydjet.root";
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/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",
71 >    "15<E_{T}^{HF[#eta > 4]}<20",
72 >    "10<E_{T}^{HF[#eta > 4]}<15",
73 >    "5<E_{T}^{HF[#eta > 4]}<10",
74 >    "0<E_{T}^{HF[#eta > 4]}<5"
75 >  };
76 >
77 >
78 >  string ntrkNames[] = {
79 >    "180 #leq N_{trk}^{offline}",
80 >    "150 #leq N_{trk}^{offline} < 180",
81 >    "110 #leq N_{trk}^{offline} < 150",
82 >    "90 #leq N_{trk}^{offline} < 110",
83 >    "60 #leq N_{trk}^{offline} < 90",
84 >    "N_{trk}^{offline} < 60"
85 >  };
86 >
87 >  string *binNames = hfNames;
88 >  if(centMode == 0) binNames = ntrkNames;
89  
90    iPlot = iplot;
91  
# Line 64 | Line 95 | void plotFigure(int iplot = 3){
95     makeMultiPanelCanvas(c1,3,2,0.0,0.0,0.2,0.2,0.02);
96     TLatex *jetf_PbPb;
97  
98 <   if(iplot == 3){
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 73 | Line 104 | void plotFigure(int iplot = 3){
104  
105    c1->cd(1);
106  
107 <  jetf_PbPb = new TLatex(0.477,0.54,"Anti-k_{T} (PFlow), R=0.3");
108 <  jetf_PbPb->SetTextFont(63);
109 <  jetf_PbPb->SetTextSize(15);
110 <  jetf_PbPb->Draw();
111 <
81 <  double y1 = 0.07;
82 <  plotBalance(5,infname,refname,mixname,true,false,false);
83 <  drawText("N_{trk}^{offline} < 60",0.6,y1);
84 <
85 <  c1->cd(2);
86 <
87 <  plotBalance(4,infname,refname,mixname,0,false,false);
88 <  drawText("60 #leq N_{trk}^{offline} < 90",0.4,y1);
89 <
90 <
91 <  c1->cd(3);
92 <
93 <  plotBalance(3,infname,refname,mixname,0,false,false);
94 <  drawText("90 #leq N_{trk}^{offline} < 110",0.4,y1);
95 <  //  drawText("(c)",0.05,0.885);
96 <
97 <
98 <  TLatex tsel;
99 <  tsel.SetNDC();
100 <  tsel.SetTextFont(63);
101 <  tsel.SetTextSize(15);
102 <  tsel.DrawLatex(0.15,0.75,Form("p_{T,1} > %d GeV/c",leadCut));
103 <  tsel.DrawLatex(0.15,0.65,Form("p_{T,2} > %d GeV/c",subleadCut));
104 <  tsel.DrawLatex(0.15,0.55,"#Delta#phi_{12} > #frac{2}{3}#pi");
105 <
106 <
107 <  double y2 = 0.23;
108 <
109 <  c1->cd(4);
110 <  plotBalance(2,infname,refname,mixname,0,false,false);
111 <  drawText("110 #leq N_{trk}^{offline} < 150",0.45,y2);
112 <  //  drawText("(d)",0.25,0.92);
113 <  
114 <
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.85;
111 >    double x1 = 0.5;
112  
113 <  c1->cd(5);
114 <  plotBalance(1,infname,refname,mixname,0,true,false);
118 <  drawText("150 #leq N_{trk}^{offline} < 180",0.42,y2);
119 <  //  drawText("(e)",0.05,0.92);
120 <
121 <  if(sideCorrect == 0){
122 <    jetf_PbPb = new TLatex(0.05,0.21,"Mismatched background not subtracted");
123 <    //    jetf_PbPb->Draw();
113 >    if(i == 2 || i == 5) x1 = 0.6;
114 >    drawText(binNames[i].data(),x1,y1);
115    }
116  
126  c1->cd(6);
127  plotBalance(0,infname,refname,mixname,0,false,1);
128  drawText("180 #leq N_{trk}^{offline}",0.45,y2);
129  //  drawText("(f)",0.05,0.92);
117  
131  c1->cd(1);
132        
133  TLatex *cms = new TLatex(0.03,0.28,"CMS Preliminary");
134  if(iPlot == 3) cms = new TLatex(0.04,1.,"CMS Preliminary");
135  cms->SetTextFont(63);
136  cms->SetTextSize(17);
137  cms->Draw();
118  
119    c1->cd(1);
140  TLatex *lumi = new TLatex(0.1,0.26,"pPb L=10.6 nb^{-1}");
141  if(iPlot == 3) lumi = new TLatex(0.1,0.46,"pPb L=10.6 nb^{-1}");
142
143  lumi->SetTextFont(63);
144  lumi->SetTextSize(15);
145  lumi->Draw();
146
147  lumi = new TLatex(0.1,0.24,"PbPb L=150 #mub^{-1}");
148  if(iPlot == 3) lumi = new TLatex(0.1,0.14,"PbPb L=150 #mub^{-1}");
149
150  lumi->SetTextFont(63);
151  lumi->SetTextSize(15);
152  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 <  jetf_pp = new TLatex(0.12,0.24,"anti-k_{T}, (R=0.3) PF jets PU");
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  
161  jetf_pp->SetTextFont(63);
162  jetf_pp->SetTextSize(15);
163  jetf_pp->Draw();
136  
137    const char* date = "20130127";
138 <  string figures[] = {"imbalance","","","dphi"};
138 >
139 >  string figures[150] = {"imbalance","etaDijet","",    "dphi","",
140 >                      "","",        "", "pudifference", "ntrk",
141 >                      "","pu1","pu2","trkMax1","trkMax2",
142 >                      "","","","","",
143 >                      "","eta1","eta2"
144 >  };
145 >
146    string formats[] = {"gif","pdf","eps","C"};
147  
148    for(int it = 0; it < 4; ++it){
# Line 176 | Line 155 | void plotBalance(int cbin,
155                   TString infname,
156                   TString pythia,
157                   TString mix,
179                 bool useWeight,
158                   bool drawXLabel,
159                   bool drawLeg)
160   {
161  
162 <  useWeight = 1;
163 <
186 <  bool refOldNtuple = 0;
187 <  TCut lead(Form("pt1>%d && abs(eta1) < 2",leadCut));
188 <  TCut dijet(Form("pt1>%d && pt2>%d && abs(eta1) < 2 && abs(eta2) < 2",leadCut,subleadCut));
189 <
190 <  TCut deltaPhi("abs(dphi)>2.0944");
162 >  bool showPbPb = 0;
163 >  if(iPlot == 0 || iPlot == 3) showPbPb = 1;
164  
165    if(iPlot != 3) dijet = dijet&&deltaPhi;
166  
194  TCut side(Form("pt1>%d && pt2>%d && abs(dphi)>%f && abs(dphi)<%f && abs(eta1) < 2 && abs(eta2) < 2",leadCut,subleadCut, sideMin, sideMax));
195
196  TCut jetID("trkMax1 > 4 || trkMax2 > 4");
197  //  jetID = "trkMax1 > -99999";
198  TCut noise("noise < 0");
199  TCut weight("weight");
200
201
202  double sideScale = sideCorrect*(3.1415926536-2.0944)/(sideMax-sideMin);
203
204  TString cstring = "";
205
167    TCut centHF("");
168    TCut centNtrk("");
169  
170 <  if(cbin==0) centHF = "bin>=20 && bin<26";
171 <  if(cbin==1) centHF = "bin>=26 && bin<27";
172 <  if(cbin==2) centHF = "bin>=27 && bin<28";
173 <  if(cbin==3) centHF = "bin>=28 && bin<29";
174 <  if(cbin==4) centHF = "bin>=29 && bin<31";
175 <  if(cbin==5) centHF = "bin>=31";
176 <
177 <  if(cbin==0) centNtrk = "ntrk >= 180";
178 <  if(cbin==1) centNtrk = "150 <= ntrk && ntrk < 180";
179 <  if(cbin==2) centNtrk = "110 <= ntrk && ntrk < 150";
180 <  if(cbin==3) centNtrk = "90 <= ntrk && ntrk < 150";
181 <  if(cbin==4) centNtrk = "60 <= ntrk && ntrk < 90";
182 <  if(cbin==5) centNtrk = "ntrk < 60";
183 <
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";
176 >    if(cbin==3) centHF = "bin>=28 && bin<29";
177 >    if(cbin==4) centHF = "bin>=29 && bin<31";
178 >    if(cbin==5) centHF = "bin>=31";
179 >
180 >    if(cbin==0) centNtrk = "ntrk >= 180";
181 >    if(cbin==1) centNtrk = "150 <= ntrk && ntrk < 180";
182 >    if(cbin==2) centNtrk = "110 <= ntrk && ntrk < 150";
183 >    if(cbin==3) centNtrk = "90 <= ntrk && ntrk < 150";
184 >    if(cbin==4) centNtrk = "60 <= ntrk && ntrk < 90";
185 >    if(cbin==5) centNtrk = "ntrk < 60";
186 >  }
187 >
188 >  if(centMode == 1){
189 >    centHF = hfPlusBins[cbin];
190 >    centNtrk = centHF;
191 >  }
192  
193    cout<<"plotting ntrk bin : "<<cbin<<endl;
194  
195    // open the data file
196 +
197 +  if(iPlot > 100) entryMode = 1;
198 +
199 +  string treeName = "ntdijet";
200 +  string wName = "ntw";
201 +  if(entryMode == 1){
202 +    treeName = "ntjet";
203 +    wName = "ntjetw";
204 +  }
205 +
206 +  if(entryMode == 2){
207 +    treeName = "nttrk";
208 +    wName = "nttrkw";
209 +  }
210 +
211    TFile *inf = new TFile(infname.Data());
212 <  TTree *nt =(TTree*)inf->FindObjectAny("ntdijet");
212 >  TTree *nt =(TTree*)inf->FindObjectAny(treeName.data());
213    TTree *ntevt =(TTree*)inf->FindObjectAny("ntevt");
214 <  nt->AddFriend(ntevt);
214 >  if(entryMode < 1) nt->AddFriend(ntevt);
215  
216    // open the pythia (MC) file
217 <  TFile *infPythia = new TFile(pythia.Data());
218 <  TTree *ntPythia;
219 <  TTree *ntevtPythia;
220 <  if(!refOldNtuple){
221 <    ntPythia = (TTree*) infPythia->FindObjectAny("ntdijet");
222 <    ntevtPythia = (TTree*) infPythia->FindObjectAny("ntevt");
223 <    ntPythia->AddFriend(ntevtPythia);
224 <  }else{
241 <    ntPythia = (TTree*) infPythia->FindObjectAny("nt");
242 <  }
243 <
217 >  TFile *infReference = new TFile(pythia.Data());
218 >  TTree *ntReference;
219 >  TTree *ntevtReference;
220 >
221 >  ntReference = (TTree*) infReference->FindObjectAny(treeName.data());
222 >  ntevtReference = (TTree*) infReference->FindObjectAny("ntevt");
223 >  if(entryMode < 1) ntReference->AddFriend(ntevtReference);
224 >  
225    // open the datamix file
226    TFile *infMix = new TFile(mix.Data());
227 <  TTree *ntMix =(TTree*)infMix->FindObjectAny("ntdijet");
227 >  TTree *ntMix =(TTree*)infMix->FindObjectAny(treeName.data());
228    TTree *ntevtMix =(TTree*)infMix->FindObjectAny("ntevt");
229    //  TFile *infW = new TFile("weights_hydjet.root");
230    //  TTree *ntw =(TTree*)infW->FindObjectAny("ntw");
231  
232 <  TTree *ntw =(TTree*)infMix->FindObjectAny("ntw");
232 >  TTree *ntw =(TTree*)infMix->FindObjectAny(wName.data());
233    ntMix->AddFriend(ntw);
234 <  ntMix->AddFriend(ntevtMix);
234 >  if(entryMode < 1) ntMix->AddFriend(ntevtMix);
235  
236    int Nbin = 10;
237    double max = 1.;
238 +  double min = 0;
239 +
240 +  if(iPlot == 1 || iPlot == 21 || iPlot == 22){
241 +    Nbin = 20;
242 +    max = 2;
243 +    min = -2;
244 +  };
245  
246    if(iPlot == 3){
247      Nbin = 30;
248      max = pi;
249    };
250  
251 +  if(iPlot == 8){
252 +    Nbin = 50;
253 +    max = 25;
254 +    min = -25;
255 +  };
256 +
257 +  if(iPlot == 9){
258 +    Nbin = 50;
259 +    max = 250;
260 +  };
261 +
262 +  if(iPlot == 11 || iPlot == 12){
263 +    Nbin = 50;
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;
275 +    min = -2;
276 +  }
277  
278    // projection histogram
279 <  TH1D *h = new TH1D(Form("h",cbin),"",Nbin,0,max);
280 <  TH1D *hPythia = new TH1D(Form("hPythia",cbin),"",Nbin,0,max);
281 <  TH1D *hDataMix = new TH1D(Form("hDataMix",cbin),"",Nbin,0,max);
282 <
283 <  TH1D *hB = new TH1D(Form("hB",cbin),"",Nbin,0,max);
284 <  TH1D *hPythiaB = new TH1D(Form("hPythiaB",cbin),"",Nbin,0,max);
285 <  TH1D *hDataMixB = new TH1D(Form("hDataMixB",cbin),"",Nbin,0,max);
286 <
287 <  TH1D *hFull = new TH1D("hFull","",Nbin,0,max);
288 <  TH1D *hPythiaFull = new TH1D("hPythiaFull","",Nbin,0,max);
289 <  TH1D *hDataMixFull = new TH1D("hDataMixFull","",Nbin,0,max);
279 >  TH1D *h = new TH1D(Form("h",cbin),"",Nbin,min,max);
280 >  TH1D *hReference = new TH1D(Form("hReference",cbin),"",Nbin,min,max);
281 >  TH1D *hDataMix = new TH1D(Form("hDataMix",cbin),"",Nbin,min,max);
282 >
283 >  TH1D *hB = new TH1D(Form("hB",cbin),"",Nbin,min,max);
284 >  TH1D *hReferenceB = new TH1D(Form("hReferenceB",cbin),"",Nbin,min,max);
285 >  TH1D *hDataMixB = new TH1D(Form("hDataMixB",cbin),"",Nbin,min,max);
286 >
287 >  TH1D *hFull = new TH1D("hFull","",Nbin,min,max);
288 >  TH1D *hReferenceFull = new TH1D("hReferenceFull","",Nbin,min,max);
289 >  TH1D *hDataMixFull = new TH1D("hDataMixFull","",Nbin,min,max);
290  
291    TH1D* hNorm = new TH1D("hNorm","",1000,0,1000);
292 <  TH1D* hNormPythia = new TH1D("hNormPythia","",1000,0,1000);
292 >  TH1D* hNormReference = new TH1D("hNormReference","",1000,0,1000);
293    TH1D* hNormDataMix = new TH1D("hNormDataMix","",1000,0,1000);
294  
295    hB->SetLineStyle(2);
296 <  hPythiaB->SetLineStyle(2);
296 >  hReferenceB->SetLineStyle(2);
297    hDataMixB->SetLineStyle(2);
298  
299 <  //  ntPythia->SetAlias("pt1","et1");
300 <  //  ntPythia->SetAlias("pt2","et2");
299 >  //  ntReference->SetAlias("pt1","et1");
300 >  //  ntReference->SetAlias("pt2","et2");
301  
302    nt->SetAlias("pt1","jtpt1");
303    nt->SetAlias("pt2","jtpt2");
# Line 291 | Line 305 | void plotBalance(int cbin,
305    nt->SetAlias("eta2","jteta2");
306    nt->SetAlias("phi1","jtphi1");
307    nt->SetAlias("phi2","jtphi2");
294
308    ntMix->SetAlias("pt1","jtpt1");
309    ntMix->SetAlias("pt2","jtpt2");
310    ntMix->SetAlias("eta1","jteta1");
311    ntMix->SetAlias("eta2","jteta2");
312    ntMix->SetAlias("phi1","jtphi1");
313    ntMix->SetAlias("phi2","jtphi2");
314 <
315 <
316 <  if(!refOldNtuple){
317 <    ntPythia->SetAlias("pt1","jtpt1");
318 <    ntPythia->SetAlias("pt2","jtpt2");
319 <    ntPythia->SetAlias("eta1","jteta1");
320 <    ntPythia->SetAlias("eta2","jteta2");
321 <    ntPythia->SetAlias("phi1","jtphi1");
322 <    ntPythia->SetAlias("phi2","jtphi2");
323 <  }
314 >  ntReference->SetAlias("pt1","jtpt1");
315 >  ntReference->SetAlias("pt2","jtpt2");
316 >  ntReference->SetAlias("eta1","jteta1");
317 >  ntReference->SetAlias("eta2","jteta2");
318 >  ntReference->SetAlias("phi1","jtphi1");
319 >  ntReference->SetAlias("phi2","jtphi2");
320 >
321 >  nt->SetAlias("cent","hfp");
322 >  ntMix->SetAlias("cent","hfp");
323 >  ntReference->SetAlias("cent","hfp");
324  
325    nt->SetAlias("dphi","acos(cos(phi1-phi2))");
326    ntMix->SetAlias("dphi","acos(cos(phi1-phi2))");
327 <  ntPythia->SetAlias("dphi","acos(cos(phi1-phi2))");
327 >  ntReference->SetAlias("dphi","acos(cos(phi1-phi2))");
328  
329    if(iPlot == 0){
330      nt->SetAlias("var","pt2/pt1");
331 <    ntPythia->SetAlias("var","pt2/pt1");
331 >    ntReference->SetAlias("var","pt2/pt1");
332      ntMix->SetAlias("var","pt2/pt1");
333    }
334  
335 +  if(iPlot == 1){
336 +    nt->SetAlias("var","(eta1+eta2)/2");
337 +    ntReference->SetAlias("var","(eta1+eta2)/2");
338 +    ntMix->SetAlias("var","(eta1+eta2)/2");
339 +  }
340 +
341    if(iPlot == 3){
342      nt->SetAlias("var","acos(cos(phi1-phi2))");
343 <    ntPythia->SetAlias("var","acos(cos(phi1-phi2))");
343 >    ntReference->SetAlias("var","acos(cos(phi1-phi2))");
344      ntMix->SetAlias("var","acos(cos(phi1-phi2))");
345    }
346  
347    if(iPlot == 8){
348 <    nt->SetAlias("var","pu2/pu1");
349 <    ntPythia->SetAlias("var","pu2/pu1");
350 <    ntMix->SetAlias("var","pu2/pu1");
348 >    nt->SetAlias("var","pu1-pu2");
349 >    ntReference->SetAlias("var","pu1-pu2");
350 >    ntMix->SetAlias("var","pu1-pu2");
351 >  }
352 >
353 >  if(iPlot == 11){
354 >    nt->SetAlias("var","pu1");
355 >    ntReference->SetAlias("var","pu1");
356 >    ntMix->SetAlias("var","pu1");
357 >  }
358 >
359 >  if(iPlot == 12){
360 >    nt->SetAlias("var","pu2");
361 >    ntReference->SetAlias("var","pu2");
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");
380 >    ntMix->SetAlias("var","ntrk");
381 >  }
382 >
383 >  if(iPlot == 21){
384 >    nt->SetAlias("var","eta1");
385 >    ntReference->SetAlias("var","eta1");
386 >    ntMix->SetAlias("var","eta1");
387 >  }
388 >
389 >  if(iPlot == 22){
390 >    nt->SetAlias("var","eta2");
391 >    ntReference->SetAlias("var","eta2");
392 >    ntMix->SetAlias("var","eta2");
393 >  }
394 >
395 >
396 >
397 >  if(iPlot == 101){
398 >    nt->SetAlias("var","eta");
399 >    ntReference->SetAlias("var","eta");
400 >    ntMix->SetAlias("var","eta");
401 >  }
402 >
403 >  if(iPlot == 51){
404 >    nt->SetAlias("var","matchPt1/pt1");
405 >    ntReference->SetAlias("var","matchPt1/pt1");
406 >    ntMix->SetAlias("var","matchPt1/pt1");
407    }
408  
409 <  nt->Draw("var>>hFull",dijet&&noise&&jetID&&centNtrk);
410 <  nt->Draw("var>>hB",side&&noise&&jetID&&centNtrk);
411 <  nt->Draw("pt1>>hNorm",lead&&noise&&jetID&&centNtrk);
409 >  if(iPlot == 52){
410 >    nt->SetAlias("var","matchPt2/pt2");
411 >    ntReference->SetAlias("var","matchPt2/pt2");
412 >    ntMix->SetAlias("var","matchPt2/pt2");
413 >  }
414 >
415 >
416 >  nt->Draw("var>>hFull",dijet&&noise&&jetID&&centHF&&vtx);
417 >  nt->Draw("var>>hB",side&&noise&&jetID&&centHF&&vtx);
418 >  nt->Draw("pt1>>hNorm",lead&&noise&&jetID&&centHF&&vtx);
419    
420 <  ntMix->Draw("var>>hDataMixFull",weight*(dijet&&jetID&&centHF));
421 <  ntMix->Draw("var>>hDataMixB",weight*(side&&jetID&&centHF));
422 <  ntMix->Draw("pt1>>hNormDataMix",weight*(lead&&jetID&&centHF));
420 >  ntMix->Draw("var>>hDataMixFull",weight*(dijet&&jetID&&centHF&&vtx));
421 >  ntMix->Draw("var>>hDataMixB",weight*(side&&jetID&&centHF&&vtx));
422 >  ntMix->Draw("pt1>>hNormDataMix",weight*(lead&&jetID&&centHF&&vtx));
423    
424 <  ntPythia->Draw("var>>hPythiaFull",dijet&&noise&&jetID&&centHF);
425 <  ntPythia->Draw("var>>hPythiaB",side&&noise&&jetID&&centHF);
426 <  ntPythia->Draw("pt1>>hNormPythia",lead&&noise&&jetID&&centHF);
345 <
346 <  hDataMixB->Scale(sideScale);
347 <  hB->Scale(sideScale);
348 <  hPythiaB->Scale(sideScale);
424 >  ntReference->Draw("var>>hReferenceFull",dijet&&noise&&jetID&&centHF&&vtx);
425 >  ntReference->Draw("var>>hReferenceB",side&&noise&&jetID&&centHF&&vtx);
426 >  ntReference->Draw("pt1>>hNormReference",lead&&noise&&jetID&&centHF&&vtx);
427  
428    hDataMix->Add(hDataMixFull);
429    h->Add(hFull);
430 <  hPythia->Add(hPythiaFull);
430 >  hReference->Add(hReferenceFull);
431  
432    if(subtract){
433      hDataMix->Add(hDataMixB,-1);
434      h->Add(hB,-1);
435 <    hPythia->Add(hPythiaB,-1);
435 >    hReference->Add(hReferenceB,-1);
436    }
437  
438    hB->SetFillStyle(3005);
# Line 373 | Line 451 | void plotBalance(int cbin,
451    }
452    h->SetMarkerStyle(20);
453  
454 <  if(hPythia->Integral() > 0){
455 <    hPythia->Scale(1./hNormPythia->Integral());
454 >  if(hReference->Integral() > 0){
455 >    hReference->Scale(1./hNormReference->Integral());
456    }
457  
458 <  hPythia->SetLineColor(kBlue);
459 <  hPythia->SetFillColor(kAzure-8);
460 <  hPythia->SetFillStyle(3005);
458 >  hReference->SetLineColor(kBlue);
459 >  hReference->SetFillColor(kAzure-8);
460 >  hReference->SetFillStyle(3005);
461  
462    if(normLead){
463      hDataMixB->Scale(1./hNormDataMix->Integral());
# Line 413 | Line 491 | void plotBalance(int cbin,
491    if(drawXLabel) hDataMix->SetXTitle("A_{J} = (p_{T,1}-p_{T,2})/(p_{T,1}+p_{T,2})");  
492    hDataMix->SetYTitle("Event Fraction");
493  
494 <  if(iPlot==9)hDataMix->SetXTitle("p_{T,2}^{background}/p_{T,1}^{background}");
494 >  if(iPlot==1) hDataMix->SetXTitle("#eta_{dijet} = (#eta_{1}+#eta_{2})/2");
495 >  if(iPlot==21) hDataMix->SetXTitle("#eta_{1}");
496 >  if(iPlot==22) hDataMix->SetXTitle("#eta_{2}");
497 >
498 >  if(iPlot==8) hDataMix->SetXTitle("p_{T,1}^{background}-p_{T,2}^{background}");
499 >  if(iPlot==9) hDataMix->SetXTitle("N_{trk}^{offline}");
500 >
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}");
# Line 421 | Line 511 | void plotBalance(int cbin,
511    }
512  
513    if(iPlot==0) hDataMix->SetMaximum(0.32);
514 +
515 +  if(iPlot == 1 || iPlot==21 || iPlot==22){
516 +    hDataMix->SetMaximum(0.3);
517 +    hDataMix->SetMinimum(0);
518 +  }
519 +
520 +
521    if(iPlot==3){
522      hDataMix->SetMaximum(2.52);
523      hDataMix->SetMinimum(0.00004);
524    }
525  
526 +  if(iPlot==8){
527 +    hDataMix->SetMaximum(10);
528 +    hDataMix->SetMinimum(0.00004);
529 +  }
530 +
531 +  if(iPlot==9){
532 +    hDataMix->SetMaximum(0.15);
533 +    hDataMix->SetMinimum(0.);
534 +  }
535 +
536 +  if(iPlot==11 || iPlot == 12){
537 +    hDataMix->SetMaximum(10);
538 +    hDataMix->SetMinimum(0.00004);
539 +  }
540 +
541 +
542 +
543    //hDataMix->GetXaxis()->SetNdivisions(905,true);
544    hDataMix->GetYaxis()->SetNdivisions(505,true);
545  
546 <  hPythia->SetMarkerColor(ppColor);
547 <  hPythia->SetLineColor(ppColor);
548 <  hPythia->SetMarkerStyle(24);
546 >  hReference->SetMarkerColor(ppColor);
547 >  hReference->SetLineColor(ppColor);
548 >  hReference->SetMarkerStyle(25);
549  
550          hDataMix->Draw();//"hist");
551          hDataMix->Draw("hist same");
552 <        hPythia->Draw("same");
552 >        if(showPbPb) hReference->Draw("same");
553  
554          cout<<"PbPb ENTRIES : "<<endl;
555 <        cout<<hPythia->GetEntries()<<endl;
555 >        cout<<hReference->GetEntries()<<endl;
556  
557          cout<<"PbPb integral : "<<endl;
558 <        cout<<hPythia->Integral()<<endl;
558 >        cout<<hReference->Integral()<<endl;
559  
560          cout<<"pPb integral : "<<endl;
561          cout<<h->Integral()<<endl;
# Line 460 | 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);
464 <
465 <    //   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(hPythia,"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 485 | 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);
492 <  //tex->SetTextSize(0.05);
603 >  tex->SetTextSize(size);
604    tex->SetTextColor(kBlack);
605    tex->SetLineWidth(1);
606    tex->SetNDC();
# Line 497 | 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