add scale correction from string.
Can be called multiple times. The list of valid values is on the twiki
247{
250
251 if (
tune.empty()) { }
252 else if ("es2025_run3_extrapolate_gnn_v0" == tune) {
253 add_scale(
"run3_partial_ofc_extrapolate_gnn_v0");
254 }
255 else if ("es2024_run3_extrapolate_v0" == tune) {
256 add_scale(
"run3_partial_ofc_extrapolate_v0");
257 }
258
259 else if ("es2022_22.0_Precision_v1" == tune) {
260 add_scale(
"run2_alt_with_layer2_r22_Precision_v1");
261 }
262 else if ("es2022_22.0_Precision" == tune) {
263 add_scale(
"run2_alt_with_layer2_r22_Precision");
264 }
265 else if ("es2018_21.0_v0" == tune) {
266 add_scale(
"run2_alt_with_layer2_r21_v1");
267 }
268 else if ("es2017_21.0_v0" == tune) {
269 add_scale(
"run2_alt_with_layer2_r21_v0");
270 }
271 else if ("es2017_20.7_final" == tune) {
274 }
275 else if ("es2017_20.7_improved" == tune) {
277
279 }
280 else if ("pileup_20.7" == tune) {
286 }
287
288 else if ("run3_partial_ofc_extrapolate_gnn_v0" == tune) {
289 add_scale(
"layer2_run3_ofc_extrapolate_v0");
292 }
293 else if ("run3_partial_ofc_extrapolate_v0" == tune) {
294 add_scale(
"layer2_run3_ofc_extrapolate_v0");
297 }
298
299 else if ("run2_alt_with_layer2_r22_Precision_v1"==tune) {
300 add_scale(
"layer2_alt_el_mu_comb_r21_v0_fix");
303 }
304
305 else if ("run2_alt_with_layer2_r22_Precision"==tune) {
306 add_scale(
"layer2_alt_el_mu_comb_r21_v0");
309 }
310 else if ("run2_alt_with_layer2_r21_v1"==tune) {
313 }
314 else if ("run2_alt_with_layer2_r21_v0"==tune) {
317 }
318 else if("run2_alt_with_layer2_modif" == tune) {
322 }
323
324 else if ("2012" == tune) {
328 }
329 else if("2012_with_layer2" == tune) {
333 }
334 else if ("2012_alt" == tune) {
338 }
339 else if("2012_alt_with_layer2" == tune) {
343 }
344 else if("2012_alt_with_layer2_modif" == tune) {
349 }
350 else if("2010_with_layer2" == tune) {
353 }
354 else if ("2012_layer1_up" == tune) {
358 }
359 else if ("2012_layer1_down" == tune) {
363 }
364 else if ("2012_layer1_errup" == tune) {
366 }
367 else if ("2012_layer1_errdown" == tune) {
369 }
370 else if ("2012_ps_down" == tune) {
374 }
375 else if ("2012_ps_up" == tune) {
379 }
380 else if ("2012_ps_errdown" == tune) {
382 }
383 else if ("2012_ps_errup" == tune) {
385 }
386 else if ("2012_up" == tune) {
390 }
391 else if ("2012_down" == tune) {
395 }
396 else if ("2012_errup" == tune) {
399 }
400 else if ("2012_errdown" == tune) {
403 }
404
405 else if ("2011" == tune) {
408 }
409 else if("2011_with_layer2" == tune) {
412 }
413 else if ("2011_alt" == tune) {
416 }
417 else if("2011_alt_with_layer2" == tune) {
420 }
421 else if ("2011_layer1_up" == tune) {
424 }
425 else if ("2011_layer1_down" == tune) {
428 }
429 else if ("2011_layer1_errup" == tune) {
431 }
432 else if ("2011_layer1_errdown" == tune) {
434 }
435 else if ("2011_ps_down" == tune) {
438 }
439 else if ("2011_ps_up" == tune) {
442 }
443 else if ("2011_ps_errdown" == tune) {
445 }
446 else if ("2011_ps_errup" == tune) {
448 }
449 else if ("2011_up" == tune) {
452 }
453 else if ("2011_down" == tune) {
456 }
457 else if ("2011_errup" == tune) {
460 }
461 else if ("2011_errdown" == tune) {
464 }
465
466 else if ("2010" == tune) {
469 }
470 else if ("2010_layer1_up" == tune) {
473 }
474 else if ("2010_layer1_down" == tune) {
477 }
478 else if ("2010_layer1_errup" == tune) {
480 }
481 else if ("2010_layer1_errdown" == tune) {
483 }
484 else if ("2010_ps_down" == tune) {
487 }
488 else if ("2010_ps_up" == tune) {
491 }
492 else if ("2010_ps_errdown" == tune) {
494 }
495 else if ("2010_ps_errup" == tune) {
497 }
498 else if ("2010_up" == tune) {
501 }
502 else if ("2010_down" == tune) {
505 }
506 else if ("2010_errup" == tune) {
509 }
510 else if ("2010_errdown" == tune) {
513 }
514 else if ("ps_HV1" == tune) {
516 }
517 else if ("ps_EMECHV1" == tune) {
519 }
520 else if ("test1" == tune) {
521 TH1F h_presampler(
"h_presampler",
"h_presampler", 10, -2.5, 2.5);
522
523
524 for (int ibin = 1; ibin <= 5; ++ibin) {
525 h_presampler.SetBinContent(ibin, -0.1);
526 h_presampler.SetBinContent(ibin + 5, 0.1);
527 }
530 }
531 else if ("acc_zee_run3_gnn_v0" == tune){
533 TFile
f(
file.c_str());
534 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel23_gnn"));
535 assert(histo_acc);
537 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
538 }
539 else if ("acc_zee_run3_v0" == tune){
541 TFile
f(
file.c_str());
542 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel23"));
543 assert(histo_acc);
545 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
546 }
547
548 else if ("acc_zee_r22_v1" == tune) {
550 TFile
f(
file.c_str());
551 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
552 assert(histo_acc);
554 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
555 }
556 else if ("acc_zee_r22_v0" == tune) {
558 TFile
f(
file.c_str());
559 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
560 assert(histo_acc);
562 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
563 }
564 else if ("layer1_1" == tune) {
565 TFormula
f(
"formula_layer1_1",
"(abs(x)<1.425) ? 0.97 : 1");
567 }
568 else if ("layer1_2" == tune) {
569 TFormula
f(
"formula_layer1_2",
"(abs(x)<1.425) ? 0.97 : 1.05");
571 }
572 else if ("layer1_alt_2012_v5" == tune) {
574 TFile
f(
file.c_str());
575 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
577 new GetAmountHisto1D(*histo));
578 }
579 else if ("layer1_2012_v5" == tune) {
581 TFile
f(
file.c_str());
582 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
584 new GetAmountHisto1D(*histo));
585 }
586 else if ("layer1_2012_v5_down" == tune) {
588 TFile
f(
file.c_str());
589 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
591 new GetAmountHisto1DUp(*histo));
592 }
593 else if ("layer1_2012_v5_up" == tune) {
595 TFile
f(
file.c_str());
596 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
598 new GetAmountHisto1DDown(*histo));
599 }
600 else if ("layer1_2012_v5_errdown" == tune) {
602 TFile
f(
file.c_str());
603 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
605 new GetAmountHisto1DErrorUp(*histo));
606 }
607 else if ("layer1_2012_v5_errup" == tune) {
609 TFile
f(
file.c_str());
610 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
612 new GetAmountHisto1DErrorDown(*histo));
613 }
614 else if ("layer1_alt_2011_v5" == tune) {
616 TFile
f(
file.c_str());
617 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
619 new GetAmountHisto1D(*histo));
620 }
621 else if ("layer1_2011_v5" == tune) {
623 TFile
f(
file.c_str());
624 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
626 new GetAmountHisto1D(*histo));
627 }
628 else if ("layer1_2011_v5_down" == tune) {
630 TFile
f(
file.c_str());
631 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
633 new GetAmountHisto1DUp(*histo));
634 }
635 else if ("layer1_2011_v5_up" == tune) {
637 TFile
f(
file.c_str());
638 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
640 new GetAmountHisto1DDown(*histo));
641 }
642 else if ("layer1_2011_v5_errdown" == tune) {
644 TFile
f(
file.c_str());
645 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
647 new GetAmountHisto1DErrorUp(*histo));
648 }
649 else if ("layer1_2011_v5_errup" == tune) {
651 TFile
f(
file.c_str());
652 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
654 new GetAmountHisto1DErrorDown(*histo));
655 }
656 else if ("layer1_2010_v5" == tune) {
658 TFile
f(
file.c_str());
659 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
661 new GetAmountHisto1D(*histo));
662 }
663 else if ("layer1_2010_v5_down" == tune) {
665 TFile
f(
file.c_str());
666 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
668 new GetAmountHisto1DUp(*histo));
669 }
670 else if ("layer1_2010_v5_up" == tune) {
672 TFile
f(
file.c_str());
673 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
675 new GetAmountHisto1DDown(*histo));
676 }
677 else if ("layer1_2010_v5_errdown" == tune) {
679 TFile
f(
file.c_str());
680 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
682 new GetAmountHisto1DErrorUp(*histo));
683 }
684 else if ("layer1_2010_v5_errup" == tune) {
686 TFile
f(
file.c_str());
687 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
689 new GetAmountHisto1DErrorDown(*histo));
690 }
691 else if ("layer2_run3_ofc_extrapolate_v0"==tune){
693 TFile
f(
file.c_str());
694 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v1_run3ofc"));
695 assert(histo);
697 new GetAmountHisto1D(*histo));
698 }
699
700 else if("layer2_alt_el_mu_comb_r21_v0_fix"==tune) {
702 TFile
f(
file.c_str());
703 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0_fix"));
704 assert(histo);
706 new GetAmountHisto1D(*histo));
707 }
708 else if("layer2_alt_el_mu_comb_r21_v0"==tune) {
710 TFile
f(
file.c_str());
711 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0"));
712 assert(histo);
714 new GetAmountHisto1D(*histo));
715 }
716 else if("layer2_alt_run2_r21_v1"==tune) {
718 TFile
f(
file.c_str());
719 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2_mu_run2_rel21_v1"));
721 new GetAmountHisto1D(*histo));
722 }
723 else if("layer2_alt_run2_r21_v0"==tune) {
725 TFile
f(
file.c_str());
726 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_rel21_v1"));
728 new GetAmountHisto1D(*histo));
729 }
730 else if("layer2_alt_run2_v1" == tune) {
732 TFile
f(
file.c_str());
733 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_v1"));
735 new GetAmountHisto1D(*histo));
736 }
737 else if("layer2_alt_2012_v5" == tune) {
739 TFile
f(
file.c_str());
740 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
742 new GetAmountHisto1D(*histo));
743 }
744 else if("layer2_2012_v5" == tune) {
746 TFile
f(
file.c_str());
747 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
749 new GetAmountHisto1D(*histo));
750 }
751 else if("layer2_2012_v5_down" == tune) {
753 TFile
f(
file.c_str());
754 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
756 new GetAmountHisto1DDown(*histo));
757 }
758 else if("layer2_2012_v5_up" == tune) {
760 TFile
f(
file.c_str());
761 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
763 new GetAmountHisto1DUp(*histo));
764 }
765 else if ("layer2_2012_v5_errdown" == tune) {
767 TFile
f(
file.c_str());
768 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
770 new GetAmountHisto1DErrorDown(*histo));
771 }
772 else if ("layer2_2012_v5_errup" == tune) {
774 TFile
f(
file.c_str());
775 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
777 new GetAmountHisto1DErrorUp(*histo));
778 }
779 else if("layer2_alt_2011_v5" == tune) {
781 TFile
f(
file.c_str());
782 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
784 new GetAmountHisto1D(*histo));
785 }
786 else if("layer2_2011_v5" == tune) {
788 TFile
f(
file.c_str());
789 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
791 new GetAmountHisto1D(*histo));
792 }
793 else if("layer2_2011_v5_down" == tune) {
795 TFile
f(
file.c_str());
796 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
798 new GetAmountHisto1DDown(*histo));
799 }
800 else if("layer2_2011_v5_up" == tune) {
802 TFile
f(
file.c_str());
803 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
805 new GetAmountHisto1DUp(*histo));
806 }
807 else if ("layer2_2011_v5_errdown" == tune) {
809 TFile
f(
file.c_str());
810 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
812 new GetAmountHisto1DErrorDown(*histo));
813 }
814 else if ("layer2_2011_v5_errup" == tune) {
816 TFile
f(
file.c_str());
817 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
819 new GetAmountHisto1DErrorUp(*histo));
820 }
821 else if("layer2_2010_v5" == tune) {
823 TFile
f(
file.c_str());
824 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
826 new GetAmountHisto1D(*histo));
827 }
828 else if("layer2_2010_v5_down" == tune) {
830 TFile
f(
file.c_str());
831 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
833 new GetAmountHisto1DDown(*histo));
834 }
835 else if("layer2_2010_v5_up" == tune) {
837 TFile
f(
file.c_str());
838 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
840 new GetAmountHisto1DUp(*histo));
841 }
842 else if ("layer2_2010_v5_errdown" == tune) {
844 TFile
f(
file.c_str());
845 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
847 new GetAmountHisto1DErrorDown(*histo));
848 }
849 else if ("layer2_2010_v5_errup" == tune) {
851 TFile
f(
file.c_str());
852 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
854 new GetAmountHisto1DErrorUp(*histo));
855 }
856 else if ("ps_2016_r21_v0" == tune) {
858 TFile
f(
file.c_str());
859 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016_rel21"));
861 new GetAmountHisto1D(*histo_ps_tot_error));
862 }
863 else if ("ps_run3_ofc_extrapolate_v0" == tune){
865 TFile
f(
file.c_str());
866 TH1* histo_ps_tot_error =
static_cast<TH1*
>(
f.Get(
"hPS_MuonLowMu_rel21_run3ofc"));
867 assert(histo_ps_tot_error);
869 new GetAmountHisto1D(*histo_ps_tot_error));
870 }
871 else if ("ps_mu_r21_v0" == tune) {
873 TFile
f(
file.c_str());
874 TH1* histo_ps_tot_error =
static_cast<TH1*
>(
f.Get(
"hPS_MuonLowMu_rel21"));
875 assert(histo_ps_tot_error);
877 new GetAmountHisto1D(*histo_ps_tot_error));
878 }
879 else if ("ps_2016_v1" == tune) {
881 TFile
f(
file.c_str());
882 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016"));
884 new GetAmountHisto1D(*histo_ps_tot_error));
885 }
886 else if ("ps_2012_v3" == tune) {
888 TFile
f(
file.c_str());
889 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
891 new GetAmountHisto1D(*histo_ps_tot_error));
892 }
893 else if ("ps_2012_v3_down" == tune) {
895 TFile
f(
file.c_str());
896 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
898 new GetAmountHisto1DUp(*histo_ps_tot_error));
899 }
900 else if ("ps_2012_v3_up" == tune){
902 TFile
f(
file.c_str());
903 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
905 new GetAmountHisto1DDown(*histo_ps_tot_error));
906 }
907 else if ("ps_2012_v3_errdown" == tune){
909 TFile
f(
file.c_str());
910 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
912 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
913 }
914 else if ("ps_2012_v3_errup" == tune){
916 TFile
f(
file.c_str());
917 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
919 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
920 }
921 else if ("ps_2011_v3" == tune) {
923 TFile
f(
file.c_str());
924 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
926 new GetAmountHisto1D(*histo_ps_tot_error));
927 }
928 else if ("ps_2011_v3_down" == tune) {
930 TFile
f(
file.c_str());
931 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
933 new GetAmountHisto1DUp(*histo_ps_tot_error));
934 }
935 else if ("ps_2011_v3_up" == tune){
937 TFile
f(
file.c_str());
938 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
940 new GetAmountHisto1DDown(*histo_ps_tot_error));
941 }
942 else if ("ps_2011_v3_errdown" == tune){
944 TFile
f(
file.c_str());
945 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
947 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
948 }
949 else if ("ps_2011_v3_errup" == tune){
951 TFile
f(
file.c_str());
952 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
954 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
955 }
956
957 else if ("ps_2010_v3" == tune) {
959 TFile
f(
file.c_str());
960 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
962 new GetAmountHisto1D(*histo_ps_tot_error));
963 }
964 else if ("ps_2010_v3_down" == tune) {
966 TFile
f(
file.c_str());
967 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
969 new GetAmountHisto1DUp(*histo_ps_tot_error));
970 }
971 else if ("ps_2010_v3_up" == tune) {
973 TFile
f(
file.c_str());
974 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
976 new GetAmountHisto1DDown(*histo_ps_tot_error));
977 }
978 else if ("ps_2010_v3_errdown" == tune){
980 TFile
f(
file.c_str());
981 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
983 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
984 }
985 else if ("ps_2010_v3_errup" == tune){
987 TFile
f(
file.c_str());
988 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
990 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
991 }
992 else {
993 throw std::runtime_error(tune+" is not a valid tune");
994 }
995}
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)