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 ("es2024_run3_extrapolate_v0" == tune) {
252 add_scale(
"run3_partial_ofc_extrapolate_v0");
253 }
254
255 else if ("es2022_22.0_Precision_v1" == tune) {
256 add_scale(
"run2_alt_with_layer2_r22_Precision_v1");
257 }
258 else if ("es2022_22.0_Precision" == tune) {
259 add_scale(
"run2_alt_with_layer2_r22_Precision");
260 }
261 else if ("es2018_21.0_v0" == tune) {
262 add_scale(
"run2_alt_with_layer2_r21_v1");
263 }
264 else if ("es2017_21.0_v0" == tune) {
265 add_scale(
"run2_alt_with_layer2_r21_v0");
266 }
267 else if ("es2017_20.7_final" == tune) {
270 }
271 else if ("es2017_20.7_improved" == tune) {
273
275 }
276 else if ("pileup_20.7" == tune) {
282 }
283
284 else if ("run3_partial_ofc_extrapolate_v0" == tune) {
285 add_scale(
"layer2_run3_ofc_extrapolate_v0");
288 }
289
290 else if ("run2_alt_with_layer2_r22_Precision_v1"==tune) {
291 add_scale(
"layer2_alt_el_mu_comb_r21_v0_fix");
294 }
295
296 else if ("run2_alt_with_layer2_r22_Precision"==tune) {
297 add_scale(
"layer2_alt_el_mu_comb_r21_v0");
300 }
301 else if ("run2_alt_with_layer2_r21_v1"==tune) {
304 }
305 else if ("run2_alt_with_layer2_r21_v0"==tune) {
308 }
309 else if("run2_alt_with_layer2_modif" == tune) {
313 }
314
315 else if ("2012" == tune) {
319 }
320 else if("2012_with_layer2" == tune) {
324 }
325 else if ("2012_alt" == tune) {
329 }
330 else if("2012_alt_with_layer2" == tune) {
334 }
335 else if("2012_alt_with_layer2_modif" == tune) {
340 }
341 else if("2010_with_layer2" == tune) {
344 }
345 else if ("2012_layer1_up" == tune) {
349 }
350 else if ("2012_layer1_down" == tune) {
354 }
355 else if ("2012_layer1_errup" == tune) {
357 }
358 else if ("2012_layer1_errdown" == tune) {
360 }
361 else if ("2012_ps_down" == tune) {
365 }
366 else if ("2012_ps_up" == tune) {
370 }
371 else if ("2012_ps_errdown" == tune) {
373 }
374 else if ("2012_ps_errup" == tune) {
376 }
377 else if ("2012_up" == tune) {
381 }
382 else if ("2012_down" == tune) {
386 }
387 else if ("2012_errup" == tune) {
390 }
391 else if ("2012_errdown" == tune) {
394 }
395
396 else if ("2011" == tune) {
399 }
400 else if("2011_with_layer2" == tune) {
403 }
404 else if ("2011_alt" == tune) {
407 }
408 else if("2011_alt_with_layer2" == tune) {
411 }
412 else if ("2011_layer1_up" == tune) {
415 }
416 else if ("2011_layer1_down" == tune) {
419 }
420 else if ("2011_layer1_errup" == tune) {
422 }
423 else if ("2011_layer1_errdown" == tune) {
425 }
426 else if ("2011_ps_down" == tune) {
429 }
430 else if ("2011_ps_up" == tune) {
433 }
434 else if ("2011_ps_errdown" == tune) {
436 }
437 else if ("2011_ps_errup" == tune) {
439 }
440 else if ("2011_up" == tune) {
443 }
444 else if ("2011_down" == tune) {
447 }
448 else if ("2011_errup" == tune) {
451 }
452 else if ("2011_errdown" == tune) {
455 }
456
457 else if ("2010" == tune) {
460 }
461 else if ("2010_layer1_up" == tune) {
464 }
465 else if ("2010_layer1_down" == tune) {
468 }
469 else if ("2010_layer1_errup" == tune) {
471 }
472 else if ("2010_layer1_errdown" == tune) {
474 }
475 else if ("2010_ps_down" == tune) {
478 }
479 else if ("2010_ps_up" == tune) {
482 }
483 else if ("2010_ps_errdown" == tune) {
485 }
486 else if ("2010_ps_errup" == tune) {
488 }
489 else if ("2010_up" == tune) {
492 }
493 else if ("2010_down" == tune) {
496 }
497 else if ("2010_errup" == tune) {
500 }
501 else if ("2010_errdown" == tune) {
504 }
505 else if ("ps_HV1" == tune) {
507 }
508 else if ("ps_EMECHV1" == tune) {
510 }
511 else if ("test1" == tune) {
512 TH1F h_presampler(
"h_presampler",
"h_presampler", 10, -2.5, 2.5);
513
514
515 for (int ibin = 1; ibin <= 5; ++ibin) {
516 h_presampler.SetBinContent(ibin, -0.1);
517 h_presampler.SetBinContent(ibin + 5, 0.1);
518 }
521 }
522 else if ("acc_zee_run3_v0" == tune){
524 TFile
f(
file.c_str());
525 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel23"));
526 assert(histo_acc);
528 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
529 }
530
531 else if ("acc_zee_r22_v1" == tune) {
533 TFile
f(
file.c_str());
534 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
535 assert(histo_acc);
537 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
538 }
539 else if ("acc_zee_r22_v0" == tune) {
541 TFile
f(
file.c_str());
542 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
543 assert(histo_acc);
545 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
546 }
547 else if ("layer1_1" == tune) {
548 TFormula
f(
"formula_layer1_1",
"(abs(x)<1.425) ? 0.97 : 1");
550 }
551 else if ("layer1_2" == tune) {
552 TFormula
f(
"formula_layer1_2",
"(abs(x)<1.425) ? 0.97 : 1.05");
554 }
555 else if ("layer1_alt_2012_v5" == tune) {
557 TFile
f(
file.c_str());
558 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
560 new GetAmountHisto1D(*histo));
561 }
562 else if ("layer1_2012_v5" == tune) {
564 TFile
f(
file.c_str());
565 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
567 new GetAmountHisto1D(*histo));
568 }
569 else if ("layer1_2012_v5_down" == tune) {
571 TFile
f(
file.c_str());
572 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
574 new GetAmountHisto1DUp(*histo));
575 }
576 else if ("layer1_2012_v5_up" == tune) {
578 TFile
f(
file.c_str());
579 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
581 new GetAmountHisto1DDown(*histo));
582 }
583 else if ("layer1_2012_v5_errdown" == tune) {
585 TFile
f(
file.c_str());
586 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
588 new GetAmountHisto1DErrorUp(*histo));
589 }
590 else if ("layer1_2012_v5_errup" == tune) {
592 TFile
f(
file.c_str());
593 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
595 new GetAmountHisto1DErrorDown(*histo));
596 }
597 else if ("layer1_alt_2011_v5" == tune) {
599 TFile
f(
file.c_str());
600 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
602 new GetAmountHisto1D(*histo));
603 }
604 else if ("layer1_2011_v5" == tune) {
606 TFile
f(
file.c_str());
607 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
609 new GetAmountHisto1D(*histo));
610 }
611 else if ("layer1_2011_v5_down" == tune) {
613 TFile
f(
file.c_str());
614 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
616 new GetAmountHisto1DUp(*histo));
617 }
618 else if ("layer1_2011_v5_up" == tune) {
620 TFile
f(
file.c_str());
621 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
623 new GetAmountHisto1DDown(*histo));
624 }
625 else if ("layer1_2011_v5_errdown" == tune) {
627 TFile
f(
file.c_str());
628 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
630 new GetAmountHisto1DErrorUp(*histo));
631 }
632 else if ("layer1_2011_v5_errup" == tune) {
634 TFile
f(
file.c_str());
635 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
637 new GetAmountHisto1DErrorDown(*histo));
638 }
639 else if ("layer1_2010_v5" == tune) {
641 TFile
f(
file.c_str());
642 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
644 new GetAmountHisto1D(*histo));
645 }
646 else if ("layer1_2010_v5_down" == tune) {
648 TFile
f(
file.c_str());
649 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
651 new GetAmountHisto1DUp(*histo));
652 }
653 else if ("layer1_2010_v5_up" == tune) {
655 TFile
f(
file.c_str());
656 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
658 new GetAmountHisto1DDown(*histo));
659 }
660 else if ("layer1_2010_v5_errdown" == tune) {
662 TFile
f(
file.c_str());
663 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
665 new GetAmountHisto1DErrorUp(*histo));
666 }
667 else if ("layer1_2010_v5_errup" == tune) {
669 TFile
f(
file.c_str());
670 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
672 new GetAmountHisto1DErrorDown(*histo));
673 }
674 else if ("layer2_run3_ofc_extrapolate_v0"==tune){
676 TFile
f(
file.c_str());
677 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v1_run3ofc"));
678 assert(histo);
680 new GetAmountHisto1D(*histo));
681 }
682
683 else if("layer2_alt_el_mu_comb_r21_v0_fix"==tune) {
685 TFile
f(
file.c_str());
686 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0_fix"));
687 assert(histo);
689 new GetAmountHisto1D(*histo));
690 }
691 else if("layer2_alt_el_mu_comb_r21_v0"==tune) {
693 TFile
f(
file.c_str());
694 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0"));
695 assert(histo);
697 new GetAmountHisto1D(*histo));
698 }
699 else if("layer2_alt_run2_r21_v1"==tune) {
701 TFile
f(
file.c_str());
702 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2_mu_run2_rel21_v1"));
704 new GetAmountHisto1D(*histo));
705 }
706 else if("layer2_alt_run2_r21_v0"==tune) {
708 TFile
f(
file.c_str());
709 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_rel21_v1"));
711 new GetAmountHisto1D(*histo));
712 }
713 else if("layer2_alt_run2_v1" == tune) {
715 TFile
f(
file.c_str());
716 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_v1"));
718 new GetAmountHisto1D(*histo));
719 }
720 else if("layer2_alt_2012_v5" == tune) {
722 TFile
f(
file.c_str());
723 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
725 new GetAmountHisto1D(*histo));
726 }
727 else if("layer2_2012_v5" == tune) {
729 TFile
f(
file.c_str());
730 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
732 new GetAmountHisto1D(*histo));
733 }
734 else if("layer2_2012_v5_down" == tune) {
736 TFile
f(
file.c_str());
737 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
739 new GetAmountHisto1DDown(*histo));
740 }
741 else if("layer2_2012_v5_up" == tune) {
743 TFile
f(
file.c_str());
744 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
746 new GetAmountHisto1DUp(*histo));
747 }
748 else if ("layer2_2012_v5_errdown" == tune) {
750 TFile
f(
file.c_str());
751 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
753 new GetAmountHisto1DErrorDown(*histo));
754 }
755 else if ("layer2_2012_v5_errup" == tune) {
757 TFile
f(
file.c_str());
758 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
760 new GetAmountHisto1DErrorUp(*histo));
761 }
762 else if("layer2_alt_2011_v5" == tune) {
764 TFile
f(
file.c_str());
765 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
767 new GetAmountHisto1D(*histo));
768 }
769 else if("layer2_2011_v5" == tune) {
771 TFile
f(
file.c_str());
772 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
774 new GetAmountHisto1D(*histo));
775 }
776 else if("layer2_2011_v5_down" == tune) {
778 TFile
f(
file.c_str());
779 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
781 new GetAmountHisto1DDown(*histo));
782 }
783 else if("layer2_2011_v5_up" == tune) {
785 TFile
f(
file.c_str());
786 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
788 new GetAmountHisto1DUp(*histo));
789 }
790 else if ("layer2_2011_v5_errdown" == tune) {
792 TFile
f(
file.c_str());
793 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
795 new GetAmountHisto1DErrorDown(*histo));
796 }
797 else if ("layer2_2011_v5_errup" == tune) {
799 TFile
f(
file.c_str());
800 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
802 new GetAmountHisto1DErrorUp(*histo));
803 }
804 else if("layer2_2010_v5" == tune) {
806 TFile
f(
file.c_str());
807 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
809 new GetAmountHisto1D(*histo));
810 }
811 else if("layer2_2010_v5_down" == tune) {
813 TFile
f(
file.c_str());
814 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
816 new GetAmountHisto1DDown(*histo));
817 }
818 else if("layer2_2010_v5_up" == tune) {
820 TFile
f(
file.c_str());
821 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
823 new GetAmountHisto1DUp(*histo));
824 }
825 else if ("layer2_2010_v5_errdown" == tune) {
827 TFile
f(
file.c_str());
828 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
830 new GetAmountHisto1DErrorDown(*histo));
831 }
832 else if ("layer2_2010_v5_errup" == tune) {
834 TFile
f(
file.c_str());
835 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
837 new GetAmountHisto1DErrorUp(*histo));
838 }
839 else if ("ps_2016_r21_v0" == tune) {
841 TFile
f(
file.c_str());
842 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016_rel21"));
844 new GetAmountHisto1D(*histo_ps_tot_error));
845 }
846 else if ("ps_run3_ofc_extrapolate_v0" == tune){
848 TFile
f(
file.c_str());
849 TH1F* histo_ps_tot_error =
static_cast<TH1F*
>(
f.Get(
"hPS_MuonLowMu_rel21_run3ofc"));
850 assert(histo_ps_tot_error);
852 new GetAmountHisto1D(*histo_ps_tot_error));
853 }
854 else if ("ps_mu_r21_v0" == tune) {
856 TFile
f(
file.c_str());
857 TH1F* histo_ps_tot_error =
static_cast<TH1F*
>(
f.Get(
"hPS_MuonLowMu_rel21"));
858 assert(histo_ps_tot_error);
860 new GetAmountHisto1D(*histo_ps_tot_error));
861 }
862 else if ("ps_2016_v1" == tune) {
864 TFile
f(
file.c_str());
865 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016"));
867 new GetAmountHisto1D(*histo_ps_tot_error));
868 }
869 else if ("ps_2012_v3" == tune) {
871 TFile
f(
file.c_str());
872 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
874 new GetAmountHisto1D(*histo_ps_tot_error));
875 }
876 else if ("ps_2012_v3_down" == tune) {
878 TFile
f(
file.c_str());
879 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
881 new GetAmountHisto1DUp(*histo_ps_tot_error));
882 }
883 else if ("ps_2012_v3_up" == tune){
885 TFile
f(
file.c_str());
886 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
888 new GetAmountHisto1DDown(*histo_ps_tot_error));
889 }
890 else if ("ps_2012_v3_errdown" == tune){
892 TFile
f(
file.c_str());
893 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
895 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
896 }
897 else if ("ps_2012_v3_errup" == tune){
899 TFile
f(
file.c_str());
900 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
902 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
903 }
904 else if ("ps_2011_v3" == tune) {
906 TFile
f(
file.c_str());
907 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
909 new GetAmountHisto1D(*histo_ps_tot_error));
910 }
911 else if ("ps_2011_v3_down" == tune) {
913 TFile
f(
file.c_str());
914 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
916 new GetAmountHisto1DUp(*histo_ps_tot_error));
917 }
918 else if ("ps_2011_v3_up" == tune){
920 TFile
f(
file.c_str());
921 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
923 new GetAmountHisto1DDown(*histo_ps_tot_error));
924 }
925 else if ("ps_2011_v3_errdown" == tune){
927 TFile
f(
file.c_str());
928 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
930 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
931 }
932 else if ("ps_2011_v3_errup" == tune){
934 TFile
f(
file.c_str());
935 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
937 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
938 }
939
940 else if ("ps_2010_v3" == tune) {
942 TFile
f(
file.c_str());
943 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
945 new GetAmountHisto1D(*histo_ps_tot_error));
946 }
947 else if ("ps_2010_v3_down" == tune) {
949 TFile
f(
file.c_str());
950 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
952 new GetAmountHisto1DUp(*histo_ps_tot_error));
953 }
954 else if ("ps_2010_v3_up" == tune) {
956 TFile
f(
file.c_str());
957 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
959 new GetAmountHisto1DDown(*histo_ps_tot_error));
960 }
961 else if ("ps_2010_v3_errdown" == tune){
963 TFile
f(
file.c_str());
964 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
966 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
967 }
968 else if ("ps_2010_v3_errup" == tune){
970 TFile
f(
file.c_str());
971 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
973 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
974 }
975 else {
976 throw std::runtime_error(tune+" is not a valid tune");
977 }
978}
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)