46 #if !defined(__CINT__) || defined(__MAKECINT__) 49 #include <TDirectoryFile.h> 71 TString listName =
"Pi0IM_GammaTrackCorr_EMCAL");
115 Int_t color[]={kBlack,kRed,kBlue,kOrange+1,kYellow+1,kGreen+2,kCyan+1,kViolet,kMagenta+2,kGray};
127 TString listName =
"Pi0IM_GammaTrackCorr_EMCAL",
134 printf(
"Open <%s>; Get List : <%s>; format %s\n",
fileName.Data(),listName.Data(),format.Data());
171 gStyle->SetOptTitle(1);
172 gStyle->SetOptStat(0);
173 gStyle->SetOptFit(000000);
174 gStyle->SetPadRightMargin(0.02);
177 gStyle->SetTitleFontSize(0.05);
181 if (trigName.Contains(
"EMCAL")) { calo = 0 ; nCalo = 1 ; }
182 else if(trigName.Contains(
"DCAL" )) { calo = 1 ; nCalo = 2 ; }
184 TString caloString [] = {
"EMCAL",
"DCAL"};
200 for(
Int_t icalo = calo; icalo < nCalo; icalo++)
202 if(trigName.Contains(
"default")) histoTag=Form(
"%s_%s",caloString[icalo].
Data(),trigName.Data());
246 TH1F* hRatRaw [
nProd-1];
247 TH1F* hRatCorr[
nProd-1];
248 TH1F* hRatTM [
nProd-1];
249 TH1F* hRatShSh[
nProd-1];
256 TH1F* hTrackMatchResEtaNeg[
nProd];
257 TH1F* hTrackMatchResEtaPos[
nProd];
258 TH1F* hTrackMatchResPhiNeg[
nProd];
259 TH1F* hTrackMatchResPhiPos[
nProd];
261 TH1F* hRatTrackMatchResEtaNeg[
nProd-1];
262 TH1F* hRatTrackMatchResEtaPos[
nProd-1];
263 TH1F* hRatTrackMatchResPhiNeg[
nProd-1];
264 TH1F* hRatTrackMatchResPhiPos[
nProd-1];
266 TH2F* h2TrackMatchResEtaNegTrackPt[
nProd];
267 TH2F* h2TrackMatchResEtaPosTrackPt[
nProd];
268 TH2F* h2TrackMatchResPhiNegTrackPt[
nProd];
269 TH2F* h2TrackMatchResPhiPosTrackPt[
nProd];
271 TH1F* hTrackMatchResEtaNegTrackPt[
nProd];
272 TH1F* hTrackMatchResEtaPosTrackPt[
nProd];
273 TH1F* hTrackMatchResPhiNegTrackPt[
nProd];
274 TH1F* hTrackMatchResPhiPosTrackPt[
nProd];
276 TH1F* hRatTrackMatchResEtaNegTrackPt[
nProd-1];
277 TH1F* hRatTrackMatchResEtaPosTrackPt[
nProd-1];
278 TH1F* hRatTrackMatchResPhiNegTrackPt[
nProd-1];
279 TH1F* hRatTrackMatchResPhiPosTrackPt[
nProd-1];
282 TLegend lprod(0.65,0.475,0.95,0.675);
283 lprod.SetTextSize(0.04);
284 lprod.SetBorderSize(0);
285 lprod.SetFillColor(0);
289 hRaw [iprod] = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_Cut_0_Open" ,icalo),iprod);
290 hCorr[iprod] = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_Cut_4_NCells" ,icalo),iprod);
291 hTM [iprod] = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_Cut_7_Matching",icalo),iprod);
292 hShSh[iprod] = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_Cut_9_PID" ,icalo),iprod);
294 if(!hRaw[iprod])
return;
296 hRaw [iprod]->Rebin(5);
297 hCorr[iprod]->Rebin(5);
298 hTM [iprod]->Rebin(5);
299 hShSh[iprod]->Rebin(5);
303 hRaw [iprod]->Sumw2();
304 hCorr[iprod]->Sumw2();
305 hTM [iprod]->Sumw2();
306 hShSh[iprod]->Sumw2();
308 hRaw [iprod]->Scale(1./
nEvents[iprod]);
309 hCorr[iprod]->Scale(1./
nEvents[iprod]);
310 hTM [iprod]->Scale(1./
nEvents[iprod]);
311 hShSh[iprod]->Scale(1./
nEvents[iprod]);
314 hRaw[iprod]->SetMarkerColor(
color[iprod]);
315 hRaw[iprod]->SetMarkerStyle(24);
317 hCorr[iprod]->SetTitle(
"Cluster spectra with/out cuts");
318 hCorr[iprod]->SetYTitle(
"1/N_{events} dN/dp_{T}");
320 hCorr[iprod]->SetTitleOffset(1.5,
"Y");
321 hCorr[iprod]->SetMarkerColor(
color[iprod]);
322 hCorr[iprod]->SetMarkerStyle(20);
323 hCorr[iprod]->SetAxisRange(10,70.,
"X");
327 hTM [iprod]->SetMarkerColor(
color[iprod]);
328 hTM [iprod]->SetMarkerStyle(21);
330 hShSh[iprod]->SetMarkerColor(
color[iprod]);
331 hShSh[iprod]->SetMarkerStyle(22);
333 hRaw [iprod]->SetTitleOffset(1.5,
"Y");
334 hTM [iprod]->SetTitleOffset(1.5,
"Y");
335 hShSh[iprod]->SetTitleOffset(1.5,
"Y");
336 hCorr[iprod]->SetTitleOffset(1.5,
"Y");
340 hRatRaw [iprod-1] = (TH1F*)hRaw [iprod]->Clone(Form(
"hRatRaw%s_%s" ,prod[iprod].
Data(),histoTag.Data()));
341 hRatCorr[iprod-1] = (TH1F*)hCorr[iprod]->Clone(Form(
"hRatCorr%s_%s",prod[iprod].
Data(),histoTag.Data()));
342 hRatTM [iprod-1] = (TH1F*)hTM [iprod]->Clone(Form(
"hRatTM%s_%s" ,prod[iprod].
Data(),histoTag.Data()));
343 hRatShSh[iprod-1] = (TH1F*)hShSh[iprod]->Clone(Form(
"hRatShSh%s_%s",prod[iprod].
Data(),histoTag.Data()));
350 hRatRaw [iprod-1]->Divide(hRatRaw [iprod-1],hRaw [0],1.000,1,errType);
351 hRatCorr[iprod-1]->Divide(hRatCorr[iprod-1],hCorr[0],1.000,1,errType);
352 hRatTM [iprod-1]->Divide(hRatTM [iprod-1],hTM [0],1.000,1,errType);
353 hRatShSh[iprod-1]->Divide(hRatShSh[iprod-1],hShSh[0],1.000,1,errType);
359 h2TrackMatchResEtaNeg[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaNegNoCut",icalo),iprod);
360 h2TrackMatchResEtaPos[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaPosNoCut",icalo),iprod);
361 h2TrackMatchResPhiNeg[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDPhiNegNoCut",icalo),iprod);
362 h2TrackMatchResPhiPos[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDPhiPosNoCut",icalo),iprod);
366 if ( histoTag.Contains(
"L0") )
371 else if ( histoTag.Contains(
"L1") )
376 else if ( histoTag.Contains(
"L2") )
382 Float_t binMin = h2TrackMatchResEtaNeg[iprod]->GetXaxis()->FindBin(emin);
383 Float_t binMax = h2TrackMatchResEtaNeg[iprod]->GetXaxis()->FindBin(emax);
385 hTrackMatchResEtaNeg[iprod] =
386 (TH1F*) h2TrackMatchResEtaNeg[iprod]->ProjectionY(Form(
"TMProjEtaNeg%s_%s",
387 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
388 hTrackMatchResEtaPos[iprod] =
389 (TH1F*) h2TrackMatchResEtaPos[iprod]->ProjectionY(Form(
"TMProjEtaPos%s_%s",
390 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
391 hTrackMatchResPhiNeg[iprod] =
392 (TH1F*) h2TrackMatchResPhiNeg[iprod]->ProjectionY(Form(
"TMProjPhiNeg%s_%s",
393 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
394 hTrackMatchResPhiPos[iprod] =
395 (TH1F*) h2TrackMatchResPhiPos[iprod]->ProjectionY(Form(
"TMProjPhiPos%s_%s",
396 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
400 hTrackMatchResEtaNeg[iprod]->Sumw2();
401 hTrackMatchResEtaPos[iprod]->Sumw2();
402 hTrackMatchResPhiNeg[iprod]->Sumw2();
403 hTrackMatchResPhiPos[iprod]->Sumw2();
405 hTrackMatchResEtaNeg[iprod]->Scale(1./
nEvents[iprod]);
406 hTrackMatchResEtaPos[iprod]->Scale(1./
nEvents[iprod]);
407 hTrackMatchResPhiNeg[iprod]->Scale(1./
nEvents[iprod]);
408 hTrackMatchResPhiPos[iprod]->Scale(1./
nEvents[iprod]);
411 hTrackMatchResEtaNeg[iprod]->SetXTitle(
"#Delta #eta");
412 hTrackMatchResEtaNeg[iprod]->SetYTitle(
"Entries / N events");
413 hTrackMatchResEtaNeg[iprod]->SetTitle(Form(
"Track-cluster #eta residuals, %2.1f < #it{E}^{cluster} < %2.1f GeV",emin,emax));
414 hTrackMatchResEtaNeg[iprod]->SetAxisRange(-0.025,0.025,
"X");
415 hTrackMatchResEtaNeg[iprod]->SetMarkerStyle(24);
416 hTrackMatchResEtaNeg[iprod]->SetMarkerColor(
color[iprod]);
418 hTrackMatchResEtaPos[iprod]->SetYTitle(
"Entries / N events");
419 hTrackMatchResEtaPos[iprod]->SetXTitle(
"#Delta #eta");
420 hTrackMatchResEtaPos[iprod]->SetTitle(Form(
"Track-cluster #eta residuals, %2.1f < #it{E}^{cluster} < %2.1f GeV",emin,emax));
421 hTrackMatchResEtaPos[iprod]->SetAxisRange(-0.025,0.025,
"X");
422 hTrackMatchResEtaPos[iprod]->SetMarkerStyle(25);
423 hTrackMatchResEtaPos[iprod]->SetMarkerColor(
color[iprod]);
425 hTrackMatchResPhiNeg[iprod]->SetXTitle(
"#Delta #varphi");
426 hTrackMatchResPhiNeg[iprod]->SetTitle(Form(
"Track-cluster #varphi residuals, %2.1f < #it{E}^{cluster} < %2.1f GeV",emin,emax));
427 hTrackMatchResPhiNeg[iprod]->SetYTitle(
"entries / N events");
428 hTrackMatchResPhiNeg[iprod]->SetAxisRange(-0.035,0.035,
"X");
429 hTrackMatchResPhiNeg[iprod]->SetMarkerStyle(24);
430 hTrackMatchResPhiNeg[iprod]->SetMarkerColor(
color[iprod]);
432 hTrackMatchResPhiPos[iprod]->SetYTitle(
"Entries / N events");
433 hTrackMatchResPhiPos[iprod]->SetXTitle(
"#Delta #varphi");
434 hTrackMatchResPhiPos[iprod]->SetTitle(Form(
"Track-cluster #varphi residuals, %2.1f < #it{E}^{cluster} < %2.1f GeV",emin,emax));
435 hTrackMatchResPhiPos[iprod]->SetAxisRange(-0.035,0.035,
"X");
436 hTrackMatchResPhiPos[iprod]->SetMarkerStyle(25);
437 hTrackMatchResPhiPos[iprod]->SetMarkerColor(
color[iprod]);
439 hTrackMatchResEtaNeg[iprod]->SetTitleOffset(1.5,
"Y");
440 hTrackMatchResEtaPos[iprod]->SetTitleOffset(1.5,
"Y");
441 hTrackMatchResPhiNeg[iprod]->SetTitleOffset(1.5,
"Y");
442 hTrackMatchResPhiPos[iprod]->SetTitleOffset(1.5,
"Y");
446 hRatTrackMatchResPhiPos[iprod-1] =
447 (TH1F*)hTrackMatchResPhiPos[iprod]->Clone(Form(
"hRatPhiPos%s_%s",prod[iprod].
Data(),histoTag.Data()));
448 hRatTrackMatchResPhiNeg[iprod-1] =
449 (TH1F*)hTrackMatchResPhiNeg[iprod]->Clone(Form(
"hRatPhiNeg%s_%s",prod[iprod].
Data(),histoTag.Data()));
450 hRatTrackMatchResEtaPos[iprod-1] =
451 (TH1F*)hTrackMatchResEtaPos[iprod]->Clone(Form(
"hRatEtaPos%s_%s",prod[iprod].
Data(),histoTag.Data()));
452 hRatTrackMatchResEtaNeg[iprod-1] =
453 (TH1F*)hTrackMatchResEtaNeg[iprod]->Clone(Form(
"hRatEtaNeg%s_%s",prod[iprod].
Data(),histoTag.Data()));
455 hRatTrackMatchResPhiPos[iprod-1]->Divide(hRatTrackMatchResPhiPos[iprod-1],hTrackMatchResPhiPos[0],1.000,1,errType);
456 hRatTrackMatchResPhiNeg[iprod-1]->Divide(hRatTrackMatchResPhiNeg[iprod-1],hTrackMatchResPhiNeg[0],1.000,1,errType);
457 hRatTrackMatchResEtaPos[iprod-1]->Divide(hRatTrackMatchResEtaPos[iprod-1],hTrackMatchResEtaPos[0],1.000,1,errType);
458 hRatTrackMatchResEtaNeg[iprod-1]->Divide(hRatTrackMatchResEtaNeg[iprod-1],hTrackMatchResEtaNeg[0],1.000,1,errType);
462 h2TrackMatchResEtaNegTrackPt[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaNegTrackPtNoCut",icalo),iprod);
463 h2TrackMatchResEtaPosTrackPt[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaPosTrackPtNoCut",icalo),iprod);
464 h2TrackMatchResPhiNegTrackPt[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDPhiNegTrackPtNoCut",icalo),iprod);
465 h2TrackMatchResPhiPosTrackPt[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDPhiPosTrackPtNoCut",icalo),iprod);
467 if ( !h2TrackMatchResEtaNegTrackPt[iprod] )
continue;
469 binMin = h2TrackMatchResEtaNegTrackPt[iprod]->GetXaxis()->FindBin(emin);
470 binMax = h2TrackMatchResEtaNegTrackPt[iprod]->GetXaxis()->FindBin(emax);
472 hTrackMatchResEtaNegTrackPt[iprod] =
473 (TH1F*) h2TrackMatchResEtaNegTrackPt[iprod]->ProjectionY(Form(
"TMProjEtaNegTrackPt%s_%s",
474 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
475 hTrackMatchResEtaPosTrackPt[iprod] =
476 (TH1F*) h2TrackMatchResEtaPosTrackPt[iprod]->ProjectionY(Form(
"TMProjEtaPosTrackPt%s_%s",
477 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
478 hTrackMatchResPhiNegTrackPt[iprod] =
479 (TH1F*) h2TrackMatchResPhiNegTrackPt[iprod]->ProjectionY(Form(
"TMProjPhiNegTrackPt%s_%s",
480 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
481 hTrackMatchResPhiPosTrackPt[iprod] =
482 (TH1F*) h2TrackMatchResPhiPosTrackPt[iprod]->ProjectionY(Form(
"TMProjPhiPosTrackPt%s_%s",
483 prod[iprod].
Data(),histoTag.Data()),binMin, binMax);
487 hTrackMatchResEtaNegTrackPt[iprod]->Sumw2();
488 hTrackMatchResEtaPosTrackPt[iprod]->Sumw2();
489 hTrackMatchResPhiNegTrackPt[iprod]->Sumw2();
490 hTrackMatchResPhiPosTrackPt[iprod]->Sumw2();
492 hTrackMatchResEtaNegTrackPt[iprod]->Scale(1./
nEvents[iprod]);
493 hTrackMatchResEtaPosTrackPt[iprod]->Scale(1./
nEvents[iprod]);
494 hTrackMatchResPhiNegTrackPt[iprod]->Scale(1./
nEvents[iprod]);
495 hTrackMatchResPhiPosTrackPt[iprod]->Scale(1./
nEvents[iprod]);
498 hTrackMatchResEtaNegTrackPt[iprod]->SetXTitle(
"#Delta #eta");
499 hTrackMatchResEtaNegTrackPt[iprod]->SetYTitle(
"Entries / N events");
500 hTrackMatchResEtaNegTrackPt[iprod]->SetTitle(Form(
"Track-cluster #eta residuals, %2.1f < #it{p}_{T}^{track} < %2.1f GeV",emin,emax));
501 hTrackMatchResEtaNegTrackPt[iprod]->SetAxisRange(-0.025,0.025,
"X");
502 hTrackMatchResEtaNegTrackPt[iprod]->SetMarkerStyle(24);
503 hTrackMatchResEtaNegTrackPt[iprod]->SetMarkerColor(
color[iprod]);
505 hTrackMatchResEtaPosTrackPt[iprod]->SetYTitle(
"Entries / N events");
506 hTrackMatchResEtaPosTrackPt[iprod]->SetXTitle(
"#Delta #eta");
507 hTrackMatchResEtaPosTrackPt[iprod]->SetTitle(Form(
"Track-cluster #eta residuals, %2.1f < #it{p}_{T}^{track} < %2.1f GeV",emin,emax));
508 hTrackMatchResEtaPosTrackPt[iprod]->SetAxisRange(-0.025,0.025,
"X");
509 hTrackMatchResEtaPosTrackPt[iprod]->SetMarkerStyle(25);
510 hTrackMatchResEtaPosTrackPt[iprod]->SetMarkerColor(
color[iprod]);
512 hTrackMatchResPhiNegTrackPt[iprod]->SetXTitle(
"#Delta #varphi");
513 hTrackMatchResPhiNegTrackPt[iprod]->SetTitle(Form(
"Track-cluster #varphi residuals, %2.1f < #it{p}_{T}^{track} < %2.1f GeV",emin,emax));
514 hTrackMatchResPhiNegTrackPt[iprod]->SetYTitle(
"entries / N events");
515 hTrackMatchResPhiNegTrackPt[iprod]->SetAxisRange(-0.035,0.035,
"X");
516 hTrackMatchResPhiNegTrackPt[iprod]->SetMarkerStyle(24);
517 hTrackMatchResPhiNegTrackPt[iprod]->SetMarkerColor(
color[iprod]);
519 hTrackMatchResPhiPosTrackPt[iprod]->SetYTitle(
"Entries / N events");
520 hTrackMatchResPhiPosTrackPt[iprod]->SetXTitle(
"#Delta #varphi");
521 hTrackMatchResPhiPosTrackPt[iprod]->SetTitle(Form(
"Track-cluster #varphi residuals, %2.1f < #it{p}_{T}^{track} < %2.1f GeV",emin,emax));
522 hTrackMatchResPhiPosTrackPt[iprod]->SetAxisRange(-0.035,0.035,
"X");
523 hTrackMatchResPhiPosTrackPt[iprod]->SetMarkerStyle(25);
524 hTrackMatchResPhiPosTrackPt[iprod]->SetMarkerColor(
color[iprod]);
526 hTrackMatchResEtaNegTrackPt[iprod]->SetTitleOffset(1.5,
"Y");
527 hTrackMatchResEtaPosTrackPt[iprod]->SetTitleOffset(1.5,
"Y");
528 hTrackMatchResPhiNegTrackPt[iprod]->SetTitleOffset(1.5,
"Y");
529 hTrackMatchResPhiPosTrackPt[iprod]->SetTitleOffset(1.5,
"Y");
533 hRatTrackMatchResPhiPosTrackPt[iprod-1] =
534 (TH1F*)hTrackMatchResPhiPosTrackPt[iprod]->Clone(Form(
"hRatPhiPos%s_%s",prod[iprod].
Data(),histoTag.Data()));
535 hRatTrackMatchResPhiNegTrackPt[iprod-1] =
536 (TH1F*)hTrackMatchResPhiNegTrackPt[iprod]->Clone(Form(
"hRatPhiNeg%s_%s",prod[iprod].
Data(),histoTag.Data()));
537 hRatTrackMatchResEtaPosTrackPt[iprod-1] =
538 (TH1F*)hTrackMatchResEtaPosTrackPt[iprod]->Clone(Form(
"hRatEtaPos%s_%s",prod[iprod].
Data(),histoTag.Data()));
539 hRatTrackMatchResEtaNegTrackPt[iprod-1] =
540 (TH1F*)hTrackMatchResEtaNegTrackPt[iprod]->Clone(Form(
"hRatEtaNeg%s_%s",prod[iprod].
Data(),histoTag.Data()));
542 hRatTrackMatchResPhiPosTrackPt[iprod-1]->Divide(hRatTrackMatchResPhiPosTrackPt[iprod-1],hTrackMatchResPhiPosTrackPt[0],1.000,1,errType);
543 hRatTrackMatchResPhiNegTrackPt[iprod-1]->Divide(hRatTrackMatchResPhiNegTrackPt[iprod-1],hTrackMatchResPhiNegTrackPt[0],1.000,1,errType);
544 hRatTrackMatchResEtaPosTrackPt[iprod-1]->Divide(hRatTrackMatchResEtaPosTrackPt[iprod-1],hTrackMatchResEtaPosTrackPt[0],1.000,1,errType);
545 hRatTrackMatchResEtaNegTrackPt[iprod-1]->Divide(hRatTrackMatchResEtaNegTrackPt[iprod-1],hTrackMatchResEtaNegTrackPt[0],1.000,1,errType);
555 TCanvas * ccalo =
new TCanvas(Form(
"Cluster_%s",histoTag.Data()),
"",1000,500);
565 hRaw [iprod]->Draw(
"same");
566 hCorr[iprod]->Draw(
"same");
567 hTM [iprod]->Draw(
"same");
568 hShSh[iprod]->Draw(
"same");
570 lprod.AddEntry(hRaw[iprod],prodLeg[iprod],
"P");
575 TLegend lcl(0.55,0.7,0.95,0.89);
576 lcl.SetTextSize(0.04);
577 lcl.SetBorderSize(0);
579 lcl.AddEntry(hRaw [0],
"Raw",
"P");
580 lcl.AddEntry(hCorr[0],
"No Exotics + non lin.",
"P");
581 lcl.AddEntry(hTM [0],
"+ Track matching",
"P");
582 lcl.AddEntry(hShSh[0],
"+ #lambda^{2}_{0} < 0.4",
"P");
590 hRatCorr[0]->SetTitle(
"Cluster spectra ratio");
591 hRatCorr[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
594 hRatCorr[0]->SetMinimum(0.95);
595 hRatCorr[0]->SetMaximum(1.05);
596 hRatCorr[0]->Draw(
"");
598 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
600 hRatRaw [iprod]->Draw(
"same");
601 hRatCorr[iprod]->Draw(
"same");
602 hRatTM [iprod]->Draw(
"same");
603 hRatShSh[iprod]->Draw(
"same");
616 ccalo->Print(Form(
"%s_ClusterSpectraComp.%s",histoTag.Data(),format.Data()));
621 TGaxis::SetMaxDigits(3);
623 TLegend lres(0.6,0.75,0.84,0.89);
624 lres.SetTextSize(0.04);
626 lres.SetFillColor(0);
627 lres.AddEntry(hTrackMatchResEtaNeg[0],
"Negative",
"P");
628 lres.AddEntry(hTrackMatchResEtaPos[0],
"Positive",
"P");
631 TCanvas * ccalo2 =
new TCanvas(Form(
"MatchingResiduals_%s",histoTag.Data()),
"",1000,1000);
637 Double_t max = hTrackMatchResEtaPos[0]->GetMaximum();
638 if(max < hTrackMatchResEtaNeg[0]->GetMaximum()) max = hTrackMatchResEtaNeg[0]->GetMaximum();
640 hTrackMatchResEtaPos[0]->SetMaximum(max*1.2);
642 hTrackMatchResEtaPos[0]->Draw(
"");
645 hTrackMatchResEtaNeg[iprod]->Draw(
"same");
646 hTrackMatchResEtaPos[iprod]->Draw(
"same");
649 TLine l0Eta(0,hTrackMatchResEtaPos[0]->GetMinimum(),0,hTrackMatchResEtaPos[0]->GetMaximum());
650 l0Eta.SetLineColor(2);
651 l0Eta.SetLineWidth(2);
658 max = hTrackMatchResPhiPos[0]->GetMaximum();
659 if(max < hTrackMatchResPhiNeg[0]->GetMaximum()) max = hTrackMatchResPhiNeg[0]->GetMaximum();
661 hTrackMatchResPhiPos[0]->SetMaximum(max*1.2);
663 hTrackMatchResPhiPos[0]->Draw(
"");
666 hTrackMatchResPhiNeg[iprod]->Draw(
"same");
667 hTrackMatchResPhiPos[iprod]->Draw(
"same");
670 TLine l0Phi(0,hTrackMatchResPhiPos[0]->GetMinimum(),0,hTrackMatchResPhiPos[0]->GetMaximum());
671 l0Phi.SetLineColor(2);
672 l0Phi.SetLineWidth(2);
678 hRatTrackMatchResEtaPos[0]->SetMaximum(1.3);
679 hRatTrackMatchResEtaPos[0]->SetMinimum(0.9);
680 hRatTrackMatchResEtaPos[0]->Draw(
"");
681 hRatTrackMatchResEtaPos[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
682 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
684 hRatTrackMatchResEtaNeg[iprod]->Draw(
"same");
685 hRatTrackMatchResEtaPos[iprod]->Draw(
"same");
692 hRatTrackMatchResPhiPos[0]->SetMaximum(1.3);
693 hRatTrackMatchResPhiPos[0]->SetMinimum(0.9);
694 hRatTrackMatchResPhiPos[0]->Draw(
"");
695 hRatTrackMatchResPhiPos[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
696 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
698 hRatTrackMatchResPhiNeg[iprod]->Draw(
"same");
699 hRatTrackMatchResPhiPos[iprod]->Draw(
"same");
702 ccalo2->Print(Form(
"%s_MatchingResidualsComp.%s",histoTag.Data(),format.Data()));
706 if ( h2TrackMatchResEtaNegTrackPt[0] )
708 TGaxis::SetMaxDigits(3);
710 TLine l0Eta(0,hTrackMatchResEtaNeg[0]->GetMinimum(),0,hTrackMatchResEtaNeg[0]->GetMaximum());
712 TLegend lres(0.6,0.75,0.84,0.89);
713 lres.SetTextSize(0.04);
715 lres.SetFillColor(0);
716 lres.AddEntry(hTrackMatchResEtaNeg[0],
"Negative",
"P");
717 lres.AddEntry(hTrackMatchResEtaPos[0],
"Positive",
"P");
720 TCanvas * ccalo3 =
new TCanvas(Form(
"MatchingResiduals_TrackPtBin_%s",histoTag.Data()),
"",1000,1000);
726 hTrackMatchResEtaPosTrackPt[0]->SetMaximum(hTrackMatchResEtaPosTrackPt[0]->GetMaximum()*1.3);
728 hTrackMatchResEtaPosTrackPt[0]->Draw(
"");
731 hTrackMatchResEtaNegTrackPt[iprod]->Draw(
"same");
732 hTrackMatchResEtaPosTrackPt[iprod]->Draw(
"same");
735 l0Eta.SetLineColor(2);
736 l0Eta.SetLineWidth(2);
743 hTrackMatchResPhiPosTrackPt[0]->Draw(
"");
746 hTrackMatchResPhiNegTrackPt[iprod]->Draw(
"same");
747 hTrackMatchResPhiPosTrackPt[iprod]->Draw(
"same");
750 TLine l0Phi(0,hTrackMatchResPhiNegTrackPt[0]->GetMinimum(),0,hTrackMatchResPhiNegTrackPt[0]->GetMaximum());
751 l0Phi.SetLineColor(2);
752 l0Phi.SetLineWidth(2);
758 hRatTrackMatchResEtaPosTrackPt[0]->SetMaximum(1.2);
759 hRatTrackMatchResEtaPosTrackPt[0]->SetMinimum(0.8);
760 hRatTrackMatchResEtaPosTrackPt[0]->Draw(
"");
761 hRatTrackMatchResEtaPosTrackPt[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
762 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
764 hRatTrackMatchResEtaNegTrackPt[iprod]->Draw(
"same");
765 hRatTrackMatchResEtaPosTrackPt[iprod]->Draw(
"same");
772 hRatTrackMatchResPhiPosTrackPt[0]->SetMaximum(1.2);
773 hRatTrackMatchResPhiPosTrackPt[0]->SetMinimum(0.8);
774 hRatTrackMatchResPhiPosTrackPt[0]->Draw(
"");
775 hRatTrackMatchResPhiPosTrackPt[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
776 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
778 hRatTrackMatchResPhiNegTrackPt[iprod]->Draw(
"same");
779 hRatTrackMatchResPhiPosTrackPt[iprod]->Draw(
"same");
782 ccalo3->Print(Form(
"%s_MatchingResidualsTrackPtBinComp.%s",histoTag.Data(),format.Data()));
800 TH1F* hRatNC1[
nProd-1];
801 TH1F* hRatNC2[
nProd-1];
802 TH1F* hRatAmp[
nProd-1];
805 TLegend lprod(0.65,0.525,0.95,0.675);
806 lprod.SetTextSize(0.04);
807 lprod.SetBorderSize(0);
808 lprod.SetFillColor(0);
812 hAmp[iprod] = (TH1F*)
GetHisto(
"QA_Cell_hAmplitude",iprod);
813 hNC1[iprod] = (TH1F*)
GetHisto(
"QA_Cell_hNCells",iprod);
814 hNC2[iprod] = (TH1F*)
GetHisto(
"QA_Cell_hNCellsCutAmpMin",iprod);
816 if(!hAmp[iprod])
return;
818 hAmp[iprod]->Rebin(2);
819 hNC1[iprod]->Rebin(2);
820 hNC2[iprod]->Rebin(2);
824 hAmp[iprod]->Sumw2();
825 hNC1[iprod]->Sumw2();
826 hNC2[iprod]->Sumw2();
828 hAmp[iprod]->Scale(1./
nEvents[iprod]);
829 hNC1[iprod]->Scale(1./
nEvents[iprod]);
830 hNC2[iprod]->Scale(1./
nEvents[iprod]);
833 hAmp[iprod]->SetMarkerColor(
color[iprod]);
834 hAmp[iprod]->SetMarkerStyle(20);
835 hAmp[iprod]->SetTitle(
"Cell energy spectra");
836 hAmp[iprod]->SetYTitle(
"1/N_{events} dN/dp_{T}");
837 hAmp[iprod]->SetTitleOffset(1.5,
"Y");
838 hAmp[iprod]->SetAxisRange(0.,10.,
"X");
843 hNC1[iprod]->SetTitle(
"Number of EMCal/DCal cells");
844 hNC1[iprod]->SetYTitle(
"1/N_{events} dN/dp_{T}");
846 hNC1[iprod]->SetTitleOffset(1.5,
"Y");
847 hNC1[iprod]->SetMarkerColor(
color[iprod]);
848 hNC1[iprod]->SetMarkerStyle(20);
849 hNC1[iprod]->SetAxisRange(0.,100.,
"X");
850 hNC1[iprod]->SetMaximum(5);
851 hNC1[iprod]->SetMinimum(1e-10);
853 hNC2[iprod]->SetMarkerColor(
color[iprod]);
854 hNC2[iprod]->SetMarkerStyle(21);
857 hAmp[iprod]->SetTitleOffset(1.5,
"Y");
858 hNC2[iprod]->SetTitleOffset(1.5,
"Y");
859 hNC1[iprod]->SetTitleOffset(1.5,
"Y");
863 hRatAmp[iprod-1] = (TH1F*)hAmp[iprod]->Clone(Form(
"hRatAmp%s_%s",prod[iprod].
Data(),histoTag.Data()));
864 hRatNC1[iprod-1] = (TH1F*)hNC1[iprod]->Clone(Form(
"hRatNC1%s_%s",prod[iprod].
Data(),histoTag.Data()));
865 hRatNC2[iprod-1] = (TH1F*)hNC2[iprod]->Clone(Form(
"hRatNC2%s_%s",prod[iprod].
Data(),histoTag.Data()));
871 hRatAmp[iprod-1]->Divide(hRatAmp[iprod-1],hAmp[0],1.000,1,errType);
872 hRatNC1[iprod-1]->Divide(hRatNC1[iprod-1],hNC1[0],1.000,1,errType);
873 hRatNC2[iprod-1]->Divide(hRatNC2[iprod-1],hNC2[0],1.000,1,errType);
883 TCanvas * cn =
new TCanvas(Form(
"NCell_%s",histoTag.Data()),
"",1000,500);
893 hNC1[iprod]->Draw(
"same");
894 hNC2[iprod]->Draw(
"same");
896 lprod.AddEntry(hNC1[iprod],prodLeg[iprod],
"P");
901 TLegend lcl(0.55,0.7,0.95,0.89);
902 lcl.SetTextSize(0.04);
903 lcl.SetBorderSize(0);
905 lcl.AddEntry(hNC1[0],
"E > 50 MeV",
"P");
906 lcl.AddEntry(hNC2[0],
"E > 200 MeV",
"P");
914 hRatNC1[0]->SetTitle(
"N cell ratio");
915 hRatNC1[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
918 hRatNC1[0]->SetMinimum(0.7);
919 hRatNC1[0]->SetMaximum(1.3);
920 hRatNC1[0]->Draw(
"");
922 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
924 hRatNC1[iprod]->Draw(
"same");
925 hRatNC2[iprod]->Draw(
"same");
928 cn->Print(Form(
"%s_NCellComp.%s",histoTag.Data(),format.Data()));
932 TCanvas * cE =
new TCanvas(Form(
"Cell_Energy_%s",histoTag.Data()),
"",1000,500);
942 hAmp[iprod]->Draw(
"same");
953 hRatAmp[0]->SetTitle(
"Cell E spectra ratio");
954 hRatAmp[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
957 hRatAmp[0]->SetMinimum(0.7);
958 hRatAmp[0]->SetMaximum(1.3);
959 hRatAmp[0]->Draw(
"");
961 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
963 hRatAmp[iprod]->Draw(
"same");
966 cE->Print(Form(
"%s_CellEnergyComp.%s",histoTag.Data(),format.Data()));
980 const Int_t nEbins = 4;
981 Float_t ebins [] = {2,4,6,8,10,12,16,20};
984 TH1F* hNCell [
nProd][nEbins];
985 TH1F* hNCellRat[
nProd][nEbins];
987 TH1F* hECell [
nProd][nEbins];
988 TH1F* hECellRat[
nProd][nEbins];
991 TLegend lprod(0.6,0.7,0.95,0.89);
992 lprod.SetTextSize(0.04);
993 lprod.SetBorderSize(0);
994 lprod.SetFillColor(0);
999 h2NCell[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hNCellsE",icalo),iprod);
1000 h2ECell[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hCellsE" ,icalo),iprod);
1002 if(!h2NCell[iprod] || !h2ECell[iprod])
return;
1004 for(
Int_t ie = 0; ie < nEbins; ie++)
1006 Float_t binMin = h2NCell[iprod]->GetXaxis()->FindBin(ebins[ie]);
1007 Float_t binMax = h2NCell[iprod]->GetXaxis()->FindBin(ebins[ie+1])-1;
1010 (TH1F*) h2NCell[iprod]->ProjectionY(Form(
"DeltaProjNCell_%s_MC%s_ie%d",
1011 prod[iprod].
Data(),histoTag.Data(),ie),
1015 (TH1F*) h2ECell[iprod]->ProjectionY(Form(
"DeltaProjECell_%s_MC%s_ie%d",
1016 prod[iprod].
Data(),histoTag.Data(),ie),
1020 hNCell[iprod][ie]->SetYTitle(
"Entries / N events");
1021 hNCell[iprod][ie]->SetTitle(Form(
"%2.1f < #it{E}^{cluster} < %2.1f GeV",ebins[ie],ebins[ie+1]));
1022 hNCell[iprod][ie]->SetAxisRange(0.,15,
"X");
1024 hNCell[iprod][ie]->SetMarkerColor(
color[iprod]);
1025 hNCell[iprod][ie]->SetLineColor (
color[iprod]);
1029 hNCell[iprod][ie]->Sumw2();
1030 hNCell[iprod][ie]->Scale(1./
nEvents[iprod]);
1033 hNCell[iprod][ie]->SetTitleOffset(1.5,
"Y");
1036 hECell[iprod][ie]->SetYTitle(
"Entries / N events");
1037 hECell[iprod][ie]->SetTitle(Form(
"%2.1f < #it{E}^{cluster} < %2.1f GeV",ebins[ie],ebins[ie+1]));
1038 hECell[iprod][ie]->SetAxisRange(0.0,ebins[ie+1],
"X");
1040 hECell[iprod][ie]->SetMarkerColor(
color[iprod]);
1041 hECell[iprod][ie]->SetLineColor (
color[iprod]);
1045 hECell[iprod][ie]->Sumw2();
1046 hECell[iprod][ie]->Scale(1./
nEvents[iprod]);
1049 hECell[iprod][ie]->SetTitleOffset(1.5,
"Y");
1053 hECellRat[iprod][ie] = (TH1F*) hECell[iprod][ie]->Clone(Form(
"Ratio_%s",hECell[iprod][ie]->GetName()));
1054 hNCellRat[iprod][ie] = (TH1F*) hNCell[iprod][ie]->Clone(Form(
"Ratio_%s",hNCell[iprod][ie]->GetName()));
1056 hECellRat[iprod][ie]->Divide(hECell[iprod][ie],hECell[0][ie],1,1,errType);
1057 hNCellRat[iprod][ie]->Divide(hNCell[iprod][ie],hNCell[0][ie],1,1,errType);
1061 hECellRat[iprod][ie] = 0;
1062 hNCellRat[iprod][ie] = 0;
1066 lprod.AddEntry(hNCell[iprod][0],prodLeg[iprod],
"LP");
1076 TGaxis::SetMaxDigits(3);
1078 TCanvas * cNCell =
new TCanvas(Form(
"NCell_%s",histoTag.Data()),
"",1000,1000);
1079 cNCell->Divide(2,2);
1081 for(
Int_t ie = 0; ie < nEbins; ie++)
1086 hNCell[0][ie]->Draw(
"H");
1089 hNCell[iprod][ie]->Draw(
"Hsame");
1095 cNCell->Print(Form(
"%s_NCell.%s",histoTag.Data(),format.Data()));
1097 TCanvas * cECell =
new TCanvas(Form(
"ECell_%s",histoTag.Data()),
"",1000,1000);
1098 cECell->Divide(2,2);
1100 for(
Int_t ie = 0; ie < nEbins; ie++)
1105 hECell[0][ie]->Draw(
"H");
1108 hECell[iprod][ie]->Draw(
"Hsame");
1114 cECell->Print(Form(
"%s_ECell.%s",histoTag.Data(),format.Data()));
1118 TCanvas * cNCellR =
new TCanvas(Form(
"RatioNCell_%s",histoTag.Data()),
"",1000,1000);
1119 cNCellR->Divide(2,2);
1121 for(
Int_t ie = 0; ie < nEbins; ie++)
1126 hNCellRat[1][ie]->Draw(
"H");
1127 hNCellRat[1][ie]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
1132 hNCellRat[iprod][ie]->Draw(
"Hsame");
1138 cNCellR->Print(Form(
"%s_NCell_Ratio.%s",histoTag.Data(),format.Data()));
1140 TCanvas * cECellR =
new TCanvas(Form(
"RatioECell_%s",histoTag.Data()),
"",1000,1000);
1141 cECellR->Divide(2,2);
1143 for(
Int_t ie = 0; ie < nEbins; ie++)
1148 hECellRat[1][ie]->Draw(
"H");
1149 hECellRat[1][ie]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
1150 hECellRat[1][ie]->SetMaximum(1.2);
1151 hECellRat[1][ie]->SetMinimum(0.6);
1154 hECellRat[iprod][ie]->Draw(
"Hsame");
1160 cECellR->Print(Form(
"%s_ECell_Ratio.%s",histoTag.Data(),format.Data()));
1178 const Int_t nEbins = 4;
1179 Float_t ebins [] = {1,2,4,6,10};
1181 TH1F* hParticleRecoE[
nProd];
1182 TH1F* hRatParticleRecoE [
nProd-1];
1184 TH1F* hParticleGeneE[
nProd];
1185 TH1F* hRatParticleGeneE [
nProd-1];
1188 TH1F* hParticleRecoEDelta[
nProd][nEbins];
1191 TLegend lprod(0.6,0.475,0.95,0.675);
1192 lprod.SetTextSize(0.04);
1193 lprod.SetBorderSize(0);
1194 lprod.SetFillColor(0);
1197 TLegend legPa(0.6,0.7,0.95,0.89);
1198 legPa.SetTextSize(0.04);
1199 legPa.SetBorderSize(0);
1200 legPa.SetFillColor(0);
1204 hParticleRecoE [iprod] = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hE_MC%s",icalo,particle.Data()),iprod);
1205 hParticleGeneE [iprod] = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPtPrim_MC%s",icalo,particle.Data()),iprod);
1207 if(!hParticleRecoE[iprod])
return;
1209 hParticleRecoE[iprod]->Rebin(5);
1210 hParticleGeneE[iprod]->Rebin(5);
1213 hParticleRecoE[iprod]->Sumw2();
1214 hParticleRecoE[iprod]->Scale(1./
nEvents[iprod]);
1216 hParticleGeneE[iprod]->Sumw2();
1217 hParticleGeneE[iprod]->Scale(1./
nEvents[iprod]);
1220 hParticleRecoE[iprod]->SetTitle(Form(
"Generated and reconstructed %s spectra",particle.Data()));
1221 hParticleRecoE[iprod]->SetYTitle(
"1/N_{events} dN/dp_{T}");
1222 hParticleRecoE[iprod]->SetTitleOffset(1.5,
"Y");
1223 hParticleRecoE[iprod]->SetAxisRange(10.,70.,
"X");
1227 hParticleRecoE[iprod]->SetMarkerColor(
color[iprod]);
1228 hParticleRecoE[iprod]->SetMarkerStyle(20);
1230 hParticleGeneE[iprod]->SetMarkerColor(
color[iprod]);
1231 hParticleGeneE[iprod]->SetMarkerStyle(24);
1235 hRatParticleRecoE [iprod-1] = (TH1F*)hParticleRecoE [iprod]->Clone(Form(
"hRatParticleRecoE%s_MC%s_%s" ,prod[iprod].
Data(),particle.Data(),histoTag.Data()));
1237 hRatParticleRecoE [iprod-1]->Divide(hRatParticleRecoE [iprod-1],hParticleRecoE [0],1,1,errType);
1239 hRatParticleGeneE [iprod-1] = (TH1F*)hParticleGeneE [iprod]->Clone(Form(
"hRatParticleGeneE%s_MC%s_%s" ,prod[iprod].
Data(),particle.Data(),histoTag.Data()));
1241 hRatParticleGeneE [iprod-1]->Divide(hRatParticleGeneE [iprod-1],hParticleGeneE [0],1,1,errType);
1247 h2ParticleRecoEDelta[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hDeltaE_MC%s",icalo,particle.Data()),iprod);
1249 for(
Int_t ie = 0; ie < nEbins; ie++)
1251 Float_t binMin = h2ParticleRecoEDelta[iprod]->GetXaxis()->FindBin(ebins[ie]);
1252 Float_t binMax = h2ParticleRecoEDelta[iprod]->GetXaxis()->FindBin(ebins[ie+1])-1;
1254 hParticleRecoEDelta[iprod][ie] =
1255 (TH1F*) h2ParticleRecoEDelta[iprod]->ProjectionY(Form(
"DeltaProj_%s_%s_MC%s_ie%d",
1256 prod[iprod].
Data(),histoTag.Data(),particle.Data(),ie),
1260 hParticleRecoEDelta[iprod][ie]->SetXTitle(
"#it{E}_{reco}-#it{E}_{gen} (GeV)");
1261 hParticleRecoEDelta[iprod][ie]->SetYTitle(
"Entries / N events");
1262 hParticleRecoEDelta[iprod][ie]->SetTitle(Form(
"Reco MC %s, %2.1f < #it{E}^{cluster} < %2.1f GeV",particle.Data(),ebins[ie],ebins[ie+1]));
1263 hParticleRecoEDelta[iprod][ie]->SetAxisRange(-3,3,
"X");
1264 hParticleRecoEDelta[iprod][ie]->SetMarkerStyle(24);
1265 hParticleRecoEDelta[iprod][ie]->SetMarkerColor(
color[iprod]);
1269 hParticleRecoEDelta[iprod][ie]->Sumw2();
1270 hParticleRecoEDelta[iprod][ie]->Scale(1./
nEvents[iprod]);
1272 hParticleRecoEDelta[iprod][ie]->SetTitleOffset(1.5,
"Y");
1282 TCanvas * ccalo =
new TCanvas(Form(
"Cluster_MC%s_%s",particle.Data(),histoTag.Data()),
"",1000,500);
1289 hParticleRecoE[0]->Draw();
1292 hParticleRecoE [iprod]->Draw(
"same");
1293 hParticleGeneE [iprod]->Draw(
"same");
1295 lprod.AddEntry(hParticleRecoE[iprod],prodLeg[iprod],
"P");
1298 legPa.AddEntry(hParticleRecoE[iprod],
"Reconstructed",
"P");
1299 legPa.AddEntry(hParticleGeneE[iprod],
"Generated",
"P");
1311 hRatParticleRecoE[0]->SetTitle(Form(
"MC %s spectra ratio",particle.Data()));
1312 hRatParticleRecoE[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
1315 hRatParticleRecoE[0]->SetMinimum(0.95);
1316 hRatParticleRecoE[0]->SetMaximum(1.05);
1317 hRatParticleRecoE[0]->Draw(
"");
1319 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
1321 hRatParticleRecoE[iprod]->Draw(
"same");
1322 hRatParticleGeneE[iprod]->Draw(
"same");
1325 ccalo->Print(Form(
"%s_ClusterSpectra_MC%s.%s",histoTag.Data(),particle.Data(),format.Data()));
1330 TGaxis::SetMaxDigits(3);
1332 TCanvas * ccalo2 =
new TCanvas(Form(
"Resolution_MC%s_%s",particle.Data(),histoTag.Data()),
"",1000,1000);
1333 ccalo2->Divide(2,2);
1335 for(
Int_t ie = 0; ie < nEbins; ie++)
1340 hParticleRecoEDelta[0][ie]->Draw(
"");
1343 hParticleRecoEDelta[iprod][ie]->Draw(
"same");
1349 ccalo2->Print(Form(
"%s_ClusterERecoGenDiff_MC%s.%s",histoTag.Data(),particle.Data(),format.Data()));
1363 const Int_t nEbins = 7;
1364 Float_t ebins [] = {2,4,6,8,10,12,16,20};
1367 TH1F* hM02 [
nProd][nEbins];
1369 TH1F* hM20 [
nProd][nEbins];
1372 TLegend lprod(0.6,0.475,0.95,0.675);
1373 lprod.SetTextSize(0.04);
1374 lprod.SetBorderSize(0);
1375 lprod.SetFillColor(0);
1380 h2M02[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hLam0E",icalo),iprod);
1381 h2M20[iprod] = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hLam1E",icalo),iprod);
1383 if(!h2M02[iprod] || !h2M20[iprod])
return;
1385 for(
Int_t ie = 0; ie < nEbins; ie++)
1387 Float_t binMin = h2M02[iprod]->GetXaxis()->FindBin(ebins[ie]);
1388 Float_t binMax = h2M02[iprod]->GetXaxis()->FindBin(ebins[ie+1])-1;
1391 (TH1F*) h2M02[iprod]->ProjectionY(Form(
"DeltaProjM02_%s_MC%s_ie%d",
1392 prod[iprod].
Data(),histoTag.Data(),ie),
1396 (TH1F*) h2M20[iprod]->ProjectionY(Form(
"DeltaProjM20_%s_MC%s_ie%d",
1397 prod[iprod].
Data(),histoTag.Data(),ie),
1401 hM02[iprod][ie]->SetYTitle(
"Entries / N events");
1402 hM02[iprod][ie]->SetTitle(Form(
"%2.1f < #it{E}^{cluster} < %2.1f GeV",ebins[ie],ebins[ie+1]));
1403 hM02[iprod][ie]->SetAxisRange(0.1,0.8,
"X");
1405 hM02[iprod][ie]->SetMarkerColor(
color[iprod]);
1406 hM02[iprod][ie]->SetLineColor (
color[iprod]);
1410 hM02[iprod][ie]->Sumw2();
1411 hM02[iprod][ie]->Scale(1./
nEvents[iprod]);
1414 hM02[iprod][ie]->SetTitleOffset(1.5,
"Y");
1418 hM20[iprod][ie]->SetYTitle(
"Entries / N events");
1419 hM20[iprod][ie]->SetTitle(Form(
"%2.1f < #it{E}^{cluster} < %2.1f GeV",ebins[ie],ebins[ie+1]));
1420 hM20[iprod][ie]->SetAxisRange(0.0,0.5,
"X");
1422 hM20[iprod][ie]->SetMarkerColor(
color[iprod]);
1423 hM20[iprod][ie]->SetLineColor (
color[iprod]);
1427 hM20[iprod][ie]->Sumw2();
1428 hM20[iprod][ie]->Scale(1./
nEvents[iprod]);
1431 hM20[iprod][ie]->SetTitleOffset(1.5,
"Y");
1434 lprod.AddEntry(hM02[iprod][0],prodLeg[iprod],
"LP");
1444 TGaxis::SetMaxDigits(3);
1446 TCanvas * cM02 =
new TCanvas(Form(
"M02_%s",histoTag.Data()),
"",1000,1000);
1449 for(
Int_t ie = 0; ie < nEbins; ie++)
1454 hM02[0][ie]->Draw(
"H");
1457 hM02[iprod][ie]->Draw(
"Hsame");
1463 cM02->Print(Form(
"%s_M02.%s",histoTag.Data(),format.Data()));
1465 TCanvas * cM20 =
new TCanvas(Form(
"M20_%s",histoTag.Data()),
"",1000,1000);
1468 for(
Int_t ie = 0; ie < nEbins; ie++)
1473 hM20[0][ie]->Draw(
"H");
1476 hM20[iprod][ie]->Draw(
"Hsame");
1482 cM20->Print(Form(
"%s_M20.%s",histoTag.Data(),format.Data()));
1496 TH1F * hTrackPt[
nProd] ;
1497 TH1F * hTrackPtSPD[
nProd] ;
1498 TH1F * hTrackPtNoSPD[
nProd] ;
1499 TH1F * hRatTrackPt[
nProd-1] ;
1500 TH1F * hRatTrackPtSPD[
nProd-1] ;
1501 TH1F * hRatTrackPtNoSPD[
nProd-1] ;
1506 TH1F * hTrackPhi[
nProd] ;
1507 TH1F * hTrackPhiSPD[
nProd] ;
1508 TH1F * hTrackPhiNoSPD[
nProd] ;
1509 TH1F * hRatTrackPhi[
nProd-1] ;
1510 TH1F * hRatTrackPhiSPD[
nProd-1] ;
1511 TH1F * hRatTrackPhiNoSPD[
nProd-1] ;
1514 TLegend lprod(0.5,0.475,0.84,0.675);
1515 lprod.SetTextSize(0.04);
1516 lprod.SetBorderSize(0);
1517 lprod.SetFillColor(0);
1521 hTrackPt [iprod] = (TH1F*)
GetHisto(
"AnaHadrons_hPt" ,iprod);
1522 if ( !hTrackPt[iprod] )
return;
1524 hTrackPtSPD [iprod] = (TH1F*)
GetHisto(
"AnaHadrons_hPtSPDRefit" ,iprod);
1525 hTrackPtNoSPD [iprod] = (TH1F*)
GetHisto(
"AnaHadrons_hPtNoSPDRefit" ,iprod);
1526 hTrackEtaPhiSPD [iprod] = (
TH2F*)
GetHisto(
"AnaHadrons_hEtaPhiSPDRefitPt02" ,iprod);
1527 hTrackEtaPhiNoSPD[iprod] = (
TH2F*)
GetHisto(
"AnaHadrons_hEtaPhiNoSPDRefitPt02",iprod);
1528 hTrackEtaPhi [iprod] = (
TH2F*)
GetHisto(
"AnaHadrons_hEtaPhiPositive" ,iprod);
1529 hTrackEtaPhi [iprod]->Add((
TH2F*)
GetHisto(
"AnaHadrons_hEtaPhiNegative" ,iprod));
1531 hTrackPhiSPD [iprod] = (TH1F*)hTrackEtaPhiSPD [iprod]->ProjectionY(Form(
"hTrackPhiSPD%s" ,prod[iprod].
Data()),0,1000);
1532 hTrackPhiNoSPD [iprod] = (TH1F*)hTrackEtaPhiNoSPD[iprod]->ProjectionY(Form(
"hTrackPhiNoSPD%s",prod[iprod].
Data()),0,1000);
1533 hTrackPhi [iprod] = (TH1F*)hTrackEtaPhi [iprod]->ProjectionY(Form(
"hTrackPhi%s" ,prod[iprod].
Data()),0,1000);
1535 hTrackPt [iprod]->Rebin(5);
1536 hTrackPtSPD [iprod]->Rebin(5);
1537 hTrackPtNoSPD[iprod]->Rebin(5);
1539 hTrackPhi [iprod]->Rebin(5);
1540 hTrackPhiSPD [iprod]->Rebin(5);
1541 hTrackPhiNoSPD[iprod]->Rebin(5);
1545 hTrackPt [iprod]->Sumw2();
1546 hTrackPtSPD [iprod]->Sumw2();
1547 hTrackPtNoSPD[iprod]->Sumw2();
1549 hTrackPt [iprod]->Scale(1./
nEvents[iprod]);
1550 hTrackPtSPD [iprod]->Scale(1./
nEvents[iprod]);
1551 hTrackPtNoSPD[iprod]->Scale(1./
nEvents[iprod]);
1553 hTrackPhi [iprod]->Sumw2();
1554 hTrackPhiSPD [iprod]->Sumw2();
1555 hTrackPhiNoSPD[iprod]->Sumw2();
1557 hTrackPhi [iprod]->Scale(1./
nEvents[iprod]);
1558 hTrackPhiSPD [iprod]->Scale(1./
nEvents[iprod]);
1559 hTrackPhiNoSPD[iprod]->Scale(1./
nEvents[iprod]);
1562 hTrackPt[iprod]->SetTitle(
"Track spectra with/out SPD");
1563 hTrackPt[iprod]->SetYTitle(
"1/N_{events} dN/dp_{T}");
1564 hTrackPt[iprod]->SetTitleOffset(1.5,
"Y");
1565 hTrackPt[iprod]->SetMarkerColor(
color[iprod]);
1566 hTrackPt[iprod]->SetMarkerStyle(20);
1567 hTrackPt[iprod]->SetAxisRange(0.,30.,
"X");
1571 hTrackPtSPD[iprod]->SetMarkerColor(
color[iprod]);
1572 hTrackPtSPD[iprod]->SetMarkerStyle(26);
1574 hTrackPtNoSPD[iprod]->SetMarkerColor(
color[iprod]);
1575 hTrackPtNoSPD[iprod]->SetMarkerStyle(25);
1577 hTrackPhi[iprod]->SetTitle(
"Track #varphi with/out SPD");
1578 hTrackPhi[iprod]->SetYTitle(
"1/N_{events} dN/d#varphi");
1579 hTrackPhi[iprod]->SetTitleOffset(1.5,
"Y");
1580 hTrackPhi[iprod]->SetMarkerColor(
color[iprod]);
1581 hTrackPhi[iprod]->SetMarkerStyle(20);
1582 hTrackPhi[iprod]->SetAxisRange(0.,30.,
"X");
1586 hTrackPhiSPD[iprod]->SetMarkerColor(
color[iprod]);
1587 hTrackPhiSPD[iprod]->SetMarkerStyle(26);
1589 hTrackPhiNoSPD[iprod]->SetMarkerColor(
color[iprod]);
1590 hTrackPhiNoSPD[iprod]->SetMarkerStyle(25);
1592 lprod.AddEntry(hTrackPt[iprod],prodLeg[iprod],
"P");
1596 hRatTrackPhi [iprod-1] = (TH1F*)hTrackPhi [iprod]->Clone(Form(
"hRatTrackPhi%s" ,prod[iprod].
Data()));
1597 hRatTrackPhiNoSPD[iprod-1] = (TH1F*)hTrackPhiNoSPD[iprod]->Clone(Form(
"hRatTrackPhiNoSPD%s",prod[iprod].
Data()));
1598 hRatTrackPhiSPD [iprod-1] = (TH1F*)hTrackPhiSPD [iprod]->Clone(Form(
"hRatTrackPhiSPD%s" ,prod[iprod].
Data()));
1600 hRatTrackPhi [iprod-1]->Divide(hRatTrackPhi [iprod-1],hTrackPhi [0],1.000,1,errType);
1601 hRatTrackPhiSPD [iprod-1]->Divide(hRatTrackPhiSPD [iprod-1],hTrackPhiSPD [0],1.000,1,errType);
1602 hRatTrackPhiNoSPD[iprod-1]->Divide(hRatTrackPhiNoSPD[iprod-1],hTrackPhiNoSPD[0],1.000,1,errType);
1604 hRatTrackPt [iprod-1] = (TH1F*)hTrackPt [iprod]->Clone(Form(
"hRatTrackPt%s" ,prod[iprod].
Data()));
1605 hRatTrackPtNoSPD[iprod-1] = (TH1F*)hTrackPtNoSPD[iprod]->Clone(Form(
"hRatTrackPtNoSPD%s",prod[iprod].
Data()));
1606 hRatTrackPtSPD [iprod-1] = (TH1F*)hTrackPtSPD [iprod]->Clone(Form(
"hRatTrackPtSPD%s" ,prod[iprod].
Data()));
1608 hRatTrackPt [iprod-1]->Divide(hRatTrackPt [iprod-1],hTrackPt [0],1.000,1,errType);
1609 hRatTrackPtSPD [iprod-1]->Divide(hRatTrackPtSPD [iprod-1],hTrackPtSPD [0],1.000,1,errType);
1610 hRatTrackPtNoSPD[iprod-1]->Divide(hRatTrackPtNoSPD[iprod-1],hTrackPtNoSPD[0],1.000,1,errType);
1621 TLegend ltrack(0.6,0.75,0.84,0.89);
1622 ltrack.SetTextSize(0.04);
1624 ltrack.SetFillColor(0);
1625 ltrack.AddEntry(hTrackPt [0],
"All",
"P");
1626 ltrack.AddEntry(hTrackPtSPD [0],
"SPD",
"P");
1627 ltrack.AddEntry(hTrackPtNoSPD[0],
"No SPD",
"P");
1629 TCanvas * ctrack =
new TCanvas(Form(
"TrackHisto_%s",histoTag.Data()),
"",1500,1500);
1630 ctrack->Divide(2,2);
1633 hTrackPt[0]->Draw(
"");
1637 hTrackPt [iprod]->Draw(
"same");
1638 hTrackPtSPD [iprod]->Draw(
"same");
1639 hTrackPtNoSPD[iprod]->Draw(
"same");
1648 hRatTrackPt[0]->SetMaximum(1.2);
1649 hRatTrackPt[0]->SetMinimum(0.8);
1650 hRatTrackPt[0]->Draw(
"");
1651 hRatTrackPt[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
1652 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
1654 hRatTrackPt [iprod]->Draw(
"same");
1655 hRatTrackPtSPD [iprod]->Draw(
"same");
1656 hRatTrackPtNoSPD[iprod]->Draw(
"same");
1662 hTrackPhi[0]->Draw(
"");
1665 hTrackPhi [iprod]->Draw(
"same");
1666 hTrackPhiSPD [iprod]->Draw(
"same");
1667 hTrackPhiNoSPD[iprod]->Draw(
"same");
1673 hRatTrackPhi[0]->SetMaximum(1.02);
1674 hRatTrackPhi[0]->SetMinimum(0.95);
1675 hRatTrackPhi[0]->Draw(
"");
1676 hRatTrackPhi[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
1677 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
1679 hRatTrackPhi [iprod]->Draw(
"same");
1680 hRatTrackPhiSPD [iprod]->Draw(
"same");
1681 hRatTrackPhiNoSPD[iprod]->Draw(
"same");
1684 ctrack->Print(Form(
"%s_TrackComp.%s",histoTag.Data(),format.Data()));
1693 TH1F * hHardPt[
nProd] ;
1694 TH1F * hRatHardPt[
nProd-1] ;
1697 TLegend lprod(0.5,0.475,0.84,0.675);
1698 lprod.SetTextSize(0.04);
1699 lprod.SetBorderSize(0);
1700 lprod.SetFillColor(0);
1704 hHardPt [iprod] = (TH1F*)
GetHisto(
"hPtHard",iprod);
1705 if ( !hHardPt[iprod] )
return;
1707 hHardPt [iprod]->Rebin(2);
1710 hHardPt[iprod]->SetYTitle(
"1/N_{events} dN/dp_{T}");
1711 hHardPt[iprod]->SetTitleOffset(1.5,
"Y");
1712 hHardPt[iprod]->SetMarkerColor(
color[iprod]);
1713 hHardPt[iprod]->SetMarkerStyle(20);
1714 hHardPt[iprod]->SetAxisRange(5.,100.,
"X");
1718 lprod.AddEntry(hHardPt[iprod],prodLeg[iprod],
"P");
1722 hRatHardPt [iprod-1] = (TH1F*)hHardPt[iprod]->Clone(Form(
"hRatHardPt%s" ,prod[iprod].
Data()));
1723 hRatHardPt [iprod-1]->Divide(hRatHardPt[iprod-1],hHardPt [0],1.000,1,errType);
1731 TLegend lhard(0.6,0.75,0.84,0.89);
1732 lhard.SetTextSize(0.04);
1734 lhard.SetFillColor(0);
1736 TCanvas * chard =
new TCanvas(Form(
"PtHardHisto_%s",histoTag.Data()),
"",1000,500);
1740 hHardPt[0]->Draw(
"");
1744 hHardPt[iprod]->Draw(
"same");
1752 hRatHardPt[0]->SetMaximum(1.05);
1753 hRatHardPt[0]->SetMinimum(0.95);
1754 hRatHardPt[0]->Draw(
"");
1755 hRatHardPt[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
1756 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
1758 hRatHardPt[iprod]->Draw(
"same");
1761 chard->Print(Form(
"%s_PtHardComp.%s",histoTag.Data(),format.Data()));
1779 TH1F* hRatXE[
nProd-1];
1780 TH1F* hRatXEUE[
nProd-1];
1783 TLegend lprod(0.5,0.475,0.84,0.675);
1784 lprod.SetTextSize(0.04);
1785 lprod.SetBorderSize(0);
1786 lprod.SetFillColor(0);
1790 h2XE [iprod]= (
TH2F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hXECharged" ,icalo),iprod);
1791 h2XEUE [iprod]= (
TH2F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hXEUeCharged",icalo),iprod);
1793 if ( !h2XE[iprod] )
return;
1796 TH1F * hTrigger = (TH1F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hPtTrigger",icalo),iprod);
1799 printf(
"Null trigger histo for prod %d\n",iprod);
1802 Int_t minClusterEBin = hTrigger->FindBin(minClusterE);
1803 Float_t nTrig = hTrigger->Integral(minClusterE,100000);
1805 hXE [iprod] = (TH1F*)h2XE [iprod]->ProjectionY(Form(
"hXE%s_%s" ,prod[iprod].
Data(),histoTag.Data()),minClusterEBin,1000);
1806 hXEUE[iprod] = (TH1F*)h2XEUE[iprod]->ProjectionY(Form(
"hXEUE%s_%s",prod[iprod].
Data(),histoTag.Data()),minClusterEBin,1000);
1808 hXE [iprod]->Rebin(5);
1809 hXEUE[iprod]->Rebin(5);
1813 hXE [iprod]->Sumw2();
1814 hXEUE[iprod]->Sumw2();
1817 hXE [iprod]->Scale(1./nTrig);
1818 hXEUE[iprod]->Scale(1./nTrig);
1820 hXE[iprod]->SetTitle(Form(
"#gamma-hadron x_{E}, p_{T,Trig}>%2.1f GeV/c",minClusterE));
1821 hXE[iprod]->SetYTitle(
"1/N_{trigger} dN/dx_{E}");
1822 hXE[iprod]->SetTitleOffset(1.5,
"Y");
1823 hXE[iprod]->SetMarkerColor(
color[iprod]);
1824 hXE[iprod]->SetMarkerStyle(20);
1825 hXE[iprod]->SetAxisRange(0.,1.,
"X");
1829 lprod.AddEntry(hXE[iprod],prodLeg[iprod],
"P");
1831 hXEUE[iprod]->SetMarkerColor(
color[iprod]);
1832 hXEUE[iprod]->SetMarkerStyle(25);
1836 hRatXE [iprod-1] = (TH1F*)hXE [iprod]->Clone(Form(
"hRatXE%s_%s" ,prod[iprod].
Data(),histoTag.Data()));
1837 hRatXEUE[iprod-1] = (TH1F*)hXEUE[iprod]->Clone(Form(
"hRatXEUE%s_%s",prod[iprod].
Data(),histoTag.Data()));
1839 hRatXE [iprod-1]->Divide(hRatXE [iprod-1],hXE [0],1.000,1,errType);
1840 hRatXEUE[iprod-1]->Divide(hRatXEUE[iprod-1],hXEUE[0],1.000,1,errType);
1850 TLegend lxe(0.6,0.75,0.84,0.89);
1851 lxe.SetTextSize(0.04);
1853 lxe.SetFillColor(0);
1854 lxe.AddEntry(hXE [0],
"Signal+bkg",
"P");
1855 lxe.AddEntry(hXEUE[0],
"Und. Event",
"P");
1857 TCanvas * cxe =
new TCanvas(Form(
"XEHisto_%s_%s",histoTag.Data(),histoTag.Data()),
"",1000,500);
1864 hXE [iprod]->Draw(
"same");
1865 hXEUE[iprod]->Draw(
"same");
1873 hRatXE[0]->SetMaximum(1.5);
1874 hRatXE[0]->SetMinimum(0.5);
1875 hRatXE[0]->Draw(
"");
1876 hRatXE[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
1877 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
1879 hRatXE [iprod]->Draw(
"same");
1880 hRatXEUE[iprod]->Draw(
"same");
1883 cxe->Print(Form(
"%s_XEComp.%s",histoTag.Data(),format.Data()));
1901 TH1F* hRatNe[
nProd-1];
1902 TH1F* hRatCh[
nProd-1];
1905 TLegend lprod(0.15,0.15,0.35,0.35);
1906 lprod.SetTextSize(0.04);
1907 lprod.SetBorderSize(0);
1908 lprod.SetFillColor(0);
1912 h2Ne [iprod]= (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConePtSumCluster",icalo),iprod);
1913 h2Ch [iprod]= (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConePtSumTrack" ,icalo),iprod);
1915 if ( !h2Ne[iprod] )
return;
1918 TH1F * hTrigger = (TH1F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hE",icalo),iprod);
1919 hTrigger ->Add((TH1F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hENoIso",icalo),iprod));
1922 printf(
"Null trigger histo for prod %d\n",iprod);
1926 Int_t minClusterEBin = hTrigger->FindBin(minClusterE);
1927 Float_t nTrig = hTrigger->Integral(minClusterE,100000);
1929 hNe[iprod] = (TH1F*)h2Ne[iprod]->ProjectionY(Form(
"hNe%s_%s",prod[iprod].
Data(),histoTag.Data()),minClusterEBin,1000);
1930 hCh[iprod] = (TH1F*)h2Ch[iprod]->ProjectionY(Form(
"hCh%s_%s",prod[iprod].
Data(),histoTag.Data()),minClusterEBin,1000);
1937 hNe[iprod]->Sumw2();
1938 hCh[iprod]->Sumw2();
1941 hNe[iprod]->Scale(1./nTrig);
1942 hCh[iprod]->Scale(1./nTrig);
1944 hNe[iprod]->SetTitle(Form(
"#Sigma p_{T} in cone R=0.4, p_{T,Trig}>%2.1f GeV/c",minClusterE));
1945 hNe[iprod]->SetYTitle(
"1/N_{trigger} dN/d#Sigma p_{T}");
1946 hNe[iprod]->SetTitleOffset(1.5,
"Y");
1947 hNe[iprod]->SetMarkerColor(
color[iprod]);
1948 hNe[iprod]->SetMarkerStyle(20);
1949 hNe[iprod]->SetAxisRange(0.,30.,
"X");
1953 lprod.AddEntry(hNe[iprod],prodLeg[iprod],
"P");
1955 hCh[iprod]->SetMarkerColor(
color[iprod]);
1956 hCh[iprod]->SetMarkerStyle(25);
1960 hRatNe[iprod-1] = (TH1F*)hNe[iprod]->Clone(Form(
"hRatNe%s_%s",prod[iprod].
Data(),histoTag.Data()));
1961 hRatCh[iprod-1] = (TH1F*)hCh[iprod]->Clone(Form(
"hRatCh%s_%s",prod[iprod].
Data(),histoTag.Data()));
1963 hRatNe[iprod-1]->Divide(hRatNe[iprod-1],hNe[0],1.000,1,errType);
1964 hRatCh[iprod-1]->Divide(hRatCh[iprod-1],hCh[0],1.000,1,errType);
1974 TLegend lNe(0.6,0.75,0.84,0.89);
1975 lNe.SetTextSize(0.04);
1977 lNe.SetFillColor(0);
1978 lNe.AddEntry(hNe[0],
"Clusters",
"P");
1979 lNe.AddEntry(hCh[0],
"Tracks",
"P");
1981 TCanvas * cNe =
new TCanvas(Form(
"SumPtHisto_%s_%s",histoTag.Data(),histoTag.Data()),
"",1000,500);
1988 hNe[iprod]->Draw(
"same");
1989 hCh[iprod]->Draw(
"same");
1997 hRatNe[0]->SetMaximum(1.5);
1998 hRatNe[0]->SetMinimum(0.5);
1999 hRatNe[0]->Draw(
"");
2000 hRatNe[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
2001 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
2003 hRatNe [iprod]->Draw(
"same");
2004 hRatCh[iprod]->Draw(
"same");
2007 cNe->Print(Form(
"%s_ConeSumPt.%s",histoTag.Data(),format.Data()));
2023 const Int_t nEbins = 12;
2024 TH1F * hIM [
nProd][nEbins];
2036 TLegend lprod(0.6,0.7,0.84,0.89);
2037 lprod.SetTextSize(0.04);
2038 lprod.SetBorderSize(0);
2039 lprod.SetFillColor(0);
2041 fileName.ReplaceAll(
".root",
"");
2044 if(icalo == 1) calorimeter =
"DCAL";
2048 TFile * filIM = TFile::Open(Form(
"IMfigures/%s_%s_MassWidthPtHistograms_%s_%s_AllSM.root",
2049 prod[iprod].
Data(),calorimeter.Data(),particle.Data(),fileName.Data()));
2053 for(
Int_t ie = 0; ie < nEbins; ie++)
2055 hIM[iprod][ie] = (TH1F*) filIM->Get(Form(
"IM_Comb0_PtBin%d",ie));
2060 hIM[iprod][ie]->SetTitleOffset(1.5,
"Y");
2061 hIM[iprod][ie]->SetYTitle(
"1/N_{events} dN/dM");
2062 hIM[iprod][ie]->SetMarkerColor(
color[iprod]);
2063 hIM[iprod][ie]->SetLineColor(
color[iprod]);
2068 gMass [iprod] = (
TGraphErrors*) filIM->Get(
"gMass_AllSM");
2069 gWidth[iprod] = (
TGraphErrors*) filIM->Get(
"gWidth_AllSM");
2072 gMass [iprod]->SetMarkerColor(
color[iprod]);
2073 gWidth[iprod]->SetMarkerColor(
color[iprod]);
2074 gPt [iprod]->SetMarkerColor(
color[iprod]);
2076 gMass [iprod]->SetMarkerStyle(20);
2077 gWidth[iprod]->SetMarkerStyle(20);
2078 gPt [iprod]->SetMarkerStyle(20);
2080 lprod.AddEntry(gMass[iprod],prodLeg[iprod],
"PL");
2085 const Int_t nPoints = gMass [0]->GetN();
2087 Double_t * ex = gMass [0]->GetEX();
2097 Double_t * emassD = gMass [0]->GetEY();
2099 Double_t * widthD = gWidth[0]->GetY();
2100 Double_t * ewidthD = gWidth[0]->GetEY();
2103 Double_t * eptD = gPt [0]->GetEY();
2107 Double_t * massN = gMass [iprod]->GetY() ;
2108 Double_t * emassN = gMass [iprod]->GetEY();
2110 Double_t * widthN = gWidth[iprod]->GetY();
2111 Double_t * ewidthN = gWidth[iprod]->GetEY();
2113 Double_t * ptN = gPt [iprod]->GetY();
2114 Double_t * eptN = gPt [iprod]->GetEY();
2116 for(
Int_t ie = 0; ie < nPoints ; ie++)
2118 if ( massD[ie] > 0 && massN [ie] > 0 )
2120 massR[ie] = massN[ie]/massD[ie];
2121 emassR[ie] = massR[ie] * TMath::Sqrt((emassN[ie]/massN[ie])*(emassN[ie]/massN[ie]) +
2122 (emassD[ie]/massD[ie])*(emassD[ie]/massD[ie]));
2125 if ( widthD[ie] > 0 && widthN [ie] > 0 )
2127 widthR[ie] = widthN[ie]/widthD[ie];
2128 ewidthR[ie] = widthR[ie] * TMath::Sqrt((ewidthN[ie]/widthN[ie])*(ewidthN[ie]/widthN[ie]) +
2129 (ewidthD[ie]/widthD[ie])*(ewidthD[ie]/widthD[ie]));
2132 if ( ptD[ie] > 0 && ptN [ie] > 0 )
2134 ptR[ie] = ptN[ie]/ptD[ie];
2135 eptR[ie] = ptR[ie] * TMath::Sqrt((eptN[ie]/ptN[ie])*(eptN[ie]/ptN[ie]) +
2136 (eptD[ie]/ptD[ie])*(eptD[ie]/ptD[ie]));
2141 gRatMass [iprod] =
new TGraphErrors(nPoints,x,massR ,ex,emassR);
2142 gRatWidth[iprod] =
new TGraphErrors(nPoints,x,widthR,ex,ewidthR);
2143 gRatPt [iprod] =
new TGraphErrors(nPoints,x,ptR ,ex,eptR);
2145 gRatMass [iprod]->SetMarkerColor(
color[iprod]);
2146 gRatMass [iprod]->SetLineColor(
color[iprod]);
2147 gRatWidth[iprod]->SetMarkerColor(
color[iprod]);
2148 gRatWidth[iprod]->SetLineColor(
color[iprod]);
2149 gRatPt [iprod]->SetMarkerColor(
color[iprod]);
2150 gRatPt [iprod]->SetLineColor(
color[iprod]);
2160 TCanvas * cMass =
new TCanvas(Form(
"Mass_%s_%s",particle.Data(), histoTag.Data()),
"",1000,500);
2166 gMass[1]->SetMinimum(120);
2167 gMass[1]->SetMaximum(170);
2168 gMass[0]->Draw(
"AP");
2171 gMass[iprod]->Draw(
"P");
2179 gRatMass[1]->SetTitle(
"Mass Ratio");
2180 gRatMass[1]->GetHistogram()->SetXTitle(
"p_{T} (GeV/c)");
2181 gRatMass[1]->GetHistogram()->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
2182 gRatMass[1]->GetHistogram()->SetTitleOffset(1.4,
"Y");
2183 gRatMass[1]->SetMinimum(0.97);
2184 gRatMass[1]->SetMaximum(1.05);
2185 gRatMass[1]->Draw(
"AP");
2189 gRatMass [iprod]->Draw(
"P");
2193 cMass->Print(Form(
"%s_Mass_%s.%s",histoTag.Data(),particle.Data(),format.Data()));
2197 TCanvas * cWidth =
new TCanvas(Form(
"Width_%s_%s",particle.Data(), histoTag.Data()),
"",1000,500);
2198 cWidth->Divide(2,1);
2203 gWidth[0]->SetMinimum(8);
2204 gWidth[0]->SetMaximum(20);
2205 gWidth[0]->Draw(
"AP");
2208 gWidth[iprod]->Draw(
"P");
2216 gRatWidth[1]->SetTitle(
"Width Ratio");
2217 gRatWidth[1]->GetHistogram()->SetXTitle(
"p_{T} (GeV/c)");
2218 gRatWidth[1]->GetHistogram()->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
2219 gRatWidth[1]->GetHistogram()->SetTitleOffset(1.4,
"Y");
2220 gRatWidth[1]->SetMinimum(0.9);
2221 gRatWidth[1]->SetMaximum(1.1);
2222 gRatWidth[1]->Draw(
"AP");
2226 gRatWidth [iprod]->Draw(
"P");
2230 cWidth->Print(Form(
"%s_Width_%s.%s",histoTag.Data(),particle.Data(),format.Data()));
2236 TCanvas * cPt =
new TCanvas(Form(
"Pt_%s_%s",particle.Data(), histoTag.Data()),
"",1000,500);
2245 gPt[iprod]->Draw(
"P");
2253 gRatPt[1]->SetTitle(
"Pt Ratio");
2254 gRatPt[1]->GetHistogram()->SetXTitle(
"p_{T} (GeV/c)");
2255 gRatPt[1]->GetHistogram()->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
2256 gRatPt[1]->GetHistogram()->SetTitleOffset(1.4,
"Y");
2257 gRatPt[1]->SetMinimum(0.7);
2258 gRatPt[1]->SetMaximum(1.3);
2259 gRatPt[1]->Draw(
"AP");
2263 gRatPt [iprod]->Draw(
"P");
2267 cPt->Print(Form(
"%s_Pt_%s.%s",histoTag.Data(),particle.Data(),format.Data()));
2272 TGaxis::SetMaxDigits(3);
2274 TCanvas * cIM =
new TCanvas(Form(
"IM_%s_%s",particle.Data(),histoTag.Data()),
"",1000,1000);
2277 for(
Int_t ie = 0; ie < nEbins; ie++)
2282 hIM[0][ie]->Draw(
"");
2285 hIM[iprod][ie]->Draw(
"same");
2291 cIM->Print(Form(
"%s_IM_%s.%s",histoTag.Data(),particle.Data(),format.Data()));
2302 TH1F* hRatCen[
nProd-1];
2305 TLegend lprod(0.3,0.475,0.84,0.675);
2306 lprod.SetTextSize(0.04);
2307 lprod.SetBorderSize(0);
2308 lprod.SetFillColor(0);
2312 hCen[iprod] = (TH1F*)
GetHisto(
"hCentrality",iprod);
2314 if ( !hCen[iprod] )
return;
2318 hCen[iprod]->Sumw2();
2319 hCen[iprod]->Scale(1./
nEvents[iprod]);
2322 hCen[iprod]->SetTitle(
"Centrality");
2323 hCen[iprod]->SetYTitle(
"1/N_{events} dN/d centrality");
2324 hCen[iprod]->SetTitleOffset(1.5,
"Y");
2325 hCen[iprod]->SetMarkerColor(
color[iprod]);
2326 hCen[iprod]->SetMarkerStyle(20);
2330 lprod.AddEntry(hCen[iprod],prodLeg[iprod],
"P");
2334 hRatCen[iprod-1] = (TH1F*)hCen[iprod]->Clone(Form(
"hRatCen%s" ,prod[iprod].
Data()));
2336 hRatCen[iprod-1]->Divide(hRatCen[iprod-1],hCen [0],1.000,1,errType);
2345 TCanvas * ccen =
new TCanvas(Form(
"Centrality_%s",histoTag.Data()),
"",1000,500);
2355 hCen[iprod]->Draw(
"same");
2363 hRatCen[0]->SetTitle(
"Centrality");
2364 hRatCen[0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
2365 hRatCen[0]->SetMinimum(0.95);
2366 hRatCen[0]->SetMaximum(1.05);
2367 hRatCen[0]->Draw(
"");
2369 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
2371 hRatCen [iprod]->Draw(
"same");
2374 TLine l1(0,1,100,1);
2378 ccen->Print(Form(
"%s_CentralityComp.%s",histoTag.Data(),format.Data()));
2389 TH1F* hVertex [3][
nProd];
2390 TH1F* hRatVertex[3][
nProd-1];
2393 TLegend lprod(0.6,0.6,0.97,0.85);
2394 lprod.SetTextSize(0.04);
2395 lprod.SetBorderSize(0);
2396 lprod.SetFillColor(0);
2400 hVertex[0][iprod] = (TH1F*)
GetHisto(
"hZVertex",iprod);
2401 hVertex[1][iprod] = (TH1F*)
GetHisto(
"hYVertex",iprod);
2402 hVertex[2][iprod] = (TH1F*)
GetHisto(
"hXVertex",iprod);
2404 if ( !hVertex[0][iprod] )
return;
2406 lprod.AddEntry(hVertex[0][iprod],prodLeg[iprod],
"P");
2408 for(
Int_t ivertex = 0; ivertex < 3; ivertex++)
2412 hVertex[ivertex][iprod]->Sumw2();
2413 hVertex[ivertex][iprod]->Scale(1./
nEvents[iprod]);
2417 hVertex[ivertex][iprod]->SetYTitle(
"1/N_{events} dN/ d vertex");
2418 hVertex[ivertex][iprod]->SetTitleOffset(1.5,
"Y");
2419 hVertex[ivertex][iprod]->SetMarkerColor(
color[iprod]);
2420 hVertex[ivertex][iprod]->SetLineColor(
color[iprod]);
2421 hVertex[ivertex][iprod]->SetMarkerStyle(20);
2422 if(ivertex==0)hVertex[ivertex][iprod]->SetAxisRange(-10,10.,
"X");
2423 else hVertex[ivertex][iprod]->SetAxisRange(-1.5,1.5,
"X");
2429 hRatVertex[ivertex][iprod-1] = (TH1F*)hVertex[ivertex][iprod]->Clone(Form(
"hRatVertex%s_%d" ,prod[iprod].
Data(),ivertex));
2431 hRatVertex[ivertex][iprod-1]->Divide(hRatVertex[ivertex][iprod-1],hVertex[ivertex][0],1.000,1,errType);
2441 TCanvas * cvertex =
new TCanvas(Form(
"Vertex_%s",histoTag.Data()),
"",3*500,2*500);
2442 cvertex->Divide(3,2);
2444 for(
Int_t ivertex = 0; ivertex < 3; ivertex++)
2446 cvertex->cd(npannel);
2452 hVertex[ivertex][iprod]->Draw(
"same");
2457 cvertex->cd(npannel+3);
2461 hRatVertex[ivertex][0]->SetYTitle(Form(
"Ratio data X / %s",prodLeg[0].
Data()));
2462 hRatVertex[ivertex][0]->SetMinimum(0.90);
2463 hRatVertex[ivertex][0]->SetMaximum(1.10);
2464 hRatVertex[ivertex][0]->Draw(
"");
2466 for(
Int_t iprod = 0; iprod < nProd-1; iprod++)
2468 hRatVertex[ivertex][iprod]->Draw(
"same");
2474 cvertex->Print(Form(
"%s_VertexComp.%s",histoTag.Data(),format.Data()));
2498 file[iprod] =
new TFile(Form(
"%s/%s",prod[iprod].
Data(),fileName.Data()),
"read");
2499 if(
file[iprod]->Get(
"hNEvents"))
2501 nEvents[iprod] = ((TH1F*)
file[iprod]->Get(
"hNEvents"))->GetEntries();
2502 printf(
"%s: nEvents %e\n",prod[iprod].
Data(),
nEvents[iprod]);
2507 dir[iprod] = (TDirectoryFile*)
file[iprod]->Get(listName);
2510 histArr[iprod] = (
TList*)
dir[iprod]->Get(trigName);
2512 if ( !histArr[iprod] )
continue;
2513 if ( histArr[iprod]->GetEntries() <= 0 )
continue;
2516 printf(
"%s: nEvents %e\n",prod[iprod].
Data(),
nEvents[iprod]);
2520 histArr[iprod] = (
TList*)
file[iprod]->Get(trigName);
2522 if ( !histArr[iprod] )
continue;
2523 if ( histArr[iprod]->GetEntries() <= 0 )
continue;
2526 printf(
"%s: nEvents %e\n",prod[iprod].
Data(),
nEvents[iprod]);
2531 printf(
"list %s not found\n",trigName.Data());
2550 if ( histArr[iprod] )
2551 return histArr[iprod]->FindObject(histoName);
2552 else if (
file[iprod] )
2553 return file[iprod]->Get(histoName);
2555 printf(
"Null file %p or list %p for prod %d and histo %s\n",
2556 file[iprod],histArr[iprod],iprod, histoName.Data());
void DrawProductionComparison(TString listName="Pi0IM_GammaTrackCorr_EMCAL", TString fileName="AnalysisResults.root", TString fileFormat="pdf")
TObject * GetHisto(TString histoName, Int_t iprod)
TString errType
output plots format: eps, pdf, etc.
TString format
file names tag, basically the trigger and calorimeter combination
void InvMass(Int_t icalo, TString particle, TString fileName)
TList * histArr[nProd]
TDirectory file where lists per trigger are stored in train ouput.
const TString calorimeter
void ClusterCells(Int_t icalo)
void MCParticle(Int_t icalo, TString particle)
void PtHard()
Pt Hard distributions.
TDirectoryFile * dir[nProd]
total number of productions to compare
TFile * file[nProd]
TList with histograms for a given trigger.
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TObject * FindObject(int bin, const char *nameH, const TList *lst, Bool_t normPerEvent=kTRUE)
void Cluster(Int_t icalo)
Float_t nEvents[nProd]
Input train file.
TString histoTag
number of events container
Int_t color[]
In case of pT hard binned productions where the scaling and cross section is already done...
void ProcessTrigger(TString trigName="default", TString fileName="AnalysisResults.root", TString listName="Pi0IM_GammaTrackCorr_EMCAL")
TString prod[]
productions to be compared, directory name
void ShowerShape(Int_t icalo)
Bool_t GetFileAndList(TString fileName, TString listName, TString trigName)