475def compare() -> None:
476 test(eospath + "pythia8_Geant4_onlyMuons.root")
477 for x in ["", "_>E"]:
478 for z in ["p", "pt"]:
479 for ahist in ["mu-", "mu+", "mu", "mu-charm", "mu+charm", "mucharm"]:
480 h["TP" + z + ahist + x] = h["T" + z + ahist + x].Clone("CT" + ahist + x)
481 test(eospath + "pythia8_Geant4_Yandex_onlyNeutrinos.root")
482 for x in ["", "_>E"]:
483 for z in ["p", "pt"]:
484 for ahist in [
485 "numusum",
486 "nuesum",
487 "numusumcharm",
488 "nuesumcharm",
489 "numu",
490 "numubar",
491 "nue",
492 "nuebar",
493 "numucharm",
494 "numubarcharm",
495 "nuecharm",
496 "nuebarcharm",
497 ]:
498 h["TP" + z + ahist + x] = h["T" + z + ahist + x].Clone("CT" + ahist + x)
499 test(eospath + "Mbias/pythia8_Geant4-withCharm-ram.root")
500 for x in ["", "_>E"]:
501 for z in ["p", "pt"]:
502 t = z.upper()
503 if x != "":
504 t = ">" + t
505 h[t].cd(1)
506 p = z + "mu"
507 h["T" + p + x].SetTitle("musum")
508 h["T" + p + x].Draw()
509 h["T" + p + "charm" + x].Draw("same")
510 h["TP" + p + x].Draw("same")
511 h["TP" + p + x].SetLineColor(6)
512 h["TP" + p + "charm" + x].Draw("same")
513 h["TP" + p + "charm" + x].SetLineColor(3)
514 h["T" + p + "charm" + x].SetLineColor(2)
515 h["T" + p + x].SetLineColor(4)
516 h["L" + p + x] = ROOT.TLegend(0.33, 0.69, 0.99, 0.94)
517 h["L" + p + x].AddEntry(h["T" + p + x], "muon new with charm, cascade, k-fac", "PL")
518 h["L" + p + x].AddEntry(h["T" + p + "charm" + x], "muon from charm new with charm, cascade, k-fac", "PL")
519 h["L" + p + x].AddEntry(h["TP" + p + x], "muon old CERN-Cracow prod", "PL")
520 h["L" + p + x].AddEntry(h["TP" + p + "charm" + x], "muon from charm old CERN-Cracow prod", "PL")
521 h["L" + p + x].Draw()
522 h[t].cd(2)
523 p = z + "numusum"
524 h["T" + p + x].Draw()
525 h["T" + p + "charm" + x].Draw("same")
526 h["TP" + p + x].Draw("same")
527 h["TP" + p + x].SetLineColor(6)
528 h["TP" + p + "charm" + x].Draw("same")
529 h["TP" + p + "charm" + x].SetLineColor(3)
530 h["T" + p + "charm" + x].SetLineColor(2)
531 h["T" + p + x].SetLineColor(4)
532 h["L" + p + x] = ROOT.TLegend(0.33, 0.69, 0.99, 0.94)
533 h["L" + p + x].AddEntry(h["T" + p + x], "nu_mu new with charm, cascade, k-fac", "PL")
534 h["L" + p + x].AddEntry(h["T" + p + "charm" + x], "nu_mu from charm new with charm, cascade, k-fac", "PL")
535 h["L" + p + x].AddEntry(h["TP" + p + x], "nu_mu old CERN-Cracow prod", "PL")
536 h["L" + p + x].AddEntry(h["TP" + p + "charm" + x], "nu_mu from charm old CERN-Cracow prod", "PL")
537 h["L" + p + x].Draw()
538 t3 = h[t].cd(3)
539 t3.SetLogy(1)
540 p = z + "nuesum"
541 h["T" + p + x].Draw()
542 h["T" + p + "charm" + x].Draw("same")
543 h["TP" + p + x].Draw("same")
544 h["TP" + p + x].SetLineColor(6)
545 h["TP" + p + "charm" + x].Draw("same")
546 h["TP" + p + "charm" + x].SetLineColor(3)
547 h["T" + p + "charm" + x].SetLineColor(2)
548 h["T" + p + x].SetLineColor(4)
549 h["L" + p + x] = ROOT.TLegend(0.33, 0.69, 0.99, 0.94)
550 h["L" + p + x].AddEntry(h["T" + p + x], "nu_e new with charm, cascade, k-fac", "PL")
551 h["L" + p + x].AddEntry(h["T" + p + "charm" + x], "nu_e from charm new with charm, cascade, k-fac", "PL")
552 h["L" + p + x].AddEntry(h["TP" + p + x], "nu_e old CERN-Cracow prod", "PL")
553 h["L" + p + x].AddEntry(h["TP" + p + "charm" + x], "nu_e from charm old CERN-Cracow prod", "PL")
554 h["L" + p + x].Draw()
555
556 t4 = h[t].cd(4)
557 t4.SetLogy(1)
558 h["Lmuc" + z + x] = ROOT.TLegend(0.33, 0.73, 0.99, 0.94)
559 p = z + "mu-"
560 h["T" + p + x].SetTitle("mu-/mu+")
561 h["T" + p + x].Draw()
562 h["TP" + p + x].Draw("same")
563 h["TP" + p + x].SetLineColor(6)
564 h["T" + p + x].SetLineColor(4)
565 h["Lmuc" + z + x].AddEntry(h["T" + p + x], "mu- new with charm, cascade, k-fac", "PL")
566 h["Lmuc" + z + x].AddEntry(h["TP" + p + x], "mu- old Yandex prod", "PL")
567 p = z + "mu+"
568 h["T" + p + x].Draw("same")
569 h["TP" + p + x].Draw("same")
570 h["TP" + p + x].SetLineColor(3)
571 h["T" + p + x].SetLineColor(2)
572 h["Lmuc" + z + x].AddEntry(h["T" + p + x], "mu+ new with charm, cascade, k-fac", "PL")
573 h["Lmuc" + z + x].AddEntry(h["TP" + p + x], "mu+ old Yandex prod", "PL")
574 h["Lmuc" + z + x].Draw()
575
576 t5 = h[t].cd(5)
577 t5.SetLogy(1)
578 h["Lnumu" + z + x] = ROOT.TLegend(0.33, 0.73, 0.99, 0.94)
579 p = z + "numu"
580 h["T" + p + x].SetTitle("numu/numubar")
581 h["T" + p + x].Draw()
582 h["TP" + p + x].Draw("same")
583 h["TP" + p + x].SetLineColor(6)
584 h["T" + p + x].SetLineColor(4)
585 h["Lnumu" + z + x].AddEntry(h["T" + p + x], "nu_mu new with charm, cascade, k-fac", "PL")
586 h["Lnumu" + z + x].AddEntry(h["TP" + p + x], "nu_mu old Yandex prod", "PL")
587 p = z + "numubar"
588 h["T" + p + x].Draw("same")
589 h["TP" + p + x].Draw("same")
590 h["TP" + p + x].SetLineColor(3)
591 h["T" + p + x].SetLineColor(2)
592 h["Lnumu" + z + x].AddEntry(h["T" + p + x], "anti nu_mu new with charm, cascade, k-fac", "PL")
593 h["Lnumu" + z + x].AddEntry(h["TP" + p + x], "anti nu_mu old Yandex prod", "PL")
594 h["Lnumu" + z + x].Draw()
595 t6 = h[t].cd(6)
596 t6.SetLogy(1)
597 p = z + "nue"
598 h["Lnue" + z + x] = ROOT.TLegend(0.33, 0.73, 0.99, 0.94)
599 h["T" + p + x].SetTitle("nue/nuebar")
600 h["T" + p + x].Draw()
601 h["TP" + p + x].Draw("same")
602 h["TP" + p + x].SetLineColor(6)
603 h["T" + p + x].SetLineColor(4)
604 h["Lnue" + z + x].AddEntry(h["T" + p + x], "nu_e new with charm, cascade, k-fac", "PL")
605 h["Lnue" + z + x].AddEntry(h["TP" + p + x], "nu_e old Yandex prod", "PL")
606 p = z + "nuebar"
607 h["T" + p + x].Draw("same")
608 h["TP" + p + x].Draw("same")
609 h["TP" + p + x].SetLineColor(3)
610 h["T" + p + x].SetLineColor(2)
611 h["Lnue" + z + x].AddEntry(h["T" + p + x], "anti nu_e new with charm, cascade, k-fac", "PL")
612 h["Lnue" + z + x].AddEntry(h["TP" + p + x], "anti nu_e old Yandex prod", "PL")
613 h["Lnue" + z + x].Draw()
614
615 h[t].Print("comparison" + z + x.replace("_>", "") + ".png")
616 h[t].Print("comparison" + z + x.replace("_>", "") + ".pdf")
617
618 x = "_>E"
619 for z in ["p", "pt"]:
620 h[z + "muRatio" + x] = h["T" + z + "mu" + x].Clone(z + "muRatio" + x)
621 h[z + "muRatio" + x].Divide(h["TP" + z + "mu" + x])
622 h[z + "numuRatio" + x] = h["T" + z + "numusum" + x].Clone(z + "numuRatio" + x)
623 h[z + "numuRatio" + x].Divide(h["TP" + z + "numusum" + x])
624 h[z + "nueRatio" + x] = h["T" + z + "nuesum" + x].Clone(z + "nueRatio" + x)
625 h[z + "nueRatio" + x].Divide(h["TP" + z + "nuesum" + x])
626 ut.bookCanvas(h, key="ratios", title="ratios", nx=1800, ny=600, cx=2, cy=1)
627 n = 1
628 for z in ["p", "pt"]:
629 h["Lratio" + z + x] = ROOT.TLegend(0.21, 0.74, 0.71, 0.85)
630 h["ratios"].cd(n)
631 n += 1
632 h[z + "muRatio" + x].SetLineColor(2)
633 h[z + "muRatio" + x].SetMaximum(max(h[z + "muRatio" + x].GetMaximum(), h[z + "numuRatio" + x].GetMaximum()))
634 h[z + "muRatio" + x].SetMinimum(0)
635 h[z + "muRatio" + x].SetStats(0)
636 h[z + "muRatio" + x].Draw()
637 h[z + "numuRatio" + x].SetLineColor(3)
638 h[z + "numuRatio" + x].SetStats(0)
639 h[z + "numuRatio" + x].Draw("same")
640
641
642 h["Lratio" + z + x].AddEntry(h[z + "muRatio" + x], "muon flux new / old ", "PL")
643 h["Lratio" + z + x].AddEntry(h[z + "numuRatio" + x], "nu_mu flux new / old ", "PL")
644
645 h["Lratio" + z + x].Draw()
646 h["ratios"].Print("comparisonRatios.png")
647 h["ratios"].Print("comparisonRatios.pdf")
648
649