Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include <TObjString.h>
28 template <
typename TargetPtr,
typename SourcePtr>
29 TargetPtr checked_cast(SourcePtr
ptr) {
32 "attempt to cast to no ptr object");
34 "attempt to cast from no ptr object");
38 throw std::runtime_error(
39 "Attempt to cast from nullptr in egammaLayerRecalibTool");
43 TargetPtr
obj =
dynamic_cast<TargetPtr
>(
ptr);
45 throw std::runtime_error(
"failed dynamic cast for " +
46 std::string(
ptr->GetName()) +
47 " in egammaLayerRecalibTool");
159 const double Es1 =
inputs.E1raw;
160 const double Es2 =
inputs.E2raw;
161 if (Es1 == 0 and Es2 == 0) {
166 const double sum = Es1 + Es2;
167 const double alpha = amount;
168 const double den = (
alpha * Es1 + Es2);
176 throw std::runtime_error(
"not implemented");
211 if (
"layer1_2012" ==
tune)
return "layer1_2012_v5";
212 if (
"layer1_alt_2012" ==
tune)
return "layer1_alt_2012_v5";
213 if (
"layer1_2011" ==
tune)
return "layer1_2011_v5";
214 if (
"layer1_alt_2011" ==
tune)
return "layer1_alt_2011_v5";
215 if (
"layer1_2010" ==
tune)
return "layer1_2010_v5";
216 if (
"ps_2012" ==
tune)
return "ps_2012_v3";
217 if (
"ps_2011" ==
tune)
return "ps_2011_v3";
218 if (
"ps_2010" ==
tune)
return "ps_2010_v3";
219 if (
"layer1_2012_up" ==
tune)
return "layer1_2012_v5_up";
220 if (
"layer1_2012_down" ==
tune)
return "layer1_2012_v5_down";
221 if (
"layer1_2012_errup" ==
tune)
return "layer1_2012_v5_errup";
222 if (
"layer1_2012_errdown" ==
tune)
return "layer1_2012_v5_errdown";
223 if (
"layer1_2011_up" ==
tune)
return "layer1_2011_v5_up";
224 if (
"layer1_2011_down" ==
tune)
return "layer1_2011_v5_down";
225 if (
"layer1_2011_errup" ==
tune)
return "layer1_2011_v5_errup";
226 if (
"layer1_2011_errdown" ==
tune)
return "layer1_2011_v5_errdown";
227 if (
"layer1_2010_up" ==
tune)
return "layer1_2010_v5_up";
228 if (
"layer1_2010_down" ==
tune)
return "layer1_2010_v5_down";
229 if (
"layer1_2010_errup" ==
tune)
return "layer1_2010_v5_errup";
230 if (
"layer1_2010_errdown" ==
tune)
return "layer1_2010_v5_errdown";
231 if (
"ps_2012_up" ==
tune)
return "ps_2012_v3_up";
232 if (
"ps_2012_down" ==
tune)
return "ps_2012_v3_down";
233 if (
"ps_2012_errup" ==
tune)
return "ps_2012_v3_errup";
234 if (
"ps_2012_errdown" ==
tune)
return "ps_2012_v3_errdown";
235 if (
"ps_2011_up" ==
tune)
return "ps_2011_v3_up";
236 if (
"ps_2011_down" ==
tune)
return "ps_2011_v3_down";
237 if (
"ps_2011_errup" ==
tune)
return "ps_2011_v3_errup";
238 if (
"ps_2011_errdown" ==
tune)
return "ps_2011_v3_errdown";
239 if (
"ps_2010_up" ==
tune)
return "ps_2010_v3_up";
240 if (
"ps_2010_down" ==
tune)
return "ps_2010_v3_down";
241 if (
"ps_2010_errup" ==
tune)
return "ps_2010_v3_errup";
242 if (
"ps_2010_errdown" ==
tune)
return "ps_2010_v3_errdown";
252 if (
tune.empty()) { }
254 else if (
"es2022_22.0_Precision_v1" ==
tune) {
255 add_scale(
"run2_alt_with_layer2_r22_Precision_v1");
257 else if (
"es2022_22.0_Precision" ==
tune) {
258 add_scale(
"run2_alt_with_layer2_r22_Precision");
260 else if (
"es2018_21.0_v0" ==
tune) {
261 add_scale(
"run2_alt_with_layer2_r21_v1");
263 else if (
"es2017_21.0_v0" ==
tune) {
264 add_scale(
"run2_alt_with_layer2_r21_v0");
266 else if (
"es2017_20.7_final" ==
tune) {
270 else if (
"es2017_20.7_improved" ==
tune) {
275 else if (
"pileup_20.7" ==
tune) {
283 else if (
"run2_alt_with_layer2_r22_Precision_v1"==
tune) {
284 add_scale(
"layer2_alt_el_mu_comb_r21_v0_fix");
289 else if (
"run2_alt_with_layer2_r22_Precision"==
tune) {
290 add_scale(
"layer2_alt_el_mu_comb_r21_v0");
294 else if (
"run2_alt_with_layer2_r21_v1"==
tune) {
298 else if (
"run2_alt_with_layer2_r21_v0"==
tune) {
302 else if(
"run2_alt_with_layer2_modif" ==
tune) {
308 else if (
"2012" ==
tune) {
313 else if(
"2012_with_layer2" ==
tune) {
318 else if (
"2012_alt" ==
tune) {
323 else if(
"2012_alt_with_layer2" ==
tune) {
328 else if(
"2012_alt_with_layer2_modif" ==
tune) {
334 else if(
"2010_with_layer2" ==
tune) {
338 else if (
"2012_layer1_up" ==
tune) {
343 else if (
"2012_layer1_down" ==
tune) {
348 else if (
"2012_layer1_errup" ==
tune) {
351 else if (
"2012_layer1_errdown" ==
tune) {
354 else if (
"2012_ps_down" ==
tune) {
359 else if (
"2012_ps_up" ==
tune) {
364 else if (
"2012_ps_errdown" ==
tune) {
367 else if (
"2012_ps_errup" ==
tune) {
370 else if (
"2012_up" ==
tune) {
375 else if (
"2012_down" ==
tune) {
380 else if (
"2012_errup" ==
tune) {
384 else if (
"2012_errdown" ==
tune) {
389 else if (
"2011" ==
tune) {
393 else if(
"2011_with_layer2" ==
tune) {
397 else if (
"2011_alt" ==
tune) {
401 else if(
"2011_alt_with_layer2" ==
tune) {
405 else if (
"2011_layer1_up" ==
tune) {
409 else if (
"2011_layer1_down" ==
tune) {
413 else if (
"2011_layer1_errup" ==
tune) {
416 else if (
"2011_layer1_errdown" ==
tune) {
419 else if (
"2011_ps_down" ==
tune) {
423 else if (
"2011_ps_up" ==
tune) {
427 else if (
"2011_ps_errdown" ==
tune) {
430 else if (
"2011_ps_errup" ==
tune) {
433 else if (
"2011_up" ==
tune) {
437 else if (
"2011_down" ==
tune) {
441 else if (
"2011_errup" ==
tune) {
445 else if (
"2011_errdown" ==
tune) {
450 else if (
"2010" ==
tune) {
454 else if (
"2010_layer1_up" ==
tune) {
458 else if (
"2010_layer1_down" ==
tune) {
462 else if (
"2010_layer1_errup" ==
tune) {
465 else if (
"2010_layer1_errdown" ==
tune) {
468 else if (
"2010_ps_down" ==
tune) {
472 else if (
"2010_ps_up" ==
tune) {
476 else if (
"2010_ps_errdown" ==
tune) {
479 else if (
"2010_ps_errup" ==
tune) {
482 else if (
"2010_up" ==
tune) {
486 else if (
"2010_down" ==
tune) {
490 else if (
"2010_errup" ==
tune) {
494 else if (
"2010_errdown" ==
tune) {
498 else if (
"ps_HV1" ==
tune) {
501 else if (
"ps_EMECHV1" ==
tune) {
504 else if (
"test1" ==
tune) {
505 TH1F h_presampler(
"h_presampler",
"h_presampler", 10, -2.5, 2.5);
508 for (
int ibin = 1; ibin <= 5; ++ibin) {
509 h_presampler.SetBinContent(ibin, -0.1);
510 h_presampler.SetBinContent(ibin + 5, 0.1);
516 else if (
"acc_zee_r22_v1" ==
tune) {
518 TFile
f(
file.c_str());
519 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
524 else if (
"acc_zee_r22_v0" ==
tune) {
526 TFile
f(
file.c_str());
527 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
532 else if (
"layer1_1" ==
tune) {
533 TFormula
f(
"formula_layer1_1",
"(abs(x)<1.425) ? 0.97 : 1");
536 else if (
"layer1_2" ==
tune) {
537 TFormula
f(
"formula_layer1_2",
"(abs(x)<1.425) ? 0.97 : 1.05");
540 else if (
"layer1_alt_2012_v5" ==
tune) {
542 TFile
f(
file.c_str());
543 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
547 else if (
"layer1_2012_v5" ==
tune) {
549 TFile
f(
file.c_str());
550 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
554 else if (
"layer1_2012_v5_down" ==
tune) {
556 TFile
f(
file.c_str());
557 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
561 else if (
"layer1_2012_v5_up" ==
tune) {
563 TFile
f(
file.c_str());
564 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
568 else if (
"layer1_2012_v5_errdown" ==
tune) {
570 TFile
f(
file.c_str());
571 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
575 else if (
"layer1_2012_v5_errup" ==
tune) {
577 TFile
f(
file.c_str());
578 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
582 else if (
"layer1_alt_2011_v5" ==
tune) {
584 TFile
f(
file.c_str());
585 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
589 else if (
"layer1_2011_v5" ==
tune) {
591 TFile
f(
file.c_str());
592 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
596 else if (
"layer1_2011_v5_down" ==
tune) {
598 TFile
f(
file.c_str());
599 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
603 else if (
"layer1_2011_v5_up" ==
tune) {
605 TFile
f(
file.c_str());
606 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
610 else if (
"layer1_2011_v5_errdown" ==
tune) {
612 TFile
f(
file.c_str());
613 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
617 else if (
"layer1_2011_v5_errup" ==
tune) {
619 TFile
f(
file.c_str());
620 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
624 else if (
"layer1_2010_v5" ==
tune) {
626 TFile
f(
file.c_str());
627 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
631 else if (
"layer1_2010_v5_down" ==
tune) {
633 TFile
f(
file.c_str());
634 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
638 else if (
"layer1_2010_v5_up" ==
tune) {
640 TFile
f(
file.c_str());
641 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
645 else if (
"layer1_2010_v5_errdown" ==
tune) {
647 TFile
f(
file.c_str());
648 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
652 else if (
"layer1_2010_v5_errup" ==
tune) {
654 TFile
f(
file.c_str());
655 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
660 else if(
"layer2_alt_el_mu_comb_r21_v0_fix"==
tune) {
662 TFile
f(
file.c_str());
663 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0_fix"));
668 else if(
"layer2_alt_el_mu_comb_r21_v0"==
tune) {
670 TFile
f(
file.c_str());
671 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0"));
676 else if(
"layer2_alt_run2_r21_v1"==
tune) {
678 TFile
f(
file.c_str());
679 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2_mu_run2_rel21_v1"));
683 else if(
"layer2_alt_run2_r21_v0"==
tune) {
685 TFile
f(
file.c_str());
686 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_rel21_v1"));
690 else if(
"layer2_alt_run2_v1" ==
tune) {
692 TFile
f(
file.c_str());
693 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_v1"));
697 else if(
"layer2_alt_2012_v5" ==
tune) {
699 TFile
f(
file.c_str());
700 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
704 else if(
"layer2_2012_v5" ==
tune) {
706 TFile
f(
file.c_str());
707 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
711 else if(
"layer2_2012_v5_down" ==
tune) {
713 TFile
f(
file.c_str());
714 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
718 else if(
"layer2_2012_v5_up" ==
tune) {
720 TFile
f(
file.c_str());
721 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
725 else if (
"layer2_2012_v5_errdown" ==
tune) {
727 TFile
f(
file.c_str());
728 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
732 else if (
"layer2_2012_v5_errup" ==
tune) {
734 TFile
f(
file.c_str());
735 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
739 else if(
"layer2_alt_2011_v5" ==
tune) {
741 TFile
f(
file.c_str());
742 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
746 else if(
"layer2_2011_v5" ==
tune) {
748 TFile
f(
file.c_str());
749 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
753 else if(
"layer2_2011_v5_down" ==
tune) {
755 TFile
f(
file.c_str());
756 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
760 else if(
"layer2_2011_v5_up" ==
tune) {
762 TFile
f(
file.c_str());
763 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
767 else if (
"layer2_2011_v5_errdown" ==
tune) {
769 TFile
f(
file.c_str());
770 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
774 else if (
"layer2_2011_v5_errup" ==
tune) {
776 TFile
f(
file.c_str());
777 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
781 else if(
"layer2_2010_v5" ==
tune) {
783 TFile
f(
file.c_str());
784 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
788 else if(
"layer2_2010_v5_down" ==
tune) {
790 TFile
f(
file.c_str());
791 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
795 else if(
"layer2_2010_v5_up" ==
tune) {
797 TFile
f(
file.c_str());
798 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
802 else if (
"layer2_2010_v5_errdown" ==
tune) {
804 TFile
f(
file.c_str());
805 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
809 else if (
"layer2_2010_v5_errup" ==
tune) {
811 TFile
f(
file.c_str());
812 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
816 else if (
"ps_2016_r21_v0" ==
tune) {
818 TFile
f(
file.c_str());
819 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016_rel21"));
823 else if (
"ps_mu_r21_v0" ==
tune) {
825 TFile
f(
file.c_str());
826 TH1F* histo_ps_tot_error =
static_cast<TH1F*
>(
f.Get(
"hPS_MuonLowMu_rel21"));
827 assert(histo_ps_tot_error);
831 else if (
"ps_2016_v1" ==
tune) {
833 TFile
f(
file.c_str());
834 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016"));
838 else if (
"ps_2012_v3" ==
tune) {
840 TFile
f(
file.c_str());
841 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
845 else if (
"ps_2012_v3_down" ==
tune) {
847 TFile
f(
file.c_str());
848 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
852 else if (
"ps_2012_v3_up" ==
tune){
854 TFile
f(
file.c_str());
855 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
859 else if (
"ps_2012_v3_errdown" ==
tune){
861 TFile
f(
file.c_str());
862 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
866 else if (
"ps_2012_v3_errup" ==
tune){
868 TFile
f(
file.c_str());
869 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
873 else if (
"ps_2011_v3" ==
tune) {
875 TFile
f(
file.c_str());
876 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
880 else if (
"ps_2011_v3_down" ==
tune) {
882 TFile
f(
file.c_str());
883 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
887 else if (
"ps_2011_v3_up" ==
tune){
889 TFile
f(
file.c_str());
890 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
894 else if (
"ps_2011_v3_errdown" ==
tune){
896 TFile
f(
file.c_str());
897 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
901 else if (
"ps_2011_v3_errup" ==
tune){
903 TFile
f(
file.c_str());
904 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
909 else if (
"ps_2010_v3" ==
tune) {
911 TFile
f(
file.c_str());
912 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
916 else if (
"ps_2010_v3_down" ==
tune) {
918 TFile
f(
file.c_str());
919 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
923 else if (
"ps_2010_v3_up" ==
tune) {
925 TFile
f(
file.c_str());
926 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
930 else if (
"ps_2010_v3_errdown" ==
tune){
932 TFile
f(
file.c_str());
933 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
937 else if (
"ps_2010_v3_errup" ==
tune){
939 TFile
f(
file.c_str());
940 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
945 throw std::runtime_error(
tune+
" is not a valid tune");
950 :
asg::AsgMessaging(
name), m_tune(
tune), m_doSaccCorrections(SaccEnable)
987 std::string fixT =
"";
988 double addE2 = 0, addE3 = 0;
991 fixT =
"_egFixForTopoTimingCut";
992 unsigned short stat =
996 " but some layer info is not available,"
997 " from L2 : " <<
stat%2 <<
" from L3 : " <<
stat/2);
1004 eta_calo = cluster->eta();
1010 eta_calo = accEtaCalo(*cluster);
1013 ATH_MSG_ERROR(
"etaCalo not available as auxilliary variable,"
1014 " using cluster eta as eta calo!");
1015 eta_calo=cluster->eta();
1023 cluster->energyBE(0),
1024 cluster->energyBE(1),
1025 cluster->energyBE(2) + addE2,
1026 cluster->energyBE(3) + addE3,
1039 deco_layer_correction(
"layer_correction");
1042 ATH_MSG_DEBUG(
"decorating cluster with corrected layer energies");
1044 inputs.E0raw : cluster->energyBE(0);
1046 inputs.E1raw : cluster->energyBE(1);
1048 inputs.E2raw : cluster->energyBE(2) + addE2;
1050 inputs.E3raw : cluster->energyBE(3) + addE3;
1051 deco_layer_correction(*cluster) = isData ?
m_tune+fixT : fixT;
1056 " decorating particle with non-corrected layer energies");
1061 deco_E0(*cluster) = cluster->energyBE(0);
1062 deco_E1(*cluster) = cluster->energyBE(1);
1063 deco_E2(*cluster) = cluster->energyBE(2) + addE2;
1064 deco_E3(*cluster) = cluster->energyBE(3) + addE3;
1065 deco_layer_correction(*cluster) = isData ?
m_tune +
"_Err" + fixT : fixT;
1082 std::map<std::string, std::string>
parse(
const std::string&
list)
1084 std::cout <<
"list: '" <<
list <<
"'" << std::endl;
1085 std::map<std::string, std::string>
result;
1087 while (TObjString* sObj = (TObjString*)
next())
1089 const TString&
item(sObj->GetString());
1090 std::cout <<
"item: '" <<
item <<
"'" << std::endl;
1091 TObjArray* item_list = TString(
item).Tokenize(
":");
1094 if (item_list->GetEntries() == 1) {
1096 value =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1098 else if (item_list->GetEntries() == 2) {
1099 key =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1100 value =
static_cast<TObjString*
>(item_list->At(1))->GetString().Data();
1103 std::cerr <<
"invalid string " <<
item << std::endl;
1106 std::cerr <<
"trying to insert two times key " <<
key << std::endl;
1115 std::pair<std::string, egammaLayerRecalibTool*>
1118 std::map<std::string, std::string> args_map =
parse(
args);
1120 std::string
name =
"";
1121 std::string amount_name =
"";
1122 std::string type_name =
"";
1127 if (args_map.find(
"amount") != args_map.end()) {
1128 std::string amount_str = args_map[
"amount"];
1130 if (amount_str.back()==
'%') {
1132 amount_str.pop_back();
1134 const float amount = TString(amount_str).Atof() * (
perc ? 0.01 : 1);
1137 std::stringstream amount_stream;
1138 amount_stream << amount;
1139 amount_name = amount_stream.str();
1140 std::replace(amount_name.begin(), amount_name.end(),
'-',
'n');
1141 std::replace(amount_name.begin(), amount_name.end(),
'.',
'p');
1143 else if (args_map.find(
"name") != args_map.end()) {
1144 name = args_map[
"name"];
1146 else if (args_map.find(
"histo") != args_map.end()) {
1148 if (args_map.find(
"file") == args_map.end()) {
1149 std::cerr <<
"with histo you must specify file" << std::endl;
1152 if (args_map.find(
"formulax") != args_map.end())
dim = 1;
1156 std::cerr <<
"with histo you must specify formulax" << std::endl;
1160 TFile
f(args_map[
"file"].c_str());
1161 std::cout <<
"opening histo " << args_map[
"histo"] <<
" from file " << args_map[
"file"] << std::endl;
1162 TH1F*
histo =
dynamic_cast<TH1F*
>(
f.Get(args_map[
"histo"].c_str()));
1165 histo->SetDirectory(
nullptr);
1168 else{assert(
false); }
1170 else { assert(
false); }
1173 std::cerr <<
"cannot understand argument " <<
args << std::endl;
1185 if (not type_name.empty() and not amount_name.empty()) {
1186 name = type_name +
"_" + amount_name;
1190 std::cerr <<
"you need to specify a name for the bias with type " <<
type << std::endl;
1201 if(amount_getter)
delete amount_getter;
float getCorr(int run, float eta, float phi) const
get correction factor to apply to raw EMBPS energy : corrected raw EMBPS energy = correction factor *...
std::string replace(std::string s, const std::string &s2, const std::string &s3)
unsigned short energyInMissingCells(const xAOD::Egamma &eg, double &e2, double &e3)
Get the energies in sampling 2 and 3 that are in cells rejected by the topo-cluster timing cut but th...
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
virtual float operator()(const StdCalibrationInputs &input) const
virtual void shift_inputs(StdCalibrationInputs &, float amount) const
Helper class to provide type-safe access to aux data.
virtual float operator()(const StdCalibrationInputs &inputs) const
corr_pileupShift * m_tool
virtual float operator()(const StdCalibrationInputs &input) const
corr_pileupShift * m_tool
virtual void shift_inputs(StdCalibrationInputs &, float amount) const
virtual float operator()(const StdCalibrationInputs &input) const
virtual float operator()(const StdCalibrationInputs &inputs) const
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
virtual float operator()(const StdCalibrationInputs &input) const
Correction for pileup induced energy shit as function of mu per layer for 2016 data.
@ IS_SIMULATION
true: simulation, false: data
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
virtual void scale_inputs(StdCalibrationInputs &, float amount) const
corr_pileupShift * m_tool
uint32_t runNumber() const
The current event's run number.
virtual void shift_inputs(StdCalibrationInputs &, float amount) const
virtual float operator()(const StdCalibrationInputs &input) const
@ OutOfValidityRange
Input object is out of validity range.
@ Error
Some error happened during the object correction.
Description of a calorimeter cluster.
virtual float operator()(const StdCalibrationInputs &input) const
float getCorr(int layer, int run, float mu, float eta) const
get shift to subtract to raw layer energy : corrected layer energy = raw energy - shift
virtual float operator()(const StdCalibrationInputs &inputs) const
Helper class to provide type-safe access to aux data.
corr_pileupShift * m_tool
virtual float operator()(const StdCalibrationInputs &inputs) const
virtual void scale_inputs(StdCalibrationInputs &, float amount) const
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
virtual void shift_inputs(StdCalibrationInputs &, float amount) const
virtual void scale_inputs(StdCalibrationInputs &, float amount) const
virtual void scale_inputs(StdCalibrationInputs &, float amount) const
virtual void shift_inputs(StdCalibrationInputs &, float amount) const
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
virtual float operator()(const StdCalibrationInputs &input) const
virtual float operator()(const StdCalibrationInputs &input) const
Class describing the basic event information.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
@ Ok
The correction was done successfully.
virtual float operator()(const StdCalibrationInputs &input) const
virtual void scale_inputs(StdCalibrationInputs &, float amount) const
#define ATH_MSG_WARNING(x)
Return value from object correction CP tools.
virtual void scale_inputs(StdCalibrationInputs &, float amount) const
virtual void shift_inputs(StdCalibrationInputs &, float amount) const
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
float getCorr(int run, float eta, float phi) const
get correction factor to apply to raw EMECPS energy : corrected raw EMECPS energy = correction factor...
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
virtual void scale_inputs(StdCalibrationInputs &, float amount) const
virtual float operator()(const StdCalibrationInputs &input) const
@ ETACALOFRAME
Eta in the calo frame (for egamma)
corr_HV_EMECPS m_toolEMECPS
virtual void shift_inputs(StdCalibrationInputs &, float amount) const
std::unique_ptr< TH1 > m_histo
bool eventType(EventType type) const
Check for one particular bitmask value.