add scale correction from string.
Can be called multiple times. The list of valid values is on the twiki
246{
249
250 if (
tune.empty()) { }
251 else if ("es2025_run3_extrapolate_gnn_v0" == tune) {
252 add_scale(
"run3_partial_ofc_extrapolate_gnn_v0");
253 }
254 else if ("es2024_run3_extrapolate_v0" == tune) {
255 add_scale(
"run3_partial_ofc_extrapolate_v0");
256 }
257
258 else if ("es2022_22.0_Precision_v1" == tune) {
259 add_scale(
"run2_alt_with_layer2_r22_Precision_v1");
260 }
261 else if ("es2022_22.0_Precision" == tune) {
262 add_scale(
"run2_alt_with_layer2_r22_Precision");
263 }
264 else if ("es2018_21.0_v0" == tune) {
265 add_scale(
"run2_alt_with_layer2_r21_v1");
266 }
267 else if ("es2017_21.0_v0" == tune) {
268 add_scale(
"run2_alt_with_layer2_r21_v0");
269 }
270 else if ("es2017_20.7_final" == tune) {
273 }
274 else if ("es2017_20.7_improved" == tune) {
276
278 }
279 else if ("pileup_20.7" == tune) {
285 }
286
287 else if ("run3_partial_ofc_extrapolate_gnn_v0" == tune) {
288 add_scale(
"layer2_run3_ofc_extrapolate_v0");
291 }
292 else if ("run3_partial_ofc_extrapolate_v0" == tune) {
293 add_scale(
"layer2_run3_ofc_extrapolate_v0");
296 }
297
298 else if ("run2_alt_with_layer2_r22_Precision_v1"==tune) {
299 add_scale(
"layer2_alt_el_mu_comb_r21_v0_fix");
302 }
303
304 else if ("run2_alt_with_layer2_r22_Precision"==tune) {
305 add_scale(
"layer2_alt_el_mu_comb_r21_v0");
308 }
309 else if ("run2_alt_with_layer2_r21_v1"==tune) {
312 }
313 else if ("run2_alt_with_layer2_r21_v0"==tune) {
316 }
317 else if("run2_alt_with_layer2_modif" == tune) {
321 }
322
323 else if ("2012" == tune) {
327 }
328 else if("2012_with_layer2" == tune) {
332 }
333 else if ("2012_alt" == tune) {
337 }
338 else if("2012_alt_with_layer2" == tune) {
342 }
343 else if("2012_alt_with_layer2_modif" == tune) {
348 }
349 else if("2010_with_layer2" == tune) {
352 }
353 else if ("2012_layer1_up" == tune) {
357 }
358 else if ("2012_layer1_down" == tune) {
362 }
363 else if ("2012_layer1_errup" == tune) {
365 }
366 else if ("2012_layer1_errdown" == tune) {
368 }
369 else if ("2012_ps_down" == tune) {
373 }
374 else if ("2012_ps_up" == tune) {
378 }
379 else if ("2012_ps_errdown" == tune) {
381 }
382 else if ("2012_ps_errup" == tune) {
384 }
385 else if ("2012_up" == tune) {
389 }
390 else if ("2012_down" == tune) {
394 }
395 else if ("2012_errup" == tune) {
398 }
399 else if ("2012_errdown" == tune) {
402 }
403
404 else if ("2011" == tune) {
407 }
408 else if("2011_with_layer2" == tune) {
411 }
412 else if ("2011_alt" == tune) {
415 }
416 else if("2011_alt_with_layer2" == tune) {
419 }
420 else if ("2011_layer1_up" == tune) {
423 }
424 else if ("2011_layer1_down" == tune) {
427 }
428 else if ("2011_layer1_errup" == tune) {
430 }
431 else if ("2011_layer1_errdown" == tune) {
433 }
434 else if ("2011_ps_down" == tune) {
437 }
438 else if ("2011_ps_up" == tune) {
441 }
442 else if ("2011_ps_errdown" == tune) {
444 }
445 else if ("2011_ps_errup" == tune) {
447 }
448 else if ("2011_up" == tune) {
451 }
452 else if ("2011_down" == tune) {
455 }
456 else if ("2011_errup" == tune) {
459 }
460 else if ("2011_errdown" == tune) {
463 }
464
465 else if ("2010" == tune) {
468 }
469 else if ("2010_layer1_up" == tune) {
472 }
473 else if ("2010_layer1_down" == tune) {
476 }
477 else if ("2010_layer1_errup" == tune) {
479 }
480 else if ("2010_layer1_errdown" == tune) {
482 }
483 else if ("2010_ps_down" == tune) {
486 }
487 else if ("2010_ps_up" == tune) {
490 }
491 else if ("2010_ps_errdown" == tune) {
493 }
494 else if ("2010_ps_errup" == tune) {
496 }
497 else if ("2010_up" == tune) {
500 }
501 else if ("2010_down" == tune) {
504 }
505 else if ("2010_errup" == tune) {
508 }
509 else if ("2010_errdown" == tune) {
512 }
513 else if ("ps_HV1" == tune) {
515 }
516 else if ("ps_EMECHV1" == tune) {
518 }
519 else if ("test1" == tune) {
520 TH1F h_presampler(
"h_presampler",
"h_presampler", 10, -2.5, 2.5);
521
522
523 for (int ibin = 1; ibin <= 5; ++ibin) {
524 h_presampler.SetBinContent(ibin, -0.1);
525 h_presampler.SetBinContent(ibin + 5, 0.1);
526 }
529 }
530 else if ("acc_zee_run3_gnn_v0" == tune){
532 TFile
f(
file.c_str());
533 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel23_gnn"));
534 assert(histo_acc);
536 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
537 }
538 else if ("acc_zee_run3_v0" == tune){
540 TFile
f(
file.c_str());
541 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel23"));
542 assert(histo_acc);
544 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
545 }
546
547 else if ("acc_zee_r22_v1" == tune) {
549 TFile
f(
file.c_str());
550 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
551 assert(histo_acc);
553 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
554 }
555 else if ("acc_zee_r22_v0" == tune) {
557 TFile
f(
file.c_str());
558 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
559 assert(histo_acc);
561 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
562 }
563 else if ("layer1_1" == tune) {
564 TFormula
f(
"formula_layer1_1",
"(abs(x)<1.425) ? 0.97 : 1");
566 }
567 else if ("layer1_2" == tune) {
568 TFormula
f(
"formula_layer1_2",
"(abs(x)<1.425) ? 0.97 : 1.05");
570 }
571 else if ("layer1_alt_2012_v5" == tune) {
573 TFile
f(
file.c_str());
574 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
576 new GetAmountHisto1D(*histo));
577 }
578 else if ("layer1_2012_v5" == tune) {
580 TFile
f(
file.c_str());
581 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
583 new GetAmountHisto1D(*histo));
584 }
585 else if ("layer1_2012_v5_down" == tune) {
587 TFile
f(
file.c_str());
588 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
590 new GetAmountHisto1DUp(*histo));
591 }
592 else if ("layer1_2012_v5_up" == tune) {
594 TFile
f(
file.c_str());
595 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
597 new GetAmountHisto1DDown(*histo));
598 }
599 else if ("layer1_2012_v5_errdown" == tune) {
601 TFile
f(
file.c_str());
602 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
604 new GetAmountHisto1DErrorUp(*histo));
605 }
606 else if ("layer1_2012_v5_errup" == tune) {
608 TFile
f(
file.c_str());
609 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
611 new GetAmountHisto1DErrorDown(*histo));
612 }
613 else if ("layer1_alt_2011_v5" == tune) {
615 TFile
f(
file.c_str());
616 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
618 new GetAmountHisto1D(*histo));
619 }
620 else if ("layer1_2011_v5" == tune) {
622 TFile
f(
file.c_str());
623 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
625 new GetAmountHisto1D(*histo));
626 }
627 else if ("layer1_2011_v5_down" == tune) {
629 TFile
f(
file.c_str());
630 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
632 new GetAmountHisto1DUp(*histo));
633 }
634 else if ("layer1_2011_v5_up" == tune) {
636 TFile
f(
file.c_str());
637 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
639 new GetAmountHisto1DDown(*histo));
640 }
641 else if ("layer1_2011_v5_errdown" == tune) {
643 TFile
f(
file.c_str());
644 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
646 new GetAmountHisto1DErrorUp(*histo));
647 }
648 else if ("layer1_2011_v5_errup" == tune) {
650 TFile
f(
file.c_str());
651 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
653 new GetAmountHisto1DErrorDown(*histo));
654 }
655 else if ("layer1_2010_v5" == tune) {
657 TFile
f(
file.c_str());
658 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
660 new GetAmountHisto1D(*histo));
661 }
662 else if ("layer1_2010_v5_down" == tune) {
664 TFile
f(
file.c_str());
665 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
667 new GetAmountHisto1DUp(*histo));
668 }
669 else if ("layer1_2010_v5_up" == tune) {
671 TFile
f(
file.c_str());
672 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
674 new GetAmountHisto1DDown(*histo));
675 }
676 else if ("layer1_2010_v5_errdown" == tune) {
678 TFile
f(
file.c_str());
679 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
681 new GetAmountHisto1DErrorUp(*histo));
682 }
683 else if ("layer1_2010_v5_errup" == tune) {
685 TFile
f(
file.c_str());
686 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
688 new GetAmountHisto1DErrorDown(*histo));
689 }
690 else if ("layer2_run3_ofc_extrapolate_v0"==tune){
692 TFile
f(
file.c_str());
693 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v1_run3ofc"));
694 assert(histo);
696 new GetAmountHisto1D(*histo));
697 }
698
699 else if("layer2_alt_el_mu_comb_r21_v0_fix"==tune) {
701 TFile
f(
file.c_str());
702 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0_fix"));
703 assert(histo);
705 new GetAmountHisto1D(*histo));
706 }
707 else if("layer2_alt_el_mu_comb_r21_v0"==tune) {
709 TFile
f(
file.c_str());
710 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0"));
711 assert(histo);
713 new GetAmountHisto1D(*histo));
714 }
715 else if("layer2_alt_run2_r21_v1"==tune) {
717 TFile
f(
file.c_str());
718 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2_mu_run2_rel21_v1"));
720 new GetAmountHisto1D(*histo));
721 }
722 else if("layer2_alt_run2_r21_v0"==tune) {
724 TFile
f(
file.c_str());
725 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_rel21_v1"));
727 new GetAmountHisto1D(*histo));
728 }
729 else if("layer2_alt_run2_v1" == tune) {
731 TFile
f(
file.c_str());
732 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_v1"));
734 new GetAmountHisto1D(*histo));
735 }
736 else if("layer2_alt_2012_v5" == tune) {
738 TFile
f(
file.c_str());
739 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
741 new GetAmountHisto1D(*histo));
742 }
743 else if("layer2_2012_v5" == tune) {
745 TFile
f(
file.c_str());
746 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
748 new GetAmountHisto1D(*histo));
749 }
750 else if("layer2_2012_v5_down" == tune) {
752 TFile
f(
file.c_str());
753 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
755 new GetAmountHisto1DDown(*histo));
756 }
757 else if("layer2_2012_v5_up" == tune) {
759 TFile
f(
file.c_str());
760 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
762 new GetAmountHisto1DUp(*histo));
763 }
764 else if ("layer2_2012_v5_errdown" == tune) {
766 TFile
f(
file.c_str());
767 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
769 new GetAmountHisto1DErrorDown(*histo));
770 }
771 else if ("layer2_2012_v5_errup" == tune) {
773 TFile
f(
file.c_str());
774 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
776 new GetAmountHisto1DErrorUp(*histo));
777 }
778 else if("layer2_alt_2011_v5" == tune) {
780 TFile
f(
file.c_str());
781 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
783 new GetAmountHisto1D(*histo));
784 }
785 else if("layer2_2011_v5" == tune) {
787 TFile
f(
file.c_str());
788 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
790 new GetAmountHisto1D(*histo));
791 }
792 else if("layer2_2011_v5_down" == tune) {
794 TFile
f(
file.c_str());
795 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
797 new GetAmountHisto1DDown(*histo));
798 }
799 else if("layer2_2011_v5_up" == tune) {
801 TFile
f(
file.c_str());
802 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
804 new GetAmountHisto1DUp(*histo));
805 }
806 else if ("layer2_2011_v5_errdown" == tune) {
808 TFile
f(
file.c_str());
809 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
811 new GetAmountHisto1DErrorDown(*histo));
812 }
813 else if ("layer2_2011_v5_errup" == tune) {
815 TFile
f(
file.c_str());
816 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
818 new GetAmountHisto1DErrorUp(*histo));
819 }
820 else if("layer2_2010_v5" == tune) {
822 TFile
f(
file.c_str());
823 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
825 new GetAmountHisto1D(*histo));
826 }
827 else if("layer2_2010_v5_down" == tune) {
829 TFile
f(
file.c_str());
830 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
832 new GetAmountHisto1DDown(*histo));
833 }
834 else if("layer2_2010_v5_up" == tune) {
836 TFile
f(
file.c_str());
837 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
839 new GetAmountHisto1DUp(*histo));
840 }
841 else if ("layer2_2010_v5_errdown" == tune) {
843 TFile
f(
file.c_str());
844 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
846 new GetAmountHisto1DErrorDown(*histo));
847 }
848 else if ("layer2_2010_v5_errup" == tune) {
850 TFile
f(
file.c_str());
851 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
853 new GetAmountHisto1DErrorUp(*histo));
854 }
855 else if ("ps_2016_r21_v0" == tune) {
857 TFile
f(
file.c_str());
858 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016_rel21"));
860 new GetAmountHisto1D(*histo_ps_tot_error));
861 }
862 else if ("ps_run3_ofc_extrapolate_v0" == tune){
864 TFile
f(
file.c_str());
865 TH1F* histo_ps_tot_error =
static_cast<TH1F*
>(
f.Get(
"hPS_MuonLowMu_rel21_run3ofc"));
866 assert(histo_ps_tot_error);
868 new GetAmountHisto1D(*histo_ps_tot_error));
869 }
870 else if ("ps_mu_r21_v0" == tune) {
872 TFile
f(
file.c_str());
873 TH1F* histo_ps_tot_error =
static_cast<TH1F*
>(
f.Get(
"hPS_MuonLowMu_rel21"));
874 assert(histo_ps_tot_error);
876 new GetAmountHisto1D(*histo_ps_tot_error));
877 }
878 else if ("ps_2016_v1" == tune) {
880 TFile
f(
file.c_str());
881 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016"));
883 new GetAmountHisto1D(*histo_ps_tot_error));
884 }
885 else if ("ps_2012_v3" == tune) {
887 TFile
f(
file.c_str());
888 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
890 new GetAmountHisto1D(*histo_ps_tot_error));
891 }
892 else if ("ps_2012_v3_down" == tune) {
894 TFile
f(
file.c_str());
895 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
897 new GetAmountHisto1DUp(*histo_ps_tot_error));
898 }
899 else if ("ps_2012_v3_up" == tune){
901 TFile
f(
file.c_str());
902 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
904 new GetAmountHisto1DDown(*histo_ps_tot_error));
905 }
906 else if ("ps_2012_v3_errdown" == tune){
908 TFile
f(
file.c_str());
909 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
911 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
912 }
913 else if ("ps_2012_v3_errup" == tune){
915 TFile
f(
file.c_str());
916 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
918 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
919 }
920 else if ("ps_2011_v3" == tune) {
922 TFile
f(
file.c_str());
923 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
925 new GetAmountHisto1D(*histo_ps_tot_error));
926 }
927 else if ("ps_2011_v3_down" == tune) {
929 TFile
f(
file.c_str());
930 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
932 new GetAmountHisto1DUp(*histo_ps_tot_error));
933 }
934 else if ("ps_2011_v3_up" == tune){
936 TFile
f(
file.c_str());
937 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
939 new GetAmountHisto1DDown(*histo_ps_tot_error));
940 }
941 else if ("ps_2011_v3_errdown" == tune){
943 TFile
f(
file.c_str());
944 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
946 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
947 }
948 else if ("ps_2011_v3_errup" == tune){
950 TFile
f(
file.c_str());
951 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
953 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
954 }
955
956 else if ("ps_2010_v3" == tune) {
958 TFile
f(
file.c_str());
959 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
961 new GetAmountHisto1D(*histo_ps_tot_error));
962 }
963 else if ("ps_2010_v3_down" == tune) {
965 TFile
f(
file.c_str());
966 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
968 new GetAmountHisto1DUp(*histo_ps_tot_error));
969 }
970 else if ("ps_2010_v3_up" == tune) {
972 TFile
f(
file.c_str());
973 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
975 new GetAmountHisto1DDown(*histo_ps_tot_error));
976 }
977 else if ("ps_2010_v3_errdown" == tune){
979 TFile
f(
file.c_str());
980 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
982 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
983 }
984 else if ("ps_2010_v3_errup" == tune){
986 TFile
f(
file.c_str());
987 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
989 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
990 }
991 else {
992 throw std::runtime_error(tune+" is not a valid tune");
993 }
994}
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)