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