Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include <TObjString.h>
26 template <
typename TargetPtr,
typename SourcePtr>
27 TargetPtr checked_cast(SourcePtr
ptr) {
30 "attempt to cast to no ptr object");
32 "attempt to cast from no ptr object");
36 throw std::runtime_error(
37 "Attempt to cast from nullptr in egammaLayerRecalibTool");
41 TargetPtr
obj =
dynamic_cast<TargetPtr
>(
ptr);
43 throw std::runtime_error(
"failed dynamic cast for " +
44 std::string(
ptr->GetName()) +
45 " in egammaLayerRecalibTool");
157 const double Es1 =
inputs.E1raw;
158 const double Es2 =
inputs.E2raw;
159 if (Es1 == 0 and Es2 == 0) {
164 const double sum = Es1 + Es2;
165 const double alpha = amount;
166 const double den = (
alpha * Es1 + Es2);
174 throw std::runtime_error(
"not implemented");
209 if (
"layer1_2012" ==
tune)
return "layer1_2012_v5";
210 if (
"layer1_alt_2012" ==
tune)
return "layer1_alt_2012_v5";
211 if (
"layer1_2011" ==
tune)
return "layer1_2011_v5";
212 if (
"layer1_alt_2011" ==
tune)
return "layer1_alt_2011_v5";
213 if (
"layer1_2010" ==
tune)
return "layer1_2010_v5";
214 if (
"ps_2012" ==
tune)
return "ps_2012_v3";
215 if (
"ps_2011" ==
tune)
return "ps_2011_v3";
216 if (
"ps_2010" ==
tune)
return "ps_2010_v3";
217 if (
"layer1_2012_up" ==
tune)
return "layer1_2012_v5_up";
218 if (
"layer1_2012_down" ==
tune)
return "layer1_2012_v5_down";
219 if (
"layer1_2012_errup" ==
tune)
return "layer1_2012_v5_errup";
220 if (
"layer1_2012_errdown" ==
tune)
return "layer1_2012_v5_errdown";
221 if (
"layer1_2011_up" ==
tune)
return "layer1_2011_v5_up";
222 if (
"layer1_2011_down" ==
tune)
return "layer1_2011_v5_down";
223 if (
"layer1_2011_errup" ==
tune)
return "layer1_2011_v5_errup";
224 if (
"layer1_2011_errdown" ==
tune)
return "layer1_2011_v5_errdown";
225 if (
"layer1_2010_up" ==
tune)
return "layer1_2010_v5_up";
226 if (
"layer1_2010_down" ==
tune)
return "layer1_2010_v5_down";
227 if (
"layer1_2010_errup" ==
tune)
return "layer1_2010_v5_errup";
228 if (
"layer1_2010_errdown" ==
tune)
return "layer1_2010_v5_errdown";
229 if (
"ps_2012_up" ==
tune)
return "ps_2012_v3_up";
230 if (
"ps_2012_down" ==
tune)
return "ps_2012_v3_down";
231 if (
"ps_2012_errup" ==
tune)
return "ps_2012_v3_errup";
232 if (
"ps_2012_errdown" ==
tune)
return "ps_2012_v3_errdown";
233 if (
"ps_2011_up" ==
tune)
return "ps_2011_v3_up";
234 if (
"ps_2011_down" ==
tune)
return "ps_2011_v3_down";
235 if (
"ps_2011_errup" ==
tune)
return "ps_2011_v3_errup";
236 if (
"ps_2011_errdown" ==
tune)
return "ps_2011_v3_errdown";
237 if (
"ps_2010_up" ==
tune)
return "ps_2010_v3_up";
238 if (
"ps_2010_down" ==
tune)
return "ps_2010_v3_down";
239 if (
"ps_2010_errup" ==
tune)
return "ps_2010_v3_errup";
240 if (
"ps_2010_errdown" ==
tune)
return "ps_2010_v3_errdown";
250 if (
tune.empty()) { }
252 else if (
"es2022_22.0_Precision_v1" ==
tune) {
253 add_scale(
"run2_alt_with_layer2_r22_Precision_v1");
255 else if (
"es2022_22.0_Precision" ==
tune) {
256 add_scale(
"run2_alt_with_layer2_r22_Precision");
258 else if (
"es2018_21.0_v0" ==
tune) {
259 add_scale(
"run2_alt_with_layer2_r21_v1");
261 else if (
"es2017_21.0_v0" ==
tune) {
262 add_scale(
"run2_alt_with_layer2_r21_v0");
264 else if (
"es2017_20.7_final" ==
tune) {
268 else if (
"es2017_20.7_improved" ==
tune) {
273 else if (
"pileup_20.7" ==
tune) {
281 else if (
"run2_alt_with_layer2_r22_Precision_v1"==
tune) {
282 add_scale(
"layer2_alt_el_mu_comb_r21_v0_fix");
287 else if (
"run2_alt_with_layer2_r22_Precision"==
tune) {
288 add_scale(
"layer2_alt_el_mu_comb_r21_v0");
292 else if (
"run2_alt_with_layer2_r21_v1"==
tune) {
296 else if (
"run2_alt_with_layer2_r21_v0"==
tune) {
300 else if(
"run2_alt_with_layer2_modif" ==
tune) {
306 else if (
"2012" ==
tune) {
311 else if(
"2012_with_layer2" ==
tune) {
316 else if (
"2012_alt" ==
tune) {
321 else if(
"2012_alt_with_layer2" ==
tune) {
326 else if(
"2012_alt_with_layer2_modif" ==
tune) {
332 else if(
"2010_with_layer2" ==
tune) {
336 else if (
"2012_layer1_up" ==
tune) {
341 else if (
"2012_layer1_down" ==
tune) {
346 else if (
"2012_layer1_errup" ==
tune) {
349 else if (
"2012_layer1_errdown" ==
tune) {
352 else if (
"2012_ps_down" ==
tune) {
357 else if (
"2012_ps_up" ==
tune) {
362 else if (
"2012_ps_errdown" ==
tune) {
365 else if (
"2012_ps_errup" ==
tune) {
368 else if (
"2012_up" ==
tune) {
373 else if (
"2012_down" ==
tune) {
378 else if (
"2012_errup" ==
tune) {
382 else if (
"2012_errdown" ==
tune) {
387 else if (
"2011" ==
tune) {
391 else if(
"2011_with_layer2" ==
tune) {
395 else if (
"2011_alt" ==
tune) {
399 else if(
"2011_alt_with_layer2" ==
tune) {
403 else if (
"2011_layer1_up" ==
tune) {
407 else if (
"2011_layer1_down" ==
tune) {
411 else if (
"2011_layer1_errup" ==
tune) {
414 else if (
"2011_layer1_errdown" ==
tune) {
417 else if (
"2011_ps_down" ==
tune) {
421 else if (
"2011_ps_up" ==
tune) {
425 else if (
"2011_ps_errdown" ==
tune) {
428 else if (
"2011_ps_errup" ==
tune) {
431 else if (
"2011_up" ==
tune) {
435 else if (
"2011_down" ==
tune) {
439 else if (
"2011_errup" ==
tune) {
443 else if (
"2011_errdown" ==
tune) {
448 else if (
"2010" ==
tune) {
452 else if (
"2010_layer1_up" ==
tune) {
456 else if (
"2010_layer1_down" ==
tune) {
460 else if (
"2010_layer1_errup" ==
tune) {
463 else if (
"2010_layer1_errdown" ==
tune) {
466 else if (
"2010_ps_down" ==
tune) {
470 else if (
"2010_ps_up" ==
tune) {
474 else if (
"2010_ps_errdown" ==
tune) {
477 else if (
"2010_ps_errup" ==
tune) {
480 else if (
"2010_up" ==
tune) {
484 else if (
"2010_down" ==
tune) {
488 else if (
"2010_errup" ==
tune) {
492 else if (
"2010_errdown" ==
tune) {
496 else if (
"ps_HV1" ==
tune) {
499 else if (
"ps_EMECHV1" ==
tune) {
502 else if (
"test1" ==
tune) {
503 TH1F h_presampler(
"h_presampler",
"h_presampler", 10, -2.5, 2.5);
506 for (
int ibin = 1; ibin <= 5; ++ibin) {
507 h_presampler.SetBinContent(ibin, -0.1);
508 h_presampler.SetBinContent(ibin + 5, 0.1);
514 else if (
"acc_zee_r22_v1" ==
tune) {
516 TFile
f(
file.c_str());
517 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
522 else if (
"acc_zee_r22_v0" ==
tune) {
524 TFile
f(
file.c_str());
525 TH2F* histo_acc =
static_cast<TH2F*
>(
f.Get(
"hACC_Zee_rel22"));
530 else if (
"layer1_1" ==
tune) {
531 TFormula
f(
"formula_layer1_1",
"(abs(x)<1.425) ? 0.97 : 1");
534 else if (
"layer1_2" ==
tune) {
535 TFormula
f(
"formula_layer1_2",
"(abs(x)<1.425) ? 0.97 : 1.05");
538 else if (
"layer1_alt_2012_v5" ==
tune) {
540 TFile
f(
file.c_str());
541 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
545 else if (
"layer1_2012_v5" ==
tune) {
547 TFile
f(
file.c_str());
548 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
552 else if (
"layer1_2012_v5_down" ==
tune) {
554 TFile
f(
file.c_str());
555 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
559 else if (
"layer1_2012_v5_up" ==
tune) {
561 TFile
f(
file.c_str());
562 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
566 else if (
"layer1_2012_v5_errdown" ==
tune) {
568 TFile
f(
file.c_str());
569 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
573 else if (
"layer1_2012_v5_errup" ==
tune) {
575 TFile
f(
file.c_str());
576 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
580 else if (
"layer1_alt_2011_v5" ==
tune) {
582 TFile
f(
file.c_str());
583 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
587 else if (
"layer1_2011_v5" ==
tune) {
589 TFile
f(
file.c_str());
590 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
594 else if (
"layer1_2011_v5_down" ==
tune) {
596 TFile
f(
file.c_str());
597 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
601 else if (
"layer1_2011_v5_up" ==
tune) {
603 TFile
f(
file.c_str());
604 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
608 else if (
"layer1_2011_v5_errdown" ==
tune) {
610 TFile
f(
file.c_str());
611 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
615 else if (
"layer1_2011_v5_errup" ==
tune) {
617 TFile
f(
file.c_str());
618 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
622 else if (
"layer1_2010_v5" ==
tune) {
624 TFile
f(
file.c_str());
625 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
629 else if (
"layer1_2010_v5_down" ==
tune) {
631 TFile
f(
file.c_str());
632 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
636 else if (
"layer1_2010_v5_up" ==
tune) {
638 TFile
f(
file.c_str());
639 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
643 else if (
"layer1_2010_v5_errdown" ==
tune) {
645 TFile
f(
file.c_str());
646 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
650 else if (
"layer1_2010_v5_errup" ==
tune) {
652 TFile
f(
file.c_str());
653 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
658 else if(
"layer2_alt_el_mu_comb_r21_v0_fix"==
tune) {
660 TFile
f(
file.c_str());
661 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0_fix"));
666 else if(
"layer2_alt_el_mu_comb_r21_v0"==
tune) {
668 TFile
f(
file.c_str());
669 TH1D*
histo =
static_cast<TH1D*
>(
f.Get(
"hE1E2_emu_run2_rel21_v0"));
674 else if(
"layer2_alt_run2_r21_v1"==
tune) {
676 TFile
f(
file.c_str());
677 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2_mu_run2_rel21_v1"));
681 else if(
"layer2_alt_run2_r21_v0"==
tune) {
683 TFile
f(
file.c_str());
684 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_rel21_v1"));
688 else if(
"layer2_alt_run2_v1" ==
tune) {
690 TFile
f(
file.c_str());
691 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2mu_2016_v1"));
695 else if(
"layer2_alt_2012_v5" ==
tune) {
697 TFile
f(
file.c_str());
698 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2012"));
702 else if(
"layer2_2012_v5" ==
tune) {
704 TFile
f(
file.c_str());
705 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
709 else if(
"layer2_2012_v5_down" ==
tune) {
711 TFile
f(
file.c_str());
712 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
716 else if(
"layer2_2012_v5_up" ==
tune) {
718 TFile
f(
file.c_str());
719 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
723 else if (
"layer2_2012_v5_errdown" ==
tune) {
725 TFile
f(
file.c_str());
726 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
730 else if (
"layer2_2012_v5_errup" ==
tune) {
732 TFile
f(
file.c_str());
733 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2012"));
737 else if(
"layer2_alt_2011_v5" ==
tune) {
739 TFile
f(
file.c_str());
740 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_alt_2011"));
744 else if(
"layer2_2011_v5" ==
tune) {
746 TFile
f(
file.c_str());
747 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
751 else if(
"layer2_2011_v5_down" ==
tune) {
753 TFile
f(
file.c_str());
754 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
758 else if(
"layer2_2011_v5_up" ==
tune) {
760 TFile
f(
file.c_str());
761 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
765 else if (
"layer2_2011_v5_errdown" ==
tune) {
767 TFile
f(
file.c_str());
768 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
772 else if (
"layer2_2011_v5_errup" ==
tune) {
774 TFile
f(
file.c_str());
775 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2011"));
779 else if(
"layer2_2010_v5" ==
tune) {
781 TFile
f(
file.c_str());
782 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
786 else if(
"layer2_2010_v5_down" ==
tune) {
788 TFile
f(
file.c_str());
789 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
793 else if(
"layer2_2010_v5_up" ==
tune) {
795 TFile
f(
file.c_str());
796 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
800 else if (
"layer2_2010_v5_errdown" ==
tune) {
802 TFile
f(
file.c_str());
803 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
807 else if (
"layer2_2010_v5_errup" ==
tune) {
809 TFile
f(
file.c_str());
810 TH1*
histo = checked_cast<TH1*>(
f.Get(
"hE1E2ave_2010"));
814 else if (
"ps_2016_r21_v0" ==
tune) {
816 TFile
f(
file.c_str());
817 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016_rel21"));
821 else if (
"ps_mu_r21_v0" ==
tune) {
823 TFile
f(
file.c_str());
824 TH1F* histo_ps_tot_error =
static_cast<TH1F*
>(
f.Get(
"hPS_MuonLowMu_rel21"));
825 assert(histo_ps_tot_error);
829 else if (
"ps_2016_v1" ==
tune) {
831 TFile
f(
file.c_str());
832 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2016"));
836 else if (
"ps_2012_v3" ==
tune) {
838 TFile
f(
file.c_str());
839 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
843 else if (
"ps_2012_v3_down" ==
tune) {
845 TFile
f(
file.c_str());
846 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
850 else if (
"ps_2012_v3_up" ==
tune){
852 TFile
f(
file.c_str());
853 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
857 else if (
"ps_2012_v3_errdown" ==
tune){
859 TFile
f(
file.c_str());
860 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
864 else if (
"ps_2012_v3_errup" ==
tune){
866 TFile
f(
file.c_str());
867 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2012"));
871 else if (
"ps_2011_v3" ==
tune) {
873 TFile
f(
file.c_str());
874 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
878 else if (
"ps_2011_v3_down" ==
tune) {
880 TFile
f(
file.c_str());
881 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
885 else if (
"ps_2011_v3_up" ==
tune){
887 TFile
f(
file.c_str());
888 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
892 else if (
"ps_2011_v3_errdown" ==
tune){
894 TFile
f(
file.c_str());
895 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
899 else if (
"ps_2011_v3_errup" ==
tune){
901 TFile
f(
file.c_str());
902 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2011"));
907 else if (
"ps_2010_v3" ==
tune) {
909 TFile
f(
file.c_str());
910 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
914 else if (
"ps_2010_v3_down" ==
tune) {
916 TFile
f(
file.c_str());
917 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
921 else if (
"ps_2010_v3_up" ==
tune) {
923 TFile
f(
file.c_str());
924 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
928 else if (
"ps_2010_v3_errdown" ==
tune){
930 TFile
f(
file.c_str());
931 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
935 else if (
"ps_2010_v3_errup" ==
tune){
937 TFile
f(
file.c_str());
938 TH1* histo_ps_tot_error = checked_cast<TH1*>(
f.Get(
"hPS_2010"));
943 throw std::runtime_error(
tune+
" is not a valid tune");
948 :
asg::AsgMessaging(
name), m_tune(
tune), m_doSaccCorrections(SaccEnable)
985 std::string fixT =
"";
986 double addE2 = 0, addE3 = 0;
989 fixT =
"_egFixForTopoTimingCut";
990 unsigned short stat =
994 " but some layer info is not available,"
995 " from L2 : " <<
stat%2 <<
" from L3 : " <<
stat/2);
1002 eta_calo = cluster->eta();
1008 eta_calo = accEtaCalo(*cluster);
1011 ATH_MSG_ERROR(
"etaCalo not available as auxilliary variable,"
1012 " using cluster eta as eta calo!");
1013 eta_calo=cluster->eta();
1021 cluster->energyBE(0),
1022 cluster->energyBE(1),
1023 cluster->energyBE(2) + addE2,
1024 cluster->energyBE(3) + addE3,
1037 deco_layer_correction(
"layer_correction");
1040 ATH_MSG_DEBUG(
"decorating cluster with corrected layer energies");
1042 inputs.E0raw : cluster->energyBE(0);
1044 inputs.E1raw : cluster->energyBE(1);
1046 inputs.E2raw : cluster->energyBE(2) + addE2;
1048 inputs.E3raw : cluster->energyBE(3) + addE3;
1049 deco_layer_correction(*cluster) = isData ?
m_tune+fixT : fixT;
1054 " decorating particle with non-corrected layer energies");
1059 deco_E0(*cluster) = cluster->energyBE(0);
1060 deco_E1(*cluster) = cluster->energyBE(1);
1061 deco_E2(*cluster) = cluster->energyBE(2) + addE2;
1062 deco_E3(*cluster) = cluster->energyBE(3) + addE3;
1063 deco_layer_correction(*cluster) = isData ?
m_tune +
"_Err" + fixT : fixT;
1080 std::map<std::string, std::string>
parse(
const std::string&
list)
1082 std::cout <<
"list: '" <<
list <<
"'" << std::endl;
1083 std::map<std::string, std::string>
result;
1085 while (TObjString* sObj = (TObjString*)
next())
1087 const TString&
item(sObj->GetString());
1088 std::cout <<
"item: '" <<
item <<
"'" << std::endl;
1089 TObjArray* item_list = TString(
item).Tokenize(
":");
1092 if (item_list->GetEntries() == 1) {
1094 value =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1096 else if (item_list->GetEntries() == 2) {
1097 key =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1098 value =
static_cast<TObjString*
>(item_list->At(1))->GetString().Data();
1101 std::cerr <<
"invalid string " <<
item << std::endl;
1104 std::cerr <<
"trying to insert two times key " <<
key << std::endl;
1113 std::pair<std::string, egammaLayerRecalibTool*>
1116 std::map<std::string, std::string> args_map =
parse(
args);
1118 std::string
name =
"";
1119 std::string amount_name =
"";
1120 std::string type_name =
"";
1125 if (args_map.find(
"amount") != args_map.end()) {
1126 std::string amount_str = args_map[
"amount"];
1128 if (amount_str.back()==
'%') {
1130 amount_str.pop_back();
1132 const float amount = TString(amount_str).Atof() * (
perc ? 0.01 : 1);
1135 std::stringstream amount_stream;
1136 amount_stream << amount;
1137 amount_name = amount_stream.str();
1138 std::replace(amount_name.begin(), amount_name.end(),
'-',
'n');
1139 std::replace(amount_name.begin(), amount_name.end(),
'.',
'p');
1141 else if (args_map.find(
"name") != args_map.end()) {
1142 name = args_map[
"name"];
1144 else if (args_map.find(
"histo") != args_map.end()) {
1146 if (args_map.find(
"file") == args_map.end()) {
1147 std::cerr <<
"with histo you must specify file" << std::endl;
1150 if (args_map.find(
"formulax") != args_map.end())
dim = 1;
1154 std::cerr <<
"with histo you must specify formulax" << std::endl;
1158 TFile
f(args_map[
"file"].c_str());
1159 std::cout <<
"opening histo " << args_map[
"histo"] <<
" from file " << args_map[
"file"] << std::endl;
1160 TH1F*
histo =
dynamic_cast<TH1F*
>(
f.Get(args_map[
"histo"].c_str()));
1163 histo->SetDirectory(
nullptr);
1166 else{assert(
false); }
1168 else { assert(
false); }
1171 std::cerr <<
"cannot understand argument " <<
args << std::endl;
1183 if (not type_name.empty() and not amount_name.empty()) {
1184 name = type_name +
"_" + amount_name;
1188 std::cerr <<
"you need to specify a name for the bias with type " <<
type << std::endl;
1199 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.