5 #if !defined(__CINT__) || defined(__MAKECINT__)
22 #include "TSpectrum.h"
29 #include "TPolyMarker.h"
31 #include "TDataSetIter.h"
59 const Int_t NfitPtsHist = 7;
105 static Float_t refMult;
106 const Char_t *GP[2] = {
"Gl",
"Pr"};
107 const Char_t *GPTitle[2] = {
"Global",
"Primary"};
108 static TString NameEffpT[4] = {
"pTnew",
"pTold",
"pTOnew",
"pTOold"};
109 static TString NameEffPhi[4] = {
"Phinew",
"Phiold",
"PhiOnew",
"PhiOold"};
110 const Int_t minNFP = 10;
111 const Int_t effNFP = 15;
112 static TString Old(
"Old");
113 static TString New(
"New");
114 const Char_t *charge[2] = {
"pos",
"neg"};
115 TFile *fIn = (TFile *) gDirectory;
119 void DrawPng(TCanvas *c) {
120 static Int_t nPng = 0;
123 c->Update(); pngName = c->GetName();
124 pngName.ReplaceAll(
" ",
"_");
125 pngName.ReplaceAll(
"(",
"_");
126 pngName.ReplaceAll(
")",
"_");
127 pngName.ReplaceAll(
"{",
"_");
128 pngName.ReplaceAll(
"}",
"_");
129 pngName.ReplaceAll(
"<",
"lt");
130 pngName.ReplaceAll(
">",
"gt");
131 pngName.ReplaceAll(
"old_new_",
"");
132 pngName.ReplaceAll(
"old_new",
"");
133 pngName.ReplaceAll(
"Old_New_",
"");
134 pngName.ReplaceAll(
"Old_New",
"");
135 pngName.ReplaceAll(
"GeV/c",
"");
136 pngName.ReplaceAll(
".",
"_");
137 pngName.ReplaceAll(
"/",
"_");
138 pngName.ReplaceAll(
"^",
"_");
139 pngName.ReplaceAll(
"__",
"_");
140 pngName.ReplaceAll(
"__",
"_");
141 pngName.ReplaceAll(
"#",
"");
145 cout <<
"Draw #\t" << nPng <<
"\t" << pngName << endl;
148 void DrawFitPnts(Int_t ping=0) {
153 TString Name(
"fitPtsHist");
154 if (ping) Name +=
"Ping";
155 TH2F* fitPtsHist = (TH2F*) fIn->Get(Name);
156 if (! fitPtsHist)
return;
158 cTitle +=
"Fit Points Corr";
159 if (ping) cTitle +=
" Matched";
160 c1 =
new TCanvas(cTitle,cTitle,400,400); c1->SetLeftMargin(0.14);
162 fitPtsHist->SetStats(0);
163 fitPtsHist->GetXaxis()->SetRange(0,46);
165 fitPtsHist->Draw(
"colz");
166 Int_t nx = fitPtsHist->GetNbinsX();
167 Int_t ny = fitPtsHist->GetNbinsY();
168 Double_t meanX = 0, meanY = 0;
169 Double_t X = 0, Y = 0;
170 for (Int_t ix = 1; ix <= nx; ix++) {
171 Double_t x = fitPtsHist->GetXaxis()->GetBinCenter(ix);
172 for (Int_t iy = 1; iy <= ny; iy++) {
173 Double_t y = fitPtsHist->GetYaxis()->GetBinCenter(iy);
174 Double_t cont = fitPtsHist->GetBinContent(ix,iy);
175 if (x >= effNFP) {X += cont; meanX += x*cont;}
176 if (y >= effNFP) {Y += cont; meanY += y*cont;}
179 if (X > 0) meanX /= X;
180 if (Y > 0) meanY /= Y;
181 TLegend* leg2 =
new TLegend(0.12,.85,.95,.95);
182 leg2->SetTextSize(0.033);
183 fitPtsHist->SetMarkerStyle(20);
184 TProfile *pfx = fitPtsHist->ProfileX(
"_pfx",2,-1,
"e"); pfx->Draw(
"same");
185 fitPtsHist->SetMarkerColor(0);
186 TProfile *pfy = fitPtsHist->ProfileY(
"_pfy",2,-1,
"e"); pfy->Draw(
"same");
187 leg2->AddEntry(pfy,Form(
"profY, <fit points. %s> = %7.2f for NFP >= %i",New.Data(),meanX,effNFP));
188 leg2->AddEntry(pfx,Form(
"profX, <fit points. %s> = %7.2f for NFP >= %i",Old.Data(),meanY,effNFP));
190 fitPtsHist->SetMarkerColor(1);
194 void DrawRelMomDifNft(Int_t k=0, Int_t kase=0) {
199 if (kase == 0)
for (Int_t c = 0; c < 2; c++) pTDifNFP[c] = (TH2F *) fIn->Get(Form(
"pTDifNFP%s%s",GP[k],charge[c]));
200 else for (Int_t c = 0; c < 2; c++) pTDifNFP[c] = (TH2F *) fIn->Get(Form(
"pTDifNFP5%s%s",GP[k],charge[c]));
201 if (! pTDifNFP[0] || ! pTDifNFP[1])
return;
202 if (pTDifNFP[0]->GetEntries() <100 || pTDifNFP[1]->GetEntries() <100)
return;
204 cTitle +=
"P diff vs NoFitPnts for "; cTitle += GPTitle[k];
205 if (kase) cTitle +=
" with pT > 0.5 GeV/c";
206 c1 =
new TCanvas(cTitle,cTitle,400,400); c1->SetLeftMargin(0.14);
207 TString cTitle2(cTitle);
209 TCanvas* c2 =
new TCanvas(cTitle2,cTitle2,400,400); c2->SetLeftMargin(0.14);
210 TString cTitle3(cTitle);
212 TCanvas* c3 =
new TCanvas(cTitle3,cTitle3,400,400); c3->SetLeftMargin(0.14);
213 Double_t ymax = pTDifNFP[0]->GetMaximum();
214 if (pTDifNFP[1]->GetMaximum() > ymax) ymax = pTDifNFP[1]->GetMaximum();
219 TLegend* leg2 =
new TLegend(0.72,.4,1,1);
220 leg2->SetBorderSize(0);
221 leg2->SetFillColor(0);
222 leg2->SetTextSize(0.033);
223 Int_t nx = pTDifNFP[0]->GetNbinsX();
226 for (Int_t i = 1; i <= nx; i++) {
227 for (Int_t c = 0; c < 2; c++) {
228 proj = pTDifNFP[c]->ProjectionY(Form(
"%s_prj_%i",pTDifNFP[c]->GetName(),i),i,i,
"e");
230 proj->SetMaximum(1.1*ymax);
231 proj->SetMinimum(10);
232 proj->SetMarkerColor(i+1);
233 proj->SetMarkerStyle(20+c);
234 proj->SetTitle(pTDifNFP[c]->GetYaxis()->GetTitle());
235 proj->Draw(opt); opt =
"esame";
236 Int_t xmin = (Int_t) pTDifNFP[c]->GetXaxis()->GetBinLowEdge(i);
237 Int_t xmax = (Int_t) pTDifNFP[c]->GetXaxis()->GetBinUpEdge(i);
238 leg2->AddEntry(proj,Form(
"%s %i<Nfp <%i",charge[c],xmin,xmax));
239 cout << i <<
")" << charge[c] <<
" = [" << xmin <<
"," << xmax <<
"] Mean, RMS "
240 << proj->GetMean() <<
", " << proj->GetRMS() << endl;
246 TLegend* leg7 =
new TLegend(0.62,.65,.85,.85);
247 leg7->SetBorderSize(0);
248 leg7->SetFillColor(0);
249 leg7->SetTextSize(0.033);
250 TLegend* leg8 =
new TLegend(0.62,.65,.85,.85);
251 leg8->SetBorderSize(0);
252 leg8->SetFillColor(0);
253 leg8->SetTextSize(0.033);
257 for (Int_t c = 0; c < 2; c++) {
258 pTDifNFP[c]->FitSlicesY();
259 name = pTDifNFP[c]->GetName(); name +=
"_1";
260 TH1 *mu = (TH1 *) fIn->Get(name);
261 TH1 *sigma = (TH1 *) fIn->Get(name);
262 if (mu->GetMaximum() > ymax) ymax = mu->GetMaximum();
263 if (mu->GetMinimum() < ymin) ymin = mu->GetMinimum();
264 if (sigma->GetMaximum() > smax) smax = sigma->GetMaximum();
266 for (Int_t c = 0; c < 2; c++) {
268 pTDifNFP[c]->FitSlicesY();
269 name = pTDifNFP[c]->GetName(); name +=
"_1";
270 TH1 *mu = (TH1 *) fIn->Get(name); mu->SetMaximum(1.1*ymax);
if (ymin < 0) mu->SetMinimum(1.1*ymin);
271 mu->SetMarkerStyle(20);
272 mu->SetMarkerColor(1+c);
275 leg7->AddEntry(mu,charge[c],
"p");
276 TString X(pTDifNFP[c]->GetYaxis()->GetTitle());
278 T += X; T +=
" "; T += GP[k];
if (kase) T +=
" with pT > 0.5 GeV/c";
279 mu->SetTitle(T.Data());
281 else mu->Draw(
"same");
283 name = pTDifNFP[c]->GetName(); name +=
"_2";
284 TH1 *sigma = (TH1 *) fIn->Get(name);
285 sigma->SetMarkerStyle(20);
286 sigma->SetMarkerColor(1+c);
289 leg8->AddEntry(sigma,charge[c],
"p");
291 T += X; T +=
" "; T += GP[k];
if (kase) T +=
" with pT > 0.5 GeV/c";
292 sigma->SetTitle(T.Data());
293 if (! c) sigma->Draw();
294 else sigma->Draw(
"same");
296 c2->cd(); leg7->Draw();
297 c3->cd(); leg8->Draw();
303 void EffRefMult(Int_t k = 0) {
309 for (Int_t i = 0; i < 4; i++) {
310 pTEf[i] = (TH2F *) fIn->Get(Form(
"%s%s",NameEffpT[i].Data(),GP[k]));
311 if (! pTEf[i])
continue;
312 Double_t y = pTEf[i]->GetMaximum();
313 if (y > ymax) ymax = y;
316 if (ymax < 100)
return;
317 cTitle = gTitle; cTitle += GP[k];
318 TString hTitle(
"Momentum Dist"); hTitle +=
" for "; hTitle += GPTitle[k];
319 cTitle +=
" "; cTitle += hTitle;
320 c1 =
new TCanvas(cTitle,cTitle,400,400); c1->SetLeftMargin(0.14);
325 TH1F *dummy = c1->DrawFrame(0.0,1,5.0, 10*ymax);
326 dummy->SetTitle(hTitle);
327 dummy->SetXTitle(
"pT (GeV/c)");
329 TLegend* leg3 =
new TLegend(.35,.6,.9,.9);
330 leg3->SetBorderSize(0);
331 leg3->SetFillColor(0);
332 leg3->SetTextSize(0.023);
334 for (Int_t i = 0; i < 4; i++) {
336 TAxis *yax = pTEf[i]->GetYaxis();
337 Int_t ny = yax->GetNbins();
338 for (Int_t j = 1; j < ny; j++) {
339 proj = pTEf[i]->ProjectionX(Form(
"%sHi%i",pTEf[i]->GetName(),j),j,j,
"e");
341 if (proj->GetEntries() <= 0)
continue;
342 proj->SetMarkerStyle(20+i);
343 proj->SetMarkerColor(j);
345 Int_t xmin = (Int_t) yax->GetBinLowEdge(j);
346 Int_t xmax = (Int_t) yax->GetBinUpEdge(j);
347 TString title(proj->GetTitle());
348 title.ReplaceAll(
" versus pTnew",
"");
349 title.ReplaceAll(
" versus pTold",
"");
350 title.ReplaceAll(
" for Global",
"");
351 title.ReplaceAll(
" for Primaries",
"");
352 leg3->AddEntry(proj,Form(
"%s for %i < Mult < %i",title.Data(),xmin,xmax),
"P");
360 void DrawEfficiency(Int_t k = 0, Double_t pmax = 2.5) {
366 for (Int_t i = 0; i < 4; i++) {
367 pTEf[i] = (TH2F *) fIn->Get(Form(
"%s%s",NameEffpT[i].Data(),GP[k]));
368 if (pTEf[i]) pTEfP[i] = pTEf[i]->ProjectionX(Form(
"%s_all",pTEf[i]->GetName()),-1,-1,
"e");
372 if (k == 1) emin = 0.9;
375 hTitle += GPTitle[k]; hTitle +=
" track efficiencies vs pT";
377 TCanvas* c1 =
new TCanvas(cTitle,cTitle,400,400);
379 TH1F* dummyeff= c1->DrawFrame(0.0,emin,pmax, 1.01);
380 dummyeff->SetTitle(hTitle);
381 dummyeff->SetXTitle(
"pT (GeV/c)");
382 dummyeff->SetYTitle(Form(
"fit points>=%i rel. efficiency",effNFP));
383 TLegend* leg4 =
new TLegend(.2,.15,.5,.4);
385 leg4->SetBorderSize(0);
386 leg4->SetFillColor(0);
387 leg4->SetTextSize(0.033);
389 TAxis *y = pTEf[0]->GetYaxis();
390 Int_t ny = y->GetNbins();
391 Double_t yMin = y->GetXmin();
392 Double_t yMax = y->GetXmax();
395 for (; m >= 0; m -= mstep) {
397 Int_t m1 = -1, m2 = -1;
403 for (Int_t i = 0; i < 4; i++) {
404 pTEfP[i] = pTEf[i]->ProjectionX(Form(
"%s_all_%i",pTEf[i]->GetName(),m),m1,m2,
"e");
406 if (! pTEfP[0] || pTEfP[0]->GetEntries() < 1e3)
continue;
407 if (! pTEfP[1] || pTEfP[1]->GetEntries() < 1e3)
continue;
408 TH1D *effNewP =
new TH1D(*pTEfP[3]); effNewP->SetName(Form(
"eff%s%i",New.Data(),m)); effNewP->SetTitle(hTitle);
409 effNewP->Divide(pTEfP[3],pTEfP[1],1.,1.,
"b");
410 TH1D *effOldP =
new TH1D(*pTEfP[2]); effOldP->SetName(Form(
"eff%s%i",Old.Data(),m)); effOldP->SetTitle(hTitle);
411 effOldP->Divide(pTEfP[2],pTEfP[0],1.,1.,
"b");
412 effOldP->SetMarkerStyle(21);
413 effOldP->SetMarkerColor(1);
414 effNewP->SetMarkerStyle(20);
415 effNewP->SetMarkerColor(1);
417 effOldP->SetMarkerColor(m/mstep+2);
418 effNewP->SetMarkerColor(m/mstep+2);
420 Int_t ymin = (Int_t) pTEf[0]->GetYaxis()->GetBinLowEdge(m-mstep+1);
421 Int_t ymax = (Int_t) pTEf[0]->GetYaxis()->GetBinUpEdge(m);
424 if (! m) NewName =
" for All";
426 if (ymin < yMin) NewName = Form(
" for Mult < %i", ymax);
427 else if (ymax > yMax) NewName = Form(
" for Mult > %i", ymin);
428 else NewName = Form(
" for %i < Mult < %i", ymin, ymax);
430 TString NewcName = c1->GetName(); NewcName += NewName;
431 cout << NewcName.Data() << endl;
432 effOldP->Draw(
"same");
433 effNewP->Draw(
"same");
434 leg4->AddEntry(effOldP,Form(
"%s efficiency %s",Old.Data(),NewName.Data()));
435 leg4->AddEntry(effNewP,Form(
"%s efficiency %s",New.Data(),NewName.Data()));
436 TCanvas* c3 =
new TCanvas(NewcName,NewcName,400,400);
438 TH1F* dummyeff3= c3->DrawFrame(0.0,emin,pmax, 1.01);
439 TString ttitle(hTitle);
441 dummyeff3->SetTitle(ttitle);
442 dummyeff3->SetXTitle(
"pT (GeV/c)");
443 dummyeff3->SetYTitle(Form(
"fit points>=%i rel. efficiency",effNFP));
444 effOldP->Draw(
"same");
445 effNewP->Draw(
"same");
446 TLegend* leg5 =
new TLegend(.2,.15,.8,.35);
447 leg5->AddEntry(effOldP,Form(
"%s efficiency %s",Old.Data(),NewName.Data()));
448 leg5->AddEntry(effNewP,Form(
"%s efficiency %s",New.Data(),NewName.Data()));
457 void DrawPhiEfficiency(Int_t k = 0) {
463 for (Int_t i = 0; i < 4; i++) {
464 PhiEf[i] = (TH2F *) fIn->Get(Form(
"%s%s",NameEffPhi[i].Data(),GP[k]));
465 if (PhiEf[i]) PhiEfP[i] = PhiEf[i]->ProjectionX(Form(
"%s_all",PhiEf[i]->GetName()),-1,-1,
"e");
469 if (k == 1) emin = 0.9;
472 hTitle += GPTitle[k]; hTitle +=
" track efficiencies vs #phi";
474 TCanvas* c1 =
new TCanvas(cTitle,cTitle,400,400);
476 TH1F* dummyeff= c1->DrawFrame(-180,emin,180, 1.01);
477 dummyeff->SetTitle(hTitle);
478 dummyeff->SetXTitle(
"#phi (degree)");
479 dummyeff->SetYTitle(Form(
"fit points>=%i rel. efficiency",effNFP));
480 TLegend* leg4 =
new TLegend(.2,.15,.5,.4);
482 leg4->SetBorderSize(0);
483 leg4->SetFillColor(0);
484 leg4->SetTextSize(0.033);
486 TAxis *y = PhiEf[0]->GetYaxis();
487 Int_t ny = y->GetNbins();
488 Double_t yMin = y->GetXmin();
489 Double_t yMax = y->GetXmax();
492 for (; m >= 0; m -= mstep) {
494 Int_t m1 = -1, m2 = -1;
500 for (Int_t i = 0; i < 4; i++) {
501 PhiEfP[i] = PhiEf[i]->ProjectionX(Form(
"%s_all_%i",PhiEf[i]->GetName(),m),m1,m2,
"e");
503 if (! PhiEfP[0] || PhiEfP[0]->GetEntries() < 1e3)
continue;
504 if (! PhiEfP[1] || PhiEfP[1]->GetEntries() < 1e3)
continue;
505 TH1D *effNewP =
new TH1D(*PhiEfP[3]); effNewP->SetName(Form(
"eff%s%i",New.Data(),m)); effNewP->SetTitle(hTitle);
506 effNewP->Divide(PhiEfP[3],PhiEfP[1],1.,1.,
"b");
507 TH1D *effOldP =
new TH1D(*PhiEfP[2]); effOldP->SetName(Form(
"eff%s%i",Old.Data(),m)); effOldP->SetTitle(hTitle);
508 effOldP->Divide(PhiEfP[2],PhiEfP[0],1.,1.,
"b");
509 effOldP->SetMarkerStyle(21);
510 effOldP->SetMarkerColor(1);
511 effNewP->SetMarkerStyle(20);
512 effNewP->SetMarkerColor(1);
514 effOldP->SetMarkerColor(m/mstep+2);
515 effNewP->SetMarkerColor(m/mstep+2);
517 Int_t ymin = (Int_t) PhiEf[0]->GetYaxis()->GetBinLowEdge(m-mstep+1);
518 Int_t ymax = (Int_t) PhiEf[0]->GetYaxis()->GetBinUpEdge(m);
521 if (! m) NewName =
" for All";
523 if (ymin < yMin) NewName = Form(
" for Mult < %i", ymax);
524 else if (ymax > yMax) NewName = Form(
" for Mult > %i", ymin);
525 else NewName = Form(
" for %i < Mult < %i", ymin, ymax);
527 TString NewcName = c1->GetName(); NewcName += NewName;
528 cout << NewcName.Data() << endl;
529 effOldP->Draw(
"same");
530 effNewP->Draw(
"same");
531 leg4->AddEntry(effOldP,Form(
"%s efficiency %s",Old.Data(),NewName.Data()));
532 leg4->AddEntry(effNewP,Form(
"%s efficiency %s",New.Data(),NewName.Data()));
533 TCanvas* c3 =
new TCanvas(NewcName,NewcName,400,400);
535 TH1F* dummyeff3= c3->DrawFrame(-180,emin,180, 1.01);
536 TString ttitle(hTitle);
538 dummyeff3->SetTitle(ttitle);
539 dummyeff3->SetXTitle(
"#phi (degrees)");
540 dummyeff3->SetYTitle(Form(
"fit points>=%i rel. efficiency",effNFP));
541 effOldP->Draw(
"same");
542 effNewP->Draw(
"same");
543 TLegend* leg5 =
new TLegend(.2,.15,.8,.35);
544 leg5->AddEntry(effOldP,Form(
"%s efficiency %s",Old.Data(),NewName.Data()));
545 leg5->AddEntry(effNewP,Form(
"%s efficiency %s",New.Data(),NewName.Data()));
554 void DrawEffVsMult(Int_t k = 0) {
560 hTitle +=
" Efficiencies"; hTitle +=
" versus Multiplicity for "; hTitle += GPTitle[k];
562 TCanvas* cnv4 =
new TCanvas(cTitle,cTitle,400,400); c1 = cnv4; c1->SetLeftMargin(0.14);
566 for (Int_t i = 0; i < 4; i++) {
567 pTEf[i] = (TH2F *) fIn->Get(Form(
"%s%s",NameEffpT[i].Data(),GP[k]));
568 if (pTEf[i]) pTEfP[i] = pTEf[i]->ProjectionY(Form(
"%s_all",pTEf[i]->GetName()),-1,-1,
"e");
571 TH1F* dummyeff= cnv4->DrawFrame(0.0,0.6,700, 1.05);
572 dummyeff->SetTitle(hTitle);
573 dummyeff->SetXTitle(
"(uncorrected) Multiplicity");
574 dummyeff->SetYTitle(Form(
"fit points>=%i rel. efficiency",effNFP));
575 TLegend* leg4 =
new TLegend(.2,.15,.5,.4);
577 leg4->SetBorderSize(0);
578 leg4->SetFillColor(0);
579 leg4->SetTextSize(0.033);
581 TAxis *x = pTEf[0]->GetXaxis();
582 Double_t xMin = x->GetXmin();
583 Double_t xMax = x->GetXmax();
584 Double_t pTs[4] = {0.1, 0.2, 0.5, 2.0};
585 for (Int_t m = 0; m < 5; m++) {
587 Int_t m1 = -1, m2 = -1;
590 m1 = x->FindBin(pTs[m-1]);
591 if (m < 4) m2 = x->FindBin(pTs[m])-1;
593 for (Int_t i = 0; i < 4; i++) {
594 pTEfP[i] = pTEf[i]->ProjectionY(Form(
"%s_all_%i",pTEf[i]->GetName(),m),m1,m2,
"e");
596 if (! pTEfP[0] || pTEfP[0]->GetEntries() < 1e3)
continue;
597 if (! pTEfP[1] || pTEfP[1]->GetEntries() < 1e3)
continue;
598 TH1D *effNewP =
new TH1D(*pTEfP[3]); effNewP->SetName(Form(
"eff%s%i",New.Data(),m)); effNewP->SetTitle(hTitle);
599 effNewP->Divide(pTEfP[3],pTEfP[1],1.,1.,
"b");
600 TH1D *effOldP =
new TH1D(*pTEfP[2]); effOldP->SetName(Form(
"eff%s%i",Old.Data(),m)); effOldP->SetTitle(hTitle);
601 effOldP->Divide(pTEfP[2],pTEfP[0],1.,1.,
"b");
602 effOldP->SetMarkerStyle(21);
603 effOldP->SetMarkerColor(1);
604 effNewP->SetMarkerStyle(20);
605 effNewP->SetMarkerColor(1);
607 effOldP->SetMarkerColor(m+1);
608 effNewP->SetMarkerColor(m+1);
610 Double_t xmin = xMin;
611 Double_t xmax = xMax;
612 if (m1 >= 0) xmin = x->GetBinLowEdge(m1);
613 if (m2 >= 0) xmax = x->GetBinUpEdge(m2);
614 effOldP->Draw(
"same");
615 effNewP->Draw(
"same");
617 leg4->AddEntry(effOldP,Form(
"%s efficiency for ALL",Old.Data()));
618 leg4->AddEntry(effNewP,Form(
"%s efficiency for ALL",New.Data()));
621 leg4->AddEntry(effOldP,Form(
"%s efficiency for pT < %4.1f",Old.Data(), xmax));
622 leg4->AddEntry(effNewP,Form(
"%s efficiency for pT < %4.1f",New.Data(), xmax));
623 }
else if (xmax > xMax) {
624 leg4->AddEntry(effOldP,Form(
"%s efficiency for pT > %4.1f",Old.Data(), xmin));
625 leg4->AddEntry(effNewP,Form(
"%s efficiency for pT > %4.1f",New.Data(), xmin));
627 leg4->AddEntry(effOldP,Form(
"%s efficiency for %4.1f < pT < %4.1f", Old.Data(), xmin, xmax));
628 leg4->AddEntry(effNewP,Form(
"%s efficiency for %4.1f < pT < %4.1f", New.Data(), xmin, xmax));
636 void DrawpTDiff(Int_t k=0, Double_t pmax = 2.5) {
642 hTitle += Form(
"<p_{T}^{%s} - p_{T}^{%s}> (GeV/c) versus p_{T}",Old.Data(),New.Data()); hTitle +=
" for "; hTitle += GPTitle[k];
643 cTitle +=
"<p_{T}^{Old} - p_{T}^{New}> (GeV/c) versus p_{T}"; cTitle +=
" for "; cTitle += GPTitle[k];
644 TCanvas* ptdiffgrcnv =
new TCanvas(cTitle,cTitle,400,400); c1 = ptdiffgrcnv; c1->SetLeftMargin(0.14);
645 TH1F* dummy2 = c1->DrawFrame(0,-.05,pmax, 0.05);
646 dummy2->SetTitle(hTitle);
647 dummy2->SetXTitle(
"p_{T} (GeV/c)");
648 dummy2->SetYTitle(Form(
"p_{T}^{%s} - p_{T}^{%s} GeV/c", Old.Data(), New.Data()));
649 dummy2->GetYaxis()->SetTitleOffset(1.75);
652 TLegend* leg7 =
new TLegend(0.22,.65,.45,.85);
653 leg7->SetBorderSize(0);
654 leg7->SetFillColor(0);
655 leg7->SetTextSize(0.033);
656 for (Int_t i = 0; i < 2; i++) {
657 TH2F *pTdiff = (TH2F *) fIn->Get(Form(
"pTdiff%s%s",charge[i],GP[k]));
658 if (! pTdiff)
continue;
659 TProfile *profx = pTdiff->ProfileX();
660 profx->SetMarkerStyle(20+i);
661 profx->SetMarkerColor(i+1);
663 if (i == 0) leg7->AddEntry(profx,
"Positives",
"P");
664 else leg7->AddEntry(profx,
"Negatives",
"P");
670 void DrawPhiDiff(Int_t k=0,
const Char_t *opt =
"Phi") {
676 hTitle += Form(
"(p_{T}^{%s} - p_{T}^{%s})/p_{T}^{%s} versus #phi_{%s} ", Old.Data(), New.Data(),New.Data(),New.Data()); hTitle +=
" for "; hTitle += GPTitle[k];
677 if (TString(opt).Contains(
"Phi5")) hTitle +=
" with pT > 0.5 GeV/c";
678 if (TString(opt).Contains(
"EP")) hTitle +=
" and #eta > 0";
679 if (TString(opt).Contains(
"EN")) hTitle +=
" and #eta < 0";
681 TCanvas* ptdiffgrcnv =
new TCanvas(cTitle,cTitle,400,400); c1 = ptdiffgrcnv; c1->SetLeftMargin(0.14);
682 TH1F* dummy2 = c1->DrawFrame(-TMath::Pi(),-.01,TMath::Pi(),.02);
683 dummy2->SetTitle(hTitle);
684 dummy2->SetXTitle(
"#phi");
685 dummy2->SetYTitle(Form(
"(p_{T}^{%s} - p_{T}^{%s})/p_{T}^{%s}", Old.Data(), New.Data(), New.Data()));
686 dummy2->GetYaxis()->SetTitleOffset(1.75);
689 TLegend* leg7 =
new TLegend(0.22,.65,.45,.85);
690 leg7->SetBorderSize(0);
691 leg7->SetFillColor(0);
692 leg7->SetTextSize(0.033);
693 TF1 *gPhi = (TF1 *) gROOT->GetFunction(
"gPhi");
695 gPhi =
new TF1(
"gPhi",
"([0]+[1]*x)*sin(x+[2])+[3]",-4,4);
696 gPhi->SetParameters(-1.34684e-03,-2.05069e-04,4.76465e-01,4.30224e-03);
698 for (Int_t i = 0; i < 2; i++) {
699 TH2F *pTdiff = (TH2F *) fIn->Get(Form(
"%sdiffR%s%s",opt,charge[i],GP[k]));
700 if (! pTdiff)
continue;
701 pTdiff->FitSlicesY(0,0,0,100,
"qnr");
702 TH1 *profx = (TH1 *) fIn->Get(Form(
"%sdiffR%s%s_1",opt,charge[i],GP[k]));
703 if (! profx)
continue;
704 profx->Fit(gPhi,
"0");
705 profx->SetMarkerStyle(20);
706 profx->SetMarkerColor(i+1);
707 TF1 *fu = profx->GetFunction(
"gPhi");
709 fu->SetLineColor(i+1);
713 if (i == 0) leg7->AddEntry(profx,
"Positives",
"P");
714 else leg7->AddEntry(profx,
"Negatives",
"P");
720 void DrawRpTDiff(Int_t k = 0,
const Char_t *opt=
"pTdiffR", Double_t pmax = 2.5) {
726 TString yTitle, sTitle;
727 if (TString(opt) ==
"pTInvdiffR") {
728 cTitle +=
"Inv pT diff (perc.) vs pT";
729 yTitle = Form(
"(1/p_{T}^{%s} - 1/p_{T}^{%s})/1/p_{T}^{%s}", Old.Data(), New.Data(), New.Data());
730 sTitle = Form(
"Sigma of Relative difference 1/pT (%s - %s)/%s vs pT", Old.Data(), New.Data(), New.Data());
732 cTitle +=
"pT diff (perc.) vs pT";
733 yTitle = Form(
"(p_{T}^{%s} - p_{T}^{%s})/p_{T}^{%s}", Old.Data(), New.Data(), New.Data());
734 sTitle = Form(
"Sigma of Relative difference pT (%s - %s)/%s vs pT", Old.Data(), New.Data(), New.Data());
736 cTitle +=
" for "; cTitle += GPTitle[k];
737 c1 =
new TCanvas(cTitle,cTitle,400,400); c1->SetLeftMargin(0.14);
739 c1->SetLeftMargin(0.15);
740 TString cTitle2(cTitle);
742 TCanvas *c2 =
new TCanvas(cTitle2,cTitle2,400,400); c2->SetLeftMargin(0.14);
744 c2->SetLeftMargin(0.15);
745 TString cTitle3(cTitle);
747 TLegend* leg8 =
new TLegend(0.22,.65,.45,.85);
748 leg8->SetBorderSize(0);
749 leg8->SetFillColor(0);
750 leg8->SetTextSize(0.033);
751 TLegend* leg9 =
new TLegend(0.22,.65,.45,.85);
752 leg9->SetBorderSize(0);
753 leg9->SetFillColor(0);
754 leg9->SetTextSize(0.033);
755 for (Int_t i = 0; i < 2; i++) {
756 TH2F *pTdiffR = (TH2F *) fIn->Get(Form(
"%s%s%s",opt,charge[i],GP[k]));
757 if (! pTdiffR) {cout <<
"Histogram " << Form(
"%s%s%s",opt,charge[i],GP[k]) <<
" is not found" << endl;
continue;}
759 pTdiffR->FitSlicesY();
760 TH1 *mu = (TH1 *) fIn->Get(Form(
"%s%s%s_1",opt,charge[i],GP[k]));
763 mu->SetAxisRange(0,pmax);
764 mu->SetTitle(cTitle);
765 mu->SetXTitle(
"pT (GeV/c)");
766 mu->SetYTitle(yTitle);
767 mu->GetYaxis()->SetTitleOffset(1.75);
768 mu->SetMinimum(-0.02);
769 mu->SetMaximum(0.03);
771 mu->SetMarkerStyle(20); mu->SetMarkerColor(i+1);
772 if (i == 0) mu->Draw();
773 else mu->Draw(
"same");
774 if (i == 0) leg8->AddEntry(mu,
"Positives (fit)",
"P");
775 else leg8->AddEntry(mu,
"Negatives (fit)",
"P");
776 }
else {cout <<
"Histogram " << Form(
"%s%s%s_1",opt,charge[i],GP[k]) <<
" is not found" << endl;}
777 TH1 *sigma = (TH1 *) fIn->Get(Form(
"%s%s%s_2",opt,charge[i],GP[k]));
780 sigma->SetMarkerStyle(20); sigma->SetMarkerColor(i+1);
783 sigma->SetAxisRange(0,pmax);
784 sigma->SetTitle(sTitle);
785 sigma->SetXTitle(
"pT (GeV/c)");
786 TString s(
"#sigma(");
787 s += yTitle; s+=
")";
789 sigma->GetYaxis()->SetTitleOffset(1.75);
790 sigma->SetMinimum(0);
791 sigma->SetMaximum(0.10);
795 if (i == 0) leg9->AddEntry(mu,
"Positives (fit)",
"P");
796 else leg9->AddEntry(mu,
"Negatives (fit)",
"P");
798 }
else {cout <<
"Histogram " << Form(
"%s%s%s_2",opt,charge[i],GP[k]) <<
" is not found" << endl;}
808 void Init(
const Char_t *file=
"Plots.root") {
809 TString pwd(gSystem->BaseName( gSystem->WorkingDirectory()));
810 TObjArray *obj = pwd.Tokenize(
"_");
811 Int_t nParsed = obj->GetEntries();
813 Old = ((TObjString *) obj->At(0))->GetName();
814 New = ((TObjString *) obj->At(1))->GetName();
815 NameEffpT[0] = Form(
"pT%s",New.Data());
816 NameEffpT[1] = Form(
"pT%s",Old.Data());
817 NameEffpT[2] = Form(
"pTO%s",New.Data());
818 NameEffpT[3] = Form(
"pTO%s",Old.Data());
819 NameEffPhi[0] = Form(
"Phi%s",New.Data());
820 NameEffPhi[1] = Form(
"Phi%s",Old.Data());
821 NameEffPhi[2] = Form(
"PhiO%s",New.Data());
822 NameEffPhi[3] = Form(
"PhiO%s",Old.Data());
826 fIn =
new TFile(gTitle);
833 const Char_t *XYZ[3] = {
"X",
"Y",
"Z"};
834 for (Int_t i = 0; i < 3; i++) {
835 TH1* h = (TH1 *) gDirectory->Get(Form(
"DifPv%s",XYZ[i]));
837 TCanvas *c =
new TCanvas(Form(
"PrimaryVertex%sdiff",XYZ[i]),Form(
"PrimaryVertex%sdiff",XYZ[i]));
844 const Char_t *hNames[2] = {
"Charge",
"Charge15"};
846 const Char_t *fNames[2] = {
"NewVsOldChargeAllPr",
"NewVsOldChargePrNFPGE15"};
847 for (Int_t i = 0; i < 2; i++) {
848 TH2 *h = (TH2 *) gDirectory->Get(hNames[i]);
850 TCanvas *c =
new TCanvas(fNames[i],fNames[i]);
856 void Draw(
const Char_t *file=
"Plots.root") {
858 DrawFitPnts(); DrawFitPnts(1);
859 DrawRelMomDifNft(0,0); DrawRelMomDifNft(1,0);
860 DrawRelMomDifNft(0,5); DrawRelMomDifNft(1,5);
861 EffRefMult(0); EffRefMult(1);
862 DrawEfficiency(0); DrawEfficiency(1);
863 DrawPhiEfficiency(0); DrawPhiEfficiency(1);
864 DrawpTDiff(0); DrawpTDiff(1);
865 DrawRpTDiff(0);DrawRpTDiff(1);
866 DrawRpTDiff(0,
"pTInvdiffR"); DrawRpTDiff(1,
"pTInvdiffR");
870 DrawPhiDiff(0);DrawPhiDiff(1);
871 DrawPhiDiff(0,
"Phi5");DrawPhiDiff(1,
"Phi5");
872 DrawPhiDiff(0,
"PhiEP");DrawPhiDiff(1,
"PhiEP");
873 DrawPhiDiff(0,
"Phi5EP");DrawPhiDiff(1,
"Phi5EP");
874 DrawPhiDiff(0,
"PhiEN");DrawPhiDiff(1,
"PhiEN");
875 DrawPhiDiff(0,
"Phi5EN");DrawPhiDiff(1,
"Phi5EN");
879 void TbyTPlots(
const Char_t *file = 0, Int_t Nentries=0) {
883 TString TreeName(
"trackMateComp");
884 fChain =
new TChain(TreeName);
892 while ((set = next())) {
893 TString Title(set->GetTitle());
894 if (Title !=
"file")
continue;
895 TString Name(set->GetName());
896 if (! Name.EndsWith(
".root"))
continue;
897 if (! (Name.BeginsWith(
"trackMateFile") || Name.BeginsWith(
"TbyT")))
continue;
899 TChain *tree = (TChain *) f->Get(TreeName);
901 const Char_t *pFile = f->GetName();
902 ULong64_t nEvents = tree->GetEntries();
906 cout <<
"\tAdd "<< FileNo <<
"\t" << nEvents <<
"\tEvents, Total = " << Ntotal << endl;
912 fChain->SetBranchAddress(
"data_array",&data.oldPtGl);
913 fChain->SetBranchAddress(
"ev_array",&refMult);
914 tFile.ReplaceAll(
".root",
"");
915 tFile.ReplaceAll(
"trackMate_physics_",
"");
916 tFile.ReplaceAll(
"trackMate_",
"");
917 tFile.ReplaceAll(
"5043073_raw_1010010_",
"");
918 tFile.ReplaceAll(
"5046043_raw_1010010_",
"");
921 TFile *fOut =
new TFile(Out.Data(),
"recreate");
922 cout <<
"Opened " << Out << endl;
926 TH1D *DifPvX =
new TH1D(
"DifPvX",Form(
"Difference in X for %s - %s positions",New.Data(),Old.Data()),100,-0.25,0.25);
927 TH1D *DifPvY =
new TH1D(
"DifPvY",Form(
"Difference in Y for %s - %s positions",New.Data(),Old.Data()),100,-0.25,0.25);
928 TH1D *DifPvZ =
new TH1D(
"DifPvZ",Form(
"Difference in Z for %s - %s positions",New.Data(),Old.Data()),100,-0.25,0.25);
929 TH2D *
Charge =
new TH2D(
"Charge",Form(
"Charge flip between %s and %s for all primaries",New.Data(),Old.Data()),3,-1.5,1.5,3,-1.5,1.5);
930 Charge->SetXTitle(Form(
"%s charge",Old.Data()));
931 Charge->SetYTitle(Form(
"%s charge",New.Data()));
932 TH2D *Charge15 =
new TH2D(
"Charge15",Form(
"Charge flip between %s and %s for all primaries with NFP >= 15",New.Data(),Old.Data()),3,-1.5,1.5,3,-1.5,1.5);
933 Charge15->SetXTitle(Form(
"%s charge",Old.Data()));
934 Charge15->SetYTitle(Form(
"%s charge",New.Data()));
938 Name =
"fitPtsHist", Title = Form(
"Fit Pts %s vs %s",Old.Data(), New.Data());
939 TH2F* fitPtsHist =
new TH2F(Name,Title,50,0,50,50,0,50);
940 fitPtsHist->SetXTitle(Form(
"fit points, %s",New.Data()));
941 fitPtsHist->SetYTitle(Form(
"fit points, %s",Old.Data()));
942 Name =
"fitPtsHistPing", Title = Form(
"Fit Pts %s vs %s matched", Old.Data(), New.Data());
943 TH2F* fitPtsHistPing =
new TH2F(Name,Title,50,0,50,50,0,50);
944 fitPtsHist->SetXTitle(Form(
"fit points, %s",New.Data()));
945 fitPtsHist->SetYTitle(Form(
"fit points, %s",Old.Data()));
949 TH2F* pTDifNFP[2][2];
950 TH2F* pTDifNFP5[2][2];
951 for (Int_t k = 0; k < 2; k++) {
952 for (Int_t c = 0; c < 2; c++) {
953 Name = Form(
"pTDifNFP%s%s",GP[k],charge[c]);
954 Title = Form(
"Relative Momentum difference vs no. of %s fit pts for %s tracks",New.Data(),GPTitle[k]);
955 pTDifNFP[k][c] =
new TH2F(Name,Title, 7,10.,45.,200,-.2,.2);
956 pTDifNFP[k][c]->SetYTitle(Form(
"Momentum Difference (pT_%s - pT_%s)/pT_%s",Old.Data(),New.Data(),New.Data()));
957 pTDifNFP[k][c]->SetXTitle(Form(
"No. %s fit points",New.Data()));
958 pTDifNFP[k][c]->SetMarkerStyle(20);
959 Name = Form(
"pTDifNFP5%s%s",GP[k],charge[c]);
960 Title = Form(
"Relative Momentum difference vs no. of %s fit pts for %s tracks with pT > 0.5 GeV/c",New.Data(),GPTitle[k]);
961 pTDifNFP5[k][c] =
new TH2F(Name,Title, 7,10.,45.,200,-.2,.2);
962 pTDifNFP5[k][c]->SetYTitle(Form(
"Momentum Difference (pT_%s - pT_%s)/pT_%s", Old.Data(), New.Data(), New.Data()));
963 pTDifNFP5[k][c]->SetXTitle(Form(
"No. %s fit points",New.Data()));
964 pTDifNFP5[k][c]->SetMarkerStyle(20);
972 const Char_t *TitleEffPt[4] = {Form(
"%s Fit Pts>%i %s versus pT_%s |#eta| < 0.5",New.Data(),effNFP,New.Data(),New.Data()),
973 Form(
"%s Fit Pts>%i %s versus pT_%s |#eta| < 0.5",Old.Data(),effNFP,Old.Data(),Old.Data()),
974 Form(
"%s & %s Fit Pts>%i %s and %s versus pT_%s |#eta| < 0.5",New.Data(),Old.Data(),effNFP,Old.Data(),New.Data(),New.Data()),
975 Form(
"%s & %s Fit Pts>%i %s and %s versus pT_%s |#eta| < 0.5",New.Data(),Old.Data(),effNFP,Old.Data(),New.Data(),Old.Data())};
976 for (Int_t k = 0; k < 2; k++) {
977 for (Int_t i = 0; i < 4; i++) {
978 Name = Form(
"%s%s",NameEffpT[i].Data(),GP[k]);
979 Title = Form(
"%s for %s",TitleEffPt[i],GPTitle[k]);
980 pTEf[k][i] =
new TH2F(Name,Title,70,0,7,7,0,700);
982 pTEf[k][i]->SetMarkerStyle(20+i);
983 pTEf[k][i]->SetMarkerColor(1+i);
989 const Char_t *TitleEffPhi[4] = {Form(
"%s Fit Pts>%i %s versus #phi_%s |#eta| < 0.5",New.Data(),effNFP,New.Data(),New.Data()),
990 Form(
"%s Fit Pts>%i %s versus #phi_%s |#eta| < 0.5",Old.Data(),effNFP,Old.Data(),Old.Data()),
991 Form(
"%s & %s Fit Pts>%i %s and %s versus #phi_%s |#eta| < 0.5",New.Data(),Old.Data(),effNFP,Old.Data(),New.Data(),New.Data()),
992 Form(
"%s & %s Fit Pts>%i %s and %s versus #phi_%s |#eta| < 0.5",New.Data(),Old.Data(),effNFP,Old.Data(),New.Data(),Old.Data())};
994 for (Int_t k = 0; k < 2; k++) {
995 for (Int_t i = 0; i < 4; i++) {
996 Name = Form(
"%s%s",NameEffPhi[i].Data(),GP[k]);
997 Title = Form(
"%s for %s",TitleEffPhi[i],GPTitle[k]);
998 PhiEf[k][i] =
new TH2F(Name,Title,180,-180,180,7,0,700);
999 PhiEf[k][i]->Sumw2();
1000 PhiEf[k][i]->SetMarkerStyle(20+i);
1001 PhiEf[k][i]->SetMarkerColor(1+i);
1008 TH2F* pTdiffR[2][2];
1009 TH2F* pTInvdiffR[2][2];
1010 TH2F* PhidiffR[3][2][2];
1011 TH2F* Phi5diffR[3][2][2];
1012 for (Int_t k = 0; k < 2; k++) {
1013 for (Int_t i = 0; i < 2; i++) {
1014 Name = Form(
"pTdiff%s%s",charge[i],GP[k]);
1015 Title = Form(
"pT_%s - pT_%s for %s",Old.Data(),New.Data(),GPTitle[k]);
1016 pTdiff[k][i] =
new TH2F(Name,Title,40,0,4,200,-.8,.8);
1017 pTdiff[k][i]->SetXTitle(Form(
"p_{T} %s (GeV/c)",New.Data()));
1018 TString YTitle = Form(
"p_{T} Difference (pT_%s - pT_%s),",Old.Data(),New.Data());
1025 if (k == 0) title +=
" for Globals";
1026 else title +=
" for Primaries";
1027 TString yTitle = YTitle; yTitle += title;
1028 pTdiff[k][i]->SetYTitle(yTitle);
1029 pTdiff[k][i]->Sumw2();
1030 pTdiff[k][i]->SetMarkerStyle(20);
1031 pTdiff[k][i]->SetMarkerColor(i+2);
1032 Name = Form(
"pTdiffR%s%s",charge[i],GP[k]);
1033 pTdiffR[k][i] =
new TH2F(Name,Title,40,0,4,600,-0.15,0.15);
1034 pTdiffR[k][i]->SetXTitle(Form(
"p_{T} %s (GeV/c)",New.Data()));
1035 YTitle = Form(
"(pT_%s - pT_%s)/pT_%s,",Old.Data(),New.Data(),New.Data());
1036 yTitle = YTitle; yTitle += title;
1037 pTdiffR[k][i]->SetYTitle(yTitle);
1038 pTdiffR[k][i]->Sumw2();
1039 pTdiffR[k][i]->SetMarkerStyle(20);
1040 pTdiffR[k][i]->SetMarkerColor(i+2);
1042 Name = Form(
"pTInvdiffR%s%s",charge[i],GP[k]);
1043 pTInvdiffR[k][i] =
new TH2F(Name,Title,40,0.,4.,600,-0.15,0.15);
1044 pTInvdiffR[k][i]->SetXTitle(Form(
"pT_%s",New.Data()));
1045 YTitle = Form(
"(1/pT_%s - 1/pT_%s)/(1/pT_%s), versus pT_%s",Old.Data(),New.Data(),New.Data(),New.Data());
1046 yTitle = YTitle; yTitle += title;
1047 pTInvdiffR[k][i]->SetYTitle(yTitle);
1048 pTInvdiffR[k][i]->Sumw2();
1049 pTInvdiffR[k][i]->SetMarkerStyle(20);
1050 pTInvdiffR[k][i]->SetMarkerColor(i+2);
1051 const Char_t *NameEta[3] = {
"",
"EP",
"EN"};
1052 const Char_t *TitleEta[3] = {
"all #eta",
"|#eta| > 0",
"|#eta| < 0"};
1053 for (Int_t l = 0; l < 3; l++) {
1054 Name = Form(
"Phi%sdiffR%s%s",NameEta[l],charge[i],GP[k]);
1055 Title = Form(
"pT_%s - pT_%s for %s and %s",Old.Data(),New.Data(),GPTitle[k],TitleEta[l]);
1056 PhidiffR[l][k][i] =
new TH2F(Name,Title,72,-TMath::Pi(),TMath::Pi(),600,-0.15,0.15);
1057 PhidiffR[l][k][i]->SetXTitle(Form(
"#phi_%s",New.Data()));
1058 YTitle = Form(
"(pT_%s - pT_%s)/(pT_%s), versus #phi_%s",Old.Data(),New.Data(),New.Data(),New.Data());
1059 yTitle = YTitle; yTitle += title;
1060 PhidiffR[l][k][i]->SetYTitle(yTitle);
1061 PhidiffR[l][k][i]->Sumw2();
1062 PhidiffR[l][k][i]->SetMarkerStyle(20);
1063 PhidiffR[l][k][i]->SetMarkerColor(i+2);
1065 Name = Form(
"Phi5%sdiffR%s%s",NameEta[l],charge[i],GP[k]);
1066 Phi5diffR[l][k][i] =
new TH2F(Name,Title,72,-TMath::Pi(),TMath::Pi(),600,-0.15,0.15);
1067 Phi5diffR[l][k][i]->SetXTitle(Form(
"#phi_%s",New.Data()));
1068 YTitle = Form(
"(pT_%s - pT_%s)/(pT_%s), versus #phi_{%s} for pT > 0.5 GeV/c",Old.Data(),New.Data(),New.Data(),New.Data());
1069 yTitle = YTitle; yTitle += title;
1070 Phi5diffR[l][k][i]->SetYTitle(yTitle);
1071 Phi5diffR[l][k][i]->Sumw2();
1072 Phi5diffR[l][k][i]->SetMarkerStyle(20);
1073 Phi5diffR[l][k][i]->SetMarkerColor(i+2);
1079 const Char_t *secNames[4] = {
"20",
"04",
"17",
"07"};
1080 const Char_t *pTNames[6] = {Old.Data(), New.Data(),
1081 Form(
"%sNot%s",Old.Data(),New.Data()), Form(
"%sNot%s", New.Data(),Old.Data()),
1082 Form(
"%sAnd%s",Old.Data(),New.Data()), Form(
"%sAnd%s", New.Data(),Old.Data())};
1083 const Char_t *pTitles[6] = {Old.Data(), New.Data(),
1084 Form(
"Reconstructed by %s and Not by %s",Old.Data(),New.Data()), Form(
"reconstructed by %s and Not by %s", New.Data(),Old.Data()),
1085 Form(
"Reconstructed by both %s And %s",Old.Data(),New.Data()), Form(
"reconstructed by both %s And %s", New.Data(),Old.Data())};
1086 for (Int_t i = 0; i < 4; i++) {
1087 for (Int_t t = 0; t < 6; t++) {
1088 Name = pTNames[t]; Name += secNames[i];
1089 Title =
"Sector "; Title += secNames[i]; Title +=
" "; Title += pTitles[i];
1090 secpT[i][t] =
new TH1D(Name,Title,100,0,10);
1094 etaphi[0] =
new TH2F(Form(
"EtaPhi%s",Old.Data()),Form(
"#phi versus #eta for %s",Old.Data()),
1095 200,-2,2,90,-180,180);
1096 etaphi[1] =
new TH2F(Form(
"EtaPhi%s",New.Data()),Form(
"#phi versus #eta for %s",New.Data()),
1097 200,-2,2,90,-180,180);
1099 Long64_t nentries = fChain->GetEntriesFast();
1100 if (Nentries > 0 && nentries > Nentries) nentries = Nentries;
1101 Int_t nbytes = 0, nb = 0;
1102 Float_t RefMultOld = -1;
1103 for (Long64_t jentry=0; jentry<nentries;jentry++) {
1104 Long64_t ientry = fChain->LoadTree(jentry);
1105 if (ientry < 0)
break;
1106 if (jentry%10000 == 0) cout <<
"Read entry " << jentry << endl;
1107 nb = fChain->GetEntry(jentry); nbytes += nb;
1108 if (data.newFitPtsGl <= 0 && data.oldFitPtsGl <= 0)
continue;
1109 if ((data.newFitPtsGl > 0 && TMath::Abs(data.newEtaGl) > 0.5) ||
1110 (data.oldFitPtsGl > 0 && TMath::Abs(data.oldEtaGl) > 0.5))
continue;
1111 fitPtsHist->Fill(data.newFitPtsGl,data.oldFitPtsGl);
1112 Double_t pTdiffGl = -9999;
1113 Double_t pTdiffGlR = -9999;
1114 Double_t pTInvdiffGlR = -9999;
1115 Double_t pTdiffPr = -9999;
1116 Double_t pTdiffPrR = -9999;
1117 Double_t pTInvdiffPrR = -9999;
1119 if (data.oldFitPtsGl >= effNFP) {
1120 etaphi[0]->Fill(data.oldEtaGl,TMath::RadToDeg()*data.oldPhiGl);
1121 if (data.oldEtaGl < 0) {
1122 if ( -45 < TMath::RadToDeg()*data.oldPhiGl && TMath::RadToDeg()*data.oldPhiGl < -15) oldSec = 0;
1123 if (-135 < TMath::RadToDeg()*data.oldPhiGl && TMath::RadToDeg()*data.oldPhiGl < -105) oldSec = 2;
1125 if ( -45 < TMath::RadToDeg()*data.oldPhiGl && TMath::RadToDeg()*data.oldPhiGl < -15) oldSec = 1;
1126 if (-135 < TMath::RadToDeg()*data.oldPhiGl && TMath::RadToDeg()*data.oldPhiGl < -105) oldSec = 3;
1130 if (data.newFitPtsGl >= effNFP) {
1131 etaphi[1]->Fill(data.newEtaGl,TMath::RadToDeg()*data.newPhiGl);
1132 if (data.newEtaGl < 0) {
1133 if ( -45 < TMath::RadToDeg()*data.newPhiGl && TMath::RadToDeg()*data.newPhiGl < -15) newSec = 0;
1134 if (-135 < TMath::RadToDeg()*data.newPhiGl && TMath::RadToDeg()*data.newPhiGl < -105) newSec = 2;
1136 if ( -45 < TMath::RadToDeg()*data.newPhiGl && TMath::RadToDeg()*data.newPhiGl < -15) newSec = 1;
1137 if (-135 < TMath::RadToDeg()*data.newPhiGl && TMath::RadToDeg()*data.newPhiGl < -105) newSec = 3;
1140 if (data.newFitPtsGl >= effNFP) {
1141 pTEf[0][0]->Fill(data.newPtGl,refMult);
1142 PhiEf[0][0]->Fill(TMath::RadToDeg()*data.newPhiGl,refMult);
1144 secpT[newSec][1]->Fill(data.newPtGl);
1146 secpT[newSec][3]->Fill(data.newPtGl);
1148 secpT[newSec][5]->Fill(data.newPtGl);
1151 if (data.oldFitPtsGl >= effNFP) {
1152 pTEf[0][1]->Fill(data.oldPtGl,refMult);
1153 PhiEf[0][1]->Fill(TMath::RadToDeg()*data.oldPhiGl,refMult);
1155 secpT[oldSec][0]->Fill(data.oldPtGl);
1157 secpT[oldSec][2]->Fill(data.oldPtGl);
1159 secpT[oldSec][4]->Fill(data.oldPtGl);
1162 Int_t Prim = (Int_t) data.Prim;
1163 if (Prim%10 && data.newFitPtsPr >= effNFP) {pTEf[1][0]->Fill(data.newPtPr,refMult); PhiEf[1][0]->Fill(TMath::RadToDeg()*data.newPhiPr,refMult);}
1164 if (Prim/10 && data.oldFitPtsPr >= effNFP) {pTEf[1][1]->Fill(data.oldPtPr,refMult); PhiEf[1][1]->Fill(TMath::RadToDeg()*data.oldPhiPr,refMult);}
1167 if (data.newFitPtsGl - data.maxPing >= 3)
continue;
1169 if (data.newFitPtsGl > 2*data.maxPing ||
1170 data.oldFitPtsGl > 2*data.maxPing )
continue;
1172 if (data.newFitPtsGl < minNFP || data.oldFitPtsGl < minNFP)
continue;
1174 fitPtsHistPing->Fill(data.newFitPtsGl,data.oldFitPtsGl);
1175 pTdiffGl = data.oldPtGl - data.newPtGl;
1176 pTdiffGlR = data.oldPtGl/data.newPtGl - 1;
1177 pTInvdiffGlR = data.newPtGl/data.oldPtGl - 1;
1179 if (RefMultOld != refMult) {
1180 RefMultOld = refMult;
1181 if (! (data.newPrimX == 0 && data.newPrimY == 0 && data.newPrimZ == 0) &&
1182 ! (data.oldPrimX == 0 && data.oldPrimY == 0 && data.oldPrimZ == 0)) {
1183 DifPvX->Fill(data.newPrimX - data.oldPrimX);
1184 DifPvY->Fill(data.newPrimY - data.oldPrimY);
1185 DifPvZ->Fill(data.newPrimZ - data.oldPrimZ);
1188 Charge->Fill(data.oldCharge,data.newCharge);
1189 if (data.newFitPtsGl >= 15 && data.oldFitPtsGl >= 15) Charge15->Fill(data.oldCharge,data.newCharge);
1190 Charge15->Fill(data.oldCharge,data.newCharge);
1191 pTdiffPr = data.oldPtPr - data.newPtPr;
1192 pTdiffPrR = data.oldPtPr/data.newPtPr - 1;
1193 pTInvdiffPrR = data.newPtPr/data.oldPtPr - 1;
1198 if ((data.newCharge && data.newCharge < 0) ||
1199 (data.oldCharge && data.oldCharge < 0)) charge = 1;
1200 pTDifNFP[0][charge]->Fill(data.newFitPtsGl,pTdiffGlR);
1201 if (data.newPtGl > 0.5) pTDifNFP5[0][charge]->Fill(data.newFitPtsGl,pTdiffGlR);
1203 pTDifNFP[1][charge]->Fill(data.newFitPtsPr,pTdiffPrR);
1204 if (data.newPtPr > 0.5) pTDifNFP5[1][charge]->Fill(data.newFitPtsPr,pTdiffPrR);
1207 if (data.newFitPtsGl < effNFP || data.oldFitPtsGl < effNFP)
continue;
1208 pTdiff[0][charge]->Fill(data.newPtGl,pTdiffGl);
1209 pTdiffR[0][charge]->Fill(data.newPtGl,pTdiffGlR);
1210 pTInvdiffR[0][charge]->Fill(data.newPtGl,pTInvdiffGlR);
1211 PhidiffR[0][0][charge]->Fill(data.newPhiGl,pTdiffGlR);
1212 if (data.newEtaGl > 0) PhidiffR[1][0][charge]->Fill(data.newPhiGl,pTdiffGlR);
1213 else PhidiffR[2][0][charge]->Fill(data.newPhiGl,pTdiffGlR);
1214 if (data.newPtGl > 0.5) {
1215 Phi5diffR[0][0][charge]->Fill(data.newPhiGl,pTdiffGlR);
1216 if (data.newEtaGl > 0) Phi5diffR[1][0][charge]->Fill(data.newPhiGl,pTdiffGlR);
1217 else Phi5diffR[2][0][charge]->Fill(data.newPhiGl,pTdiffGlR);
1219 pTEf[0][2]->Fill(data.newPtGl,refMult); PhiEf[0][2]->Fill(TMath::RadToDeg()*data.newPhiGl,refMult);
1220 pTEf[0][3]->Fill(data.oldPtGl,refMult); PhiEf[0][3]->Fill(TMath::RadToDeg()*data.oldPhiGl,refMult);
1222 pTdiff[1][charge]->Fill(data.newPtPr,pTdiffPr);
1223 pTdiffR[1][charge]->Fill(data.newPtPr,pTdiffPrR);
1224 pTInvdiffR[1][charge]->Fill(data.newPtPr,pTInvdiffPrR);
1225 PhidiffR[0][1][charge]->Fill(data.newPhiPr,pTdiffPrR);
1226 if (data.newEtaPr > 0) PhidiffR[1][1][charge]->Fill(data.newPhiPr,pTdiffPrR);
1227 else PhidiffR[2][1][charge]->Fill(data.newPhiPr,pTdiffPrR);
1228 if (data.newPtPr > 0.5) {
1229 Phi5diffR[0][1][charge]->Fill(data.newPhiPr,pTdiffPrR);
1230 if (data.newEtaPr > 0) Phi5diffR[1][1][charge]->Fill(data.newPhiPr,pTdiffPrR);
1231 else Phi5diffR[2][1][charge]->Fill(data.newPhiPr,pTdiffPrR);
1233 pTEf[1][2]->Fill(data.newPtPr,refMult); PhiEf[1][2]->Fill(TMath::RadToDeg()*data.newPhiPr,refMult);
1234 pTEf[1][3]->Fill(data.oldPtPr,refMult); PhiEf[1][3]->Fill(TMath::RadToDeg()*data.oldPhiPr,refMult);
1237 if (fOut) fOut->Write();
virtual void Draw(Option_t *depth="3")
Draw Referenced node with current parameters.