22 #include <boost/algorithm/string.hpp>
35 asg::AsgTool(
"top::EventSaverFlatNtuple"),
37 m_sfRetriever(nullptr),
38 m_outputFile(nullptr),
39 m_truthTreeManager(nullptr),
40 m_particleLevelTreeManager(nullptr),
43 m_weight_beamspot(0.),
47 m_weight_fwdElSF_FWDEL_SF_ID_UP(0.),
48 m_weight_fwdElSF_FWDEL_SF_ID_DOWN(0.),
51 m_weight_leptonSF(0.),
53 m_weight_leptonSF_EL_SF_Reco_UP(0.),
54 m_weight_leptonSF_EL_SF_Reco_DOWN(0.),
55 m_weight_leptonSF_EL_SF_ID_UP(0.),
56 m_weight_leptonSF_EL_SF_ID_DOWN(0.),
57 m_weight_leptonSF_EL_SF_Isol_UP(0.),
58 m_weight_leptonSF_EL_SF_Isol_DOWN(0.),
61 m_weight_leptonSF_MU_SF_ID_STAT_UP(0.),
62 m_weight_leptonSF_MU_SF_ID_STAT_DOWN(0.),
63 m_weight_leptonSF_MU_SF_ID_SYST_UP(0.),
64 m_weight_leptonSF_MU_SF_ID_SYST_DOWN(0.),
66 m_weight_leptonSF_MU_SF_ID_STAT_LOWPT_UP(0.),
67 m_weight_leptonSF_MU_SF_ID_STAT_LOWPT_DOWN(0.),
68 m_weight_leptonSF_MU_SF_ID_SYST_LOWPT_UP(0.),
69 m_weight_leptonSF_MU_SF_ID_SYST_LOWPT_DOWN(0.),
70 m_weight_leptonSF_MU_SF_ID_BKG_FRACTION_UP(0.),
71 m_weight_leptonSF_MU_SF_ID_BKG_FRACTION_DOWN(0.),
72 m_weight_leptonSF_MU_SF_ID_FIT_MODEL_LOWPT_UP(0.),
73 m_weight_leptonSF_MU_SF_ID_FIT_MODEL_LOWPT_DOWN(0.),
74 m_weight_leptonSF_MU_SF_ID_LUMI_UNCERT_UP(0.),
75 m_weight_leptonSF_MU_SF_ID_LUMI_UNCERT_DOWN(0.),
76 m_weight_leptonSF_MU_SF_ID_MATCHING_UP(0.),
77 m_weight_leptonSF_MU_SF_ID_MATCHING_DOWN(0.),
78 m_weight_leptonSF_MU_SF_ID_MATCHING_LOWPT_UP(0.),
79 m_weight_leptonSF_MU_SF_ID_MATCHING_LOWPT_DOWN(0.),
80 m_weight_leptonSF_MU_SF_ID_MC_XSEC_UP(0.),
81 m_weight_leptonSF_MU_SF_ID_MC_XSEC_DOWN(0.),
82 m_weight_leptonSF_MU_SF_ID_PT_DEPENDENCY_UP(0.),
83 m_weight_leptonSF_MU_SF_ID_PT_DEPENDENCY_DOWN(0.),
84 m_weight_leptonSF_MU_SF_ID_QCD_TEMPLATE_UP(0.),
85 m_weight_leptonSF_MU_SF_ID_QCD_TEMPLATE_DOWN(0.),
86 m_weight_leptonSF_MU_SF_ID_SUPRESSION_SCALE_UP(0.),
87 m_weight_leptonSF_MU_SF_ID_SUPRESSION_SCALE_DOWN(0.),
88 m_weight_leptonSF_MU_SF_ID_TRUTH_UP(0.),
89 m_weight_leptonSF_MU_SF_ID_TRUTH_DOWN(0.),
90 m_weight_leptonSF_MU_SF_ID_TRUTH_LOWPT_UP(0.),
91 m_weight_leptonSF_MU_SF_ID_TRUTH_LOWPT_DOWN(0.),
92 m_weight_leptonSF_MU_SF_ID_BAD_MUON_VETO_UP(0.),
93 m_weight_leptonSF_MU_SF_ID_BAD_MUON_VETO_DOWN(0.),
94 m_weight_leptonSF_MU_SF_ID_CR1_UP(0.),
95 m_weight_leptonSF_MU_SF_ID_CR1_DOWN(0.),
96 m_weight_leptonSF_MU_SF_ID_CR2_UP(0.),
97 m_weight_leptonSF_MU_SF_ID_CR2_DOWN(0.),
98 m_weight_leptonSF_MU_SF_ID_CR3_UP(0.),
99 m_weight_leptonSF_MU_SF_ID_CR3_DOWN(0.),
100 m_weight_leptonSF_MU_SF_ID_HIGHETA_PROBEIP_UP(0.),
101 m_weight_leptonSF_MU_SF_ID_HIGHETA_PROBEIP_DOWN(0.),
102 m_weight_leptonSF_MU_SF_ID_HIGHETA_PROBEISO_UP(0.),
103 m_weight_leptonSF_MU_SF_ID_HIGHETA_PROBEISO_DOWN(0.),
104 m_weight_leptonSF_MU_SF_ID_TAGPT_UP(0.),
105 m_weight_leptonSF_MU_SF_ID_TAGPT_DOWN(0.),
106 m_weight_leptonSF_MU_SF_ID_EXTRAPOLATION_UP(0.),
107 m_weight_leptonSF_MU_SF_ID_EXTRAPOLATION_DOWN(0.),
108 m_weight_leptonSF_MU_SF_ID_EXTRAPOLATION_LOWPT_UP(0.),
109 m_weight_leptonSF_MU_SF_ID_EXTRAPOLATION_LOWPT_DOWN(0.),
112 m_weight_leptonSF_MU_SF_Isol_STAT_UP(0.),
113 m_weight_leptonSF_MU_SF_Isol_STAT_DOWN(0.),
114 m_weight_leptonSF_MU_SF_Isol_SYST_UP(0.),
115 m_weight_leptonSF_MU_SF_Isol_SYST_DOWN(0.),
116 m_weight_leptonSF_MU_SF_Isol_BKG_FRACTION_UP(0.),
117 m_weight_leptonSF_MU_SF_Isol_BKG_FRACTION_DOWN(0.),
118 m_weight_leptonSF_MU_SF_Isol_DRMUJ_UP(0.),
119 m_weight_leptonSF_MU_SF_Isol_DRMUJ_DOWN(0.),
120 m_weight_leptonSF_MU_SF_Isol_LUMI_UNCERT_UP(0.),
121 m_weight_leptonSF_MU_SF_Isol_LUMI_UNCERT_DOWN(0.),
122 m_weight_leptonSF_MU_SF_Isol_MC_XSEC_UP(0.),
123 m_weight_leptonSF_MU_SF_Isol_MC_XSEC_DOWN(0.),
124 m_weight_leptonSF_MU_SF_Isol_MLLWINDOW_UP(0.),
125 m_weight_leptonSF_MU_SF_Isol_MLLWINDOW_DOWN(0.),
126 m_weight_leptonSF_MU_SF_Isol_QCD_TEMPLATE_UP(0.),
127 m_weight_leptonSF_MU_SF_Isol_QCD_TEMPLATE_DOWN(0.),
128 m_weight_leptonSF_MU_SF_Isol_SHERPA_POWHEG_UP(0.),
129 m_weight_leptonSF_MU_SF_Isol_SHERPA_POWHEG_DOWN(0.),
130 m_weight_leptonSF_MU_SF_Isol_SUPRESSION_SCALE_UP(0.),
131 m_weight_leptonSF_MU_SF_Isol_SUPRESSION_SCALE_DOWN(0.),
132 m_weight_leptonSF_MU_SF_Isol_EXTRAPOLATION_UP(0.),
133 m_weight_leptonSF_MU_SF_Isol_EXTRAPOLATION_DOWN(0.),
135 m_weight_leptonSF_MU_SF_TTVA_STAT_UP(0.),
136 m_weight_leptonSF_MU_SF_TTVA_STAT_DOWN(0.),
137 m_weight_leptonSF_MU_SF_TTVA_SYST_UP(0.),
138 m_weight_leptonSF_MU_SF_TTVA_SYST_DOWN(0.),
139 m_weight_leptonSF_MU_SF_TTVA_BKG_FRACTION_UP(0.),
140 m_weight_leptonSF_MU_SF_TTVA_BKG_FRACTION_DOWN(0.),
141 m_weight_leptonSF_MU_SF_TTVA_LUMI_UNCERT_UP(0.),
142 m_weight_leptonSF_MU_SF_TTVA_LUMI_UNCERT_DOWN(0.),
143 m_weight_leptonSF_MU_SF_TTVA_MC_XSEC_UP(0.),
144 m_weight_leptonSF_MU_SF_TTVA_MC_XSEC_DOWN(0.),
145 m_weight_leptonSF_MU_SF_TTVA_QCD_TEMPLATE_UP(0.),
146 m_weight_leptonSF_MU_SF_TTVA_QCD_TEMPLATE_DOWN(0.),
147 m_weight_leptonSF_MU_SF_TTVA_SUPRESSION_SCALE_UP(0.),
148 m_weight_leptonSF_MU_SF_TTVA_SUPRESSION_SCALE_DOWN(0.),
149 m_weight_leptonSF_MU_SF_TTVA_EXTRAPOLATION_UP(0.),
150 m_weight_leptonSF_MU_SF_TTVA_EXTRAPOLATION_DOWN(0.),
153 m_weight_trigger(0.),
154 m_weight_trigger_EL_SF_UP(0.),
155 m_weight_trigger_EL_SF_DOWN(0.),
156 m_weight_trigger_MU_SF_STAT_UP(0.),
157 m_weight_trigger_MU_SF_STAT_DOWN(0.),
158 m_weight_trigger_MU_SF_SYST_UP(0.),
159 m_weight_trigger_MU_SF_SYST_DOWN(0.),
160 m_weight_trigger_PH_UNCERT_UP(0.),
161 m_weight_trigger_PH_UNCERT_DOWN(0.),
163 m_ASMdecorName(
"ASM_weight"),
168 m_randomRunNumber(0),
169 m_mcChannelNumber(0),
173 m_mu_actual_original(0.),
176 m_backgroundFlags(0),
179 m_makeVarRCJets(false),
181 m_useRCAdditionalJSS(false),
182 m_useVarRCJSS(false),
183 m_useVarRCAdditionalJSS(false),
193 m_met_met_withLooseObjects(0.),
194 m_met_phi_withLooseObjects(0.) {
239 const std::vector<std::string>& extraBranches) {
247 std::placeholders::_2));
250 if (
config->useRCJets()) {
257 if (
config->useVarRCJets()) {
273 std::string nominalTTreeName(
"SetMe"), nominalLooseTTreeName(
"SetMe");
279 outputFileNEventAutoFlush(),
281 outputFileBasketSizePrimitive(),
283 outputFileBasketSizeVector())));
298 outputFileNEventAutoFlush(),
299 m_config->outputFileBasketSizePrimitive(),
301 outputFileBasketSizeVector())));
304 nominalLooseTTreeName =
treeName.second +
"_Loose";
312 if (asg::ToolStore::contains<ScaleFactorRetriever>(
"top::ScaleFactorRetriever")) {
313 m_sfRetriever = asg::ToolStore::get<ScaleFactorRetriever>(
"top::ScaleFactorRetriever");
323 m_config->outputFileBasketSizePrimitive(),
324 m_config->outputFileBasketSizeVector()));
352 if (
m_config->doTruthPDFInfoInNominalTrees()) {
354 if (systematicTree->name() == nominalTTreeName || systematicTree->name() == nominalLooseTTreeName) {
355 systematicTree->makeOutputVariable(
m_PDFinfo_X1,
"PDFinfo_X1");
356 systematicTree->makeOutputVariable(
m_PDFinfo_X2,
"PDFinfo_X2");
359 systematicTree->makeOutputVariable(
m_PDFinfo_Q,
"PDFinfo_Q");
360 systematicTree->makeOutputVariable(
m_PDFinfo_XF1,
"PDFinfo_XF1");
361 systematicTree->makeOutputVariable(
m_PDFinfo_XF2,
"PDFinfo_XF2");
376 if (
m_config->doMCGeneratorWeights()) {
377 if (
m_config->doMCGeneratorWeightsInNominalTrees()) {
380 if (systematicTree->name() == nominalTTreeName || systematicTree->name() == nominalLooseTTreeName) {
390 for (
const auto& pdfset :
m_config->LHAPDFSets())
394 if (
m_config->doLHAPDFInNominalTrees()) {
397 if (systematicTree->name() == nominalTTreeName ||
398 systematicTree->name() ==
399 nominalLooseTTreeName) systematicTree->makeOutputVariable(
pdf.second,
pdf.first);
409 for (
const std::pair<std::string, std::string>& taggerName :
m_config->boostedJetTaggers())
411 for (
const std::pair<const std::string, std::string>& taggerSF :
m_config->boostedTaggerSFnames())
416 for (
const auto& algo_tool :
m_config->bTagAlgos()) {
417 const std::string& algo = algo_tool.first;
428 for (
const auto& algo_tool :
m_config->bTagAlgos_trkJet()) {
429 const std::string& algo = algo_tool.first;
441 systematicTree->makeOutputVariable(
m_weight_mc,
"weight_mc");
457 for (
const std::string& tagWP :
m_config->bTagWP_calib()) {
471 if ((systematicTree->name() != nominalTTreeName) && (systematicTree->name() != nominalLooseTTreeName) && !(
m_config->dumpBtagSystsInSystTrees()))
continue;
473 tagWP) +
"_eigenvars_B_up");
475 tagWP) +
"_eigenvars_B_down");
477 tagWP) +
"_eigenvars_C_up");
479 tagWP) +
"_eigenvars_C_down");
481 tagWP) +
"_eigenvars_Light_up");
483 tagWP) +
"_eigenvars_Light_down");
484 for (
const std::string&
name :
m_config->btagging_namedSysts(tagWP)) {
493 for (
const std::string& tagWP :
m_config->bTagWP_calib_trkJet()) {
508 if ((systematicTree->name() != nominalTTreeName) && (systematicTree->name() != nominalLooseTTreeName) && !(
m_config->dumpBtagSystsInSystTrees()))
continue;
510 tagWP) +
"_eigenvars_B_up");
512 tagWP) +
"_eigenvars_B_down");
514 tagWP) +
"_eigenvars_C_up");
516 tagWP) +
"_eigenvars_C_down");
518 tagWP) +
"_eigenvars_Light_up");
520 tagWP) +
"_eigenvars_Light_down");
521 for (
const std::string&
name :
m_config->trkjet_btagging_namedSysts(tagWP)) {
532 systematicTree->makeOutputVariable(
m_weight_jvt,
"weight_jvt");
536 "weight_sherpa_22_vjets");
538 if (systematicTree->name() == nominalTTreeName || systematicTree->name() == nominalLooseTTreeName) {
556 if (
m_config->electronEfficiencySystematicModel() !=
"TOTAL") {
558 "weight_leptonSF_EL_SF_" +
m_config->electronEfficiencySystematicModel() +
561 "weight_leptonSF_EL_SF_" +
m_config->electronEfficiencySystematicModel() +
564 "weight_leptonSF_EL_SF_" +
m_config->electronEfficiencySystematicModel() +
567 "weight_leptonSF_EL_SF_" +
m_config->electronEfficiencySystematicModel() +
570 "weight_leptonSF_EL_SF_" +
m_config->electronEfficiencySystematicModel() +
573 "weight_leptonSF_EL_SF_" +
m_config->electronEfficiencySystematicModel() +
578 "weight_trigger_MU_SF_STAT_UP");
580 "weight_trigger_MU_SF_STAT_DOWN");
582 "weight_trigger_MU_SF_SYST_UP");
584 "weight_trigger_MU_SF_SYST_DOWN");
588 "weight_leptonSF_MU_SF_ID_STAT_DOWN");
590 "weight_leptonSF_MU_SF_ID_STAT_LOWPT_UP");
592 "weight_leptonSF_MU_SF_ID_STAT_LOWPT_DOWN");
593 if (
m_config->muonBreakDownSystematics()) {
595 "weight_leptonSF_MU_SF_ID_BKG_FRACTION_UP");
597 "weight_leptonSF_MU_SF_ID_BKG_FRACTION_DOWN");
599 "weight_leptonSF_MU_SF_ID_FIT_MODEL_LOWPT_UP");
601 "weight_leptonSF_MU_SF_ID_FIT_MODEL_LOWPT_DOWN");
603 "weight_leptonSF_MU_SF_ID_LUMI_UNCERT_UP");
605 "weight_leptonSF_MU_SF_ID_LUMI_UNCERT_DOWN");
607 "weight_leptonSF_MU_SF_ID_MATCHING_UP");
609 "weight_leptonSF_MU_SF_ID_MATCHING_DOWN");
611 "weight_leptonSF_MU_SF_ID_MATCHING_LOWPT_UP");
613 "weight_leptonSF_MU_SF_ID_MATCHING_LOWPT_DOWN");
615 "weight_leptonSF_MU_SF_ID_MC_XSEC_UP");
617 "weight_leptonSF_MU_SF_ID_MC_XSEC_DOWN");
619 "weight_leptonSF_MU_SF_ID_PT_DEPENDENCY_UP");
621 "weight_leptonSF_MU_SF_ID_PT_DEPENDENCY_DOWN");
623 "weight_leptonSF_MU_SF_ID_QCD_TEMPLATE_UP");
625 "weight_leptonSF_MU_SF_ID_QCD_TEMPLATE_DOWN");
627 "weight_leptonSF_MU_SF_ID_SUPRESSION_SCALE_UP");
629 "weight_leptonSF_MU_SF_ID_SUPRESSION_SCALE_DOWN");
631 "weight_leptonSF_MU_SF_ID_TRUTH_UP");
633 "weight_leptonSF_MU_SF_ID_TRUTH_DOWN");
635 "weight_leptonSF_MU_SF_ID_TRUTH_LOWPT_UP");
637 "weight_leptonSF_MU_SF_ID_TRUTH_LOWPT_DOWN");
639 "weight_leptonSF_MU_SF_ID_CR1_UP");
641 "weight_leptonSF_MU_SF_ID_CR1_DOWN");
643 "weight_leptonSF_MU_SF_ID_CR2_UP");
645 "weight_leptonSF_MU_SF_ID_CR2_DOWN");
647 "weight_leptonSF_MU_SF_ID_CR3_UP");
649 "weight_leptonSF_MU_SF_ID_CR3_DOWN");
651 "weight_leptonSF_MU_SF_ID_HIGHETA_PROBEIP_UP");
653 "weight_leptonSF_MU_SF_ID_HIGHETA_PROBEIP_DOWN");
655 "weight_leptonSF_MU_SF_ID_HIGHETA_PROBEISO_UP");
657 "weight_leptonSF_MU_SF_ID_HIGHETA_PROBEISO_DOWN");
659 "weight_leptonSF_MU_SF_ID_TAGPT_UP");
661 "weight_leptonSF_MU_SF_ID_TAGPT_DOWN");
663 "weight_leptonSF_MU_SF_ID_EXTRAPOLATION_UP");
665 "weight_leptonSF_MU_SF_ID_EXTRAPOLATION_DOWN");
667 "weight_leptonSF_MU_SF_ID_EXTRAPOLATION_LOWPT_UP");
669 "weight_leptonSF_MU_SF_ID_EXTRAPOLATION_LOWPT_DOWN");
672 "weight_leptonSF_MU_SF_ID_SYST_LOWPT_UP");
674 "weight_leptonSF_MU_SF_ID_SYST_LOWPT_DOWN");
677 "weight_leptonSF_MU_SF_ID_SYST_DOWN");
679 if (systematicTree->name() == nominalTTreeName &&
m_config->muonQuality() ==
"HighPt") {
681 "weight_leptonSF_MU_SF_ID_BAD_MUON_VETO_UP");
683 "weight_leptonSF_MU_SF_ID_BAD_MUON_VETO_DOWN");
685 if (systematicTree->name() == nominalLooseTTreeName &&
m_config->muonQualityLoose() ==
"HighPt") {
687 "weight_leptonSF_MU_SF_ID_BAD_MUON_VETO_UP");
689 "weight_leptonSF_MU_SF_ID_BAD_MUON_VETO_DOWN");
693 "weight_leptonSF_MU_SF_Isol_STAT_UP");
695 "weight_leptonSF_MU_SF_Isol_STAT_DOWN");
697 "weight_leptonSF_MU_SF_TTVA_STAT_UP");
699 "weight_leptonSF_MU_SF_TTVA_STAT_DOWN");
700 if (
m_config->muonBreakDownSystematics()) {
703 "weight_leptonSF_MU_SF_Isol_BKG_FRACTION_UP");
705 "weight_leptonSF_MU_SF_Isol_BKG_FRACTION_DOWN");
707 "weight_leptonSF_MU_SF_Isol_DRMUJ_UP");
709 "weight_leptonSF_MU_SF_Isol_DRMUJ_DOWN");
711 "weight_leptonSF_MU_SF_Isol_LUMI_UNCERT_UP");
713 "weight_leptonSF_MU_SF_Isol_LUMI_UNCERT_DOWN");
715 "weight_leptonSF_MU_SF_Isol_MC_XSEC_UP");
717 "weight_leptonSF_MU_SF_Isol_MC_XSEC_DOWN");
719 "weight_leptonSF_MU_SF_Isol_MLLWINDOW_UP");
721 "weight_leptonSF_MU_SF_Isol_MLLWINDOW_DOWN");
723 "weight_leptonSF_MU_SF_Isol_QCD_TEMPLATE_UP");
725 "weight_leptonSF_MU_SF_Isol_QCD_TEMPLATE_DOWN");
727 "weight_leptonSF_MU_SF_Isol_SHERPA_POWHEG_UP");
729 "weight_leptonSF_MU_SF_Isol_SHERPA_POWHEG_DOWN");
731 "weight_leptonSF_MU_SF_Isol_SUPRESSION_SCALE_UP");
733 "weight_leptonSF_MU_SF_Isol_SUPRESSION_SCALE_DOWN");
735 "weight_leptonSF_MU_SF_Isol_EXTRAPOLATION_UP");
737 "weight_leptonSF_MU_SF_Isol_EXTRAPOLATION_DOWN");
740 "weight_leptonSF_MU_SF_TTVA_BKG_FRACTION_UP");
742 "weight_leptonSF_MU_SF_TTVA_BKG_FRACTION_DOWN");
744 "weight_leptonSF_MU_SF_TTVA_LUMI_UNCERT_UP");
746 "weight_leptonSF_MU_SF_TTVA_LUMI_UNCERT_DOWN");
748 "weight_leptonSF_MU_SF_TTVA_MC_XSEC_UP");
750 "weight_leptonSF_MU_SF_TTVA_MC_XSEC_DOWN");
752 "weight_leptonSF_MU_SF_TTVA_QCD_TEMPLATE_UP");
754 "weight_leptonSF_MU_SF_TTVA_QCD_TEMPLATE_DOWN");
756 "weight_leptonSF_MU_SF_TTVA_SUPRESSION_SCALE_UP");
758 "weight_leptonSF_MU_SF_TTVA_SUPRESSION_SCALE_DOWN");
760 "weight_leptonSF_MU_SF_TTVA_EXTRAPOLATION_UP");
762 "weight_leptonSF_MU_SF_TTVA_EXTRAPOLATION_DOWN");
765 "weight_leptonSF_MU_SF_Isol_SYST_UP");
767 "weight_leptonSF_MU_SF_Isol_SYST_DOWN");
769 "weight_leptonSF_MU_SF_TTVA_SYST_UP");
771 "weight_leptonSF_MU_SF_TTVA_SYST_DOWN");
787 "weight_photonSF_ID_UP");
789 "weight_photonSF_ID_DOWN");
791 "weight_photonSF_effIso_UP");
793 "weight_photonSF_effIso_DOWN");
795 "weight_trigger_PH_UNCERT_UP");
797 "weight_trigger_PH_UNCERT_DOWN");
802 if (
m_config->getfJVTWP() !=
"None") {
809 if (systematicTree->name() == nominalTTreeName || systematicTree->name() == nominalLooseTTreeName ||
810 m_config->dumpBtagSystsInSystTrees()) {
812 for (
const std::string& tagWP :
m_config->bTagWP_calib()) {
815 tagWP) +
"_eigenvars_B_up");
817 tagWP) +
"_eigenvars_C_up");
819 "weight_bTagSF_" +
shortBtagWP(tagWP) +
"_eigenvars_Light_up");
822 tagWP) +
"_eigenvars_B_down");
824 tagWP) +
"_eigenvars_C_down");
826 "weight_bTagSF_" +
shortBtagWP(tagWP) +
"_eigenvars_Light_down");
828 for (
const auto&
name :
m_config->btagging_namedSysts(tagWP)) {
837 for (
const std::string& tagWP :
m_config->bTagWP_calib_trkJet()) {
840 tagWP) +
"_eigenvars_B_up");
842 tagWP) +
"_eigenvars_C_up");
844 tagWP) +
"_eigenvars_Light_up");
847 tagWP) +
"_eigenvars_B_down");
849 tagWP) +
"_eigenvars_C_down");
851 tagWP) +
"_eigenvars_Light_down");
853 for (
const auto&
name :
m_config->trkjet_btagging_namedSysts(tagWP)) {
865 if (!
m_config->isMC() && systematicTree->name() == nominalLooseTTreeName &&
m_config->doFakesMMWeightsIFF()) {
870 if (
m_config->saveBootstrapWeights()) {
875 systematicTree->makeOutputVariable(
m_eventNumber,
"eventNumber");
876 systematicTree->makeOutputVariable(
m_runNumber,
"runNumber");
880 systematicTree->makeOutputVariable(
m_mu,
"mu");
881 systematicTree->makeOutputVariable(
m_mu_actual,
"mu_actual");
883 systematicTree->makeOutputVariable(
m_mu_original,
"mu_original_xAOD");
891 systematicTree->makeOutputVariable(
m_el_pt,
"el_pt");
892 systematicTree->makeOutputVariable(
m_el_eta,
"el_eta");
893 systematicTree->makeOutputVariable(
m_el_cl_eta,
"el_cl_eta");
894 systematicTree->makeOutputVariable(
m_el_phi,
"el_phi");
895 systematicTree->makeOutputVariable(
m_el_e,
"el_e");
896 systematicTree->makeOutputVariable(
m_el_charge,
"el_charge");
899 if (systematicTree->name().find(
"Loose") != std::string::npos) {
900 systematicTree->makeOutputVariable(
m_el_isTight,
"el_isTight");
902 systematicTree->makeOutputVariable(
m_el_CF,
"el_CF");
903 systematicTree->makeOutputVariable(
m_el_d0sig,
"el_d0sig");
906 systematicTree->makeOutputVariable(
m_el_true_type,
"el_true_type");
914 if (
m_config->enablePromptLeptonImprovedVetoStudies()) {
935 systematicTree->makeOutputVariable(
m_fwdel_pt,
"fwdel_pt");
936 systematicTree->makeOutputVariable(
m_fwdel_eta,
"fwdel_eta");
937 systematicTree->makeOutputVariable(
m_fwdel_phi,
"fwdel_phi");
938 systematicTree->makeOutputVariable(
m_fwdel_e,
"fwdel_e");
942 if (systematicTree->name().find(
"Loose") != std::string::npos) {
949 systematicTree->makeOutputVariable(
m_mu_pt,
"mu_pt");
950 systematicTree->makeOutputVariable(
m_mu_eta,
"mu_eta");
951 systematicTree->makeOutputVariable(
m_mu_phi,
"mu_phi");
952 systematicTree->makeOutputVariable(
m_mu_e,
"mu_e");
953 systematicTree->makeOutputVariable(
m_mu_charge,
"mu_charge");
956 if (systematicTree->name().find(
"Loose") != std::string::npos) {
957 systematicTree->makeOutputVariable(
m_mu_isTight,
"mu_isTight");
959 systematicTree->makeOutputVariable(
m_mu_d0sig,
"mu_d0sig");
962 systematicTree->makeOutputVariable(
m_mu_true_type,
"mu_true_type");
966 if (
m_config->enablePromptLeptonImprovedVetoStudies()) {
983 systematicTree->makeOutputVariable(
m_softmu_pt,
"softmu_pt");
984 systematicTree->makeOutputVariable(
m_softmu_eta,
"softmu_eta");
985 systematicTree->makeOutputVariable(
m_softmu_phi,
"softmu_phi");
986 systematicTree->makeOutputVariable(
m_softmu_e,
"softmu_e");
988 systematicTree->makeOutputVariable(
m_softmu_d0,
"softmu_d0");
989 systematicTree->makeOutputVariable(
m_softmu_d0sig,
"softmu_d0sig");
994 systematicTree->makeOutputVariable(
m_softmu_SF_ID,
"softmu_SF_ID");
996 if (systematicTree->name() == nominalTTreeName || systematicTree->name() == nominalLooseTTreeName) {
1006 if(
m_config->softmuonAdditionalTruthInfo())
1019 systematicTree->makeOutputVariable(
m_ph_pt,
"ph_pt");
1020 systematicTree->makeOutputVariable(
m_ph_eta,
"ph_eta");
1021 systematicTree->makeOutputVariable(
m_ph_phi,
"ph_phi");
1022 systematicTree->makeOutputVariable(
m_ph_e,
"ph_e");
1023 systematicTree->makeOutputVariable(
m_ph_iso,
"ph_iso");
1028 systematicTree->makeOutputVariable(
m_tau_pt,
"tau_pt");
1029 systematicTree->makeOutputVariable(
m_tau_eta,
"tau_eta");
1030 systematicTree->makeOutputVariable(
m_tau_phi,
"tau_phi");
1031 systematicTree->makeOutputVariable(
m_tau_e,
"tau_e");
1032 systematicTree->makeOutputVariable(
m_tau_charge,
"tau_charge");
1037 systematicTree->makeOutputVariable(
m_jet_pt,
"jet_pt");
1038 systematicTree->makeOutputVariable(
m_jet_eta,
"jet_eta");
1039 systematicTree->makeOutputVariable(
m_jet_phi,
"jet_phi");
1040 systematicTree->makeOutputVariable(
m_jet_e,
"jet_e");
1041 systematicTree->makeOutputVariable(
m_jet_jvt,
"jet_jvt");
1043 systematicTree->makeOutputVariable(
m_jet_fjvt,
"jet_forwardjvt");
1044 systematicTree->makeOutputVariable(
m_jet_passfjvt,
"jet_passforwardjvt");
1049 systematicTree->makeOutputVariable(
m_jet_isTrueHS,
"jet_isTrueHS");
1054 if (
m_config->useJetGhostTrack()) {
1065 for (
const std::string& tagWP :
m_config->bTagWP()) {
1066 if (tagWP.find(
"Continuous") == std::string::npos)
1069 systematicTree->makeOutputVariable(
m_jet_tagWeightBin[tagWP],
"jet_tagWeightBin_" + tagWP);
1073 systematicTree->makeOutputVariable(
m_jet_DLx[algo.first],
"jet_" + algo.first);
1074 systematicTree->makeOutputVariable(
m_jet_DLx_pb[algo.first],
"jet_" + algo.first +
"_pb");
1075 systematicTree->makeOutputVariable(
m_jet_DLx_pc[algo.first],
"jet_" + algo.first +
"_pc");
1076 systematicTree->makeOutputVariable(
m_jet_DLx_pu[algo.first],
"jet_" + algo.first +
"_pu");
1077 systematicTree->makeOutputVariable(
m_jet_DLx_ptau[algo.first],
"jet_" + algo.first +
"_ptau");
1097 "failJvt_jet_truthflavExtended");
1100 if (
m_config->useJetGhostTrack()) {
1112 if (
m_config->getfJVTWP() !=
"None" &&
m_config->saveFailForwardJVTJets()) {
1116 systematicTree->makeOutputVariable(
m_failFJvt_jet_e,
"failforwardJvt_jet_e");
1126 "failforwardJvt_jet_truthflavExtended");
1129 if (
m_config->useJetGhostTrack()) {
1142 systematicTree->makeOutputVariable(
m_ljet_pt,
"ljet_pt");
1143 systematicTree->makeOutputVariable(
m_ljet_eta,
"ljet_eta");
1144 systematicTree->makeOutputVariable(
m_ljet_phi,
"ljet_phi");
1145 systematicTree->makeOutputVariable(
m_ljet_e,
"ljet_e");
1146 systematicTree->makeOutputVariable(
m_ljet_m,
"ljet_m");
1148 for (
const auto&
it :
m_config->largeRJetSubstructureVariables()) {
1153 systematicTree->makeOutputVariable(
m_ljet_isTagged[taggerName],
"ljet_isTagged_" + taggerName);
1160 systematicTree->makeOutputVariable(
m_ljet_tagSF[taggerName],
"ljet_tagSF_" + taggerName);
1163 if ((systematicTree->name() == nominalTTreeName || systematicTree->name() == nominalLooseTTreeName)) {
1165 systematicTree->makeOutputVariable(
m_ljet_tagSFSysVars[taggerName],
"ljet_tagSF_" + taggerName +
"_variations");
1173 systematicTree->makeOutputVariable(
m_tjet_pt,
"tjet_pt");
1174 systematicTree->makeOutputVariable(
m_tjet_eta,
"tjet_eta");
1175 systematicTree->makeOutputVariable(
m_tjet_phi,
"tjet_phi");
1176 systematicTree->makeOutputVariable(
m_tjet_e,
"tjet_e");
1177 for (
const auto& tagWP :
m_config->bTagWP_trkJet()) {
1178 if (tagWP.find(
"Continuous") == std::string::npos)
1181 systematicTree->makeOutputVariable(
m_tjet_tagWeightBin[tagWP],
"tjet_tagWeightBin_" + tagWP);
1185 systematicTree->makeOutputVariable(
m_tjet_DLx[algo.first],
"tjet_" + algo.first);
1186 systematicTree->makeOutputVariable(
m_tjet_DLx_pb[algo.first],
"tjet_" + algo.first +
"_pb");
1187 systematicTree->makeOutputVariable(
m_tjet_DLx_pc[algo.first],
"tjet_" + algo.first +
"_pc");
1188 systematicTree->makeOutputVariable(
m_tjet_DLx_pu[algo.first],
"tjet_" + algo.first +
"_pu");
1193 systematicTree->makeOutputVariable(
m_track_pt,
"track_pt");
1194 systematicTree->makeOutputVariable(
m_track_eta,
"track_eta");
1195 systematicTree->makeOutputVariable(
m_track_phi,
"track_phi");
1196 systematicTree->makeOutputVariable(
m_track_e,
"track_e");
1197 systematicTree->makeOutputVariable(
m_track_charge,
"track_charge");
1198 systematicTree->makeOutputVariable(
m_track_d0,
"track_d0");
1200 systematicTree->makeOutputVariable(
m_track_z0,
"track_z0");
1202 systematicTree->makeOutputVariable(
m_track_phi0,
"track_phi0");
1203 systematicTree->makeOutputVariable(
m_track_theta,
"track_theta");
1204 systematicTree->makeOutputVariable(
m_track_qOverP,
"track_qOverP");
1213 systematicTree->makeOutputVariable(
m_rcjet_pt,
"rcjet_pt");
1214 systematicTree->makeOutputVariable(
m_rcjet_eta,
"rcjet_eta");
1215 systematicTree->makeOutputVariable(
m_rcjet_phi,
"rcjet_phi");
1216 systematicTree->makeOutputVariable(
m_rcjet_e,
"rcjet_e");
1217 systematicTree->makeOutputVariable(
m_rcjet_d12,
"rcjet_d12");
1218 systematicTree->makeOutputVariable(
m_rcjet_d23,
"rcjet_d23");
1219 systematicTree->makeOutputVariable(
m_rcjetsub_pt,
"rcjetsub_pt");
1220 systematicTree->makeOutputVariable(
m_rcjetsub_eta,
"rcjetsub_eta");
1221 systematicTree->makeOutputVariable(
m_rcjetsub_phi,
"rcjetsub_phi");
1222 systematicTree->makeOutputVariable(
m_rcjetsub_e,
"rcjetsub_e");
1225 systematicTree->makeOutputVariable(
m_rrcjet_pt,
"rrcjet_pt");
1226 systematicTree->makeOutputVariable(
m_rrcjet_eta,
"rrcjet_eta");
1227 systematicTree->makeOutputVariable(
m_rrcjet_phi,
"rrcjet_phi");
1228 systematicTree->makeOutputVariable(
m_rrcjet_e,
"rrcjet_e");
1265 std::string VarRC =
"vrcjet";
1270 std::string
name =
rho + mass_scale;
1301 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_tau32_clstr"], VarRC +
"_" +
name +
"_tau32_clstr");
1302 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_tau21_clstr"], VarRC +
"_" +
name +
"_tau21_clstr");
1303 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_tau3_clstr"], VarRC +
"_" +
name +
"_tau3_clstr");
1304 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_tau2_clstr"], VarRC +
"_" +
name +
"_tau2_clstr");
1305 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_tau1_clstr"], VarRC +
"_" +
name +
"_tau1_clstr");
1307 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_d12_clstr"], VarRC +
"_" +
name +
"_d12_clstr");
1308 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_d23_clstr"], VarRC +
"_" +
name +
"_d23_clstr");
1312 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_ECF1_clstr"], VarRC +
"_" +
name +
"_ECF1_clstr");
1313 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_ECF2_clstr"], VarRC +
"_" +
name +
"_ECF2_clstr");
1314 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_ECF3_clstr"], VarRC +
"_" +
name +
"_ECF3_clstr");
1318 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF332_clstr"], VarRC +
"_" +
name +
"_gECF332_clstr");
1319 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF461_clstr"], VarRC +
"_" +
name +
"_gECF461_clstr");
1320 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF322_clstr"], VarRC +
"_" +
name +
"_gECF322_clstr");
1321 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF331_clstr"], VarRC +
"_" +
name +
"_gECF331_clstr");
1322 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF422_clstr"], VarRC +
"_" +
name +
"_gECF422_clstr");
1323 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF441_clstr"], VarRC +
"_" +
name +
"_gECF441_clstr");
1324 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF212_clstr"], VarRC +
"_" +
name +
"_gECF212_clstr");
1325 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF321_clstr"], VarRC +
"_" +
name +
"_gECF321_clstr");
1326 systematicTree->makeOutputVariable(
m_VarRCjetBranches[VarRC +
"_" +
name +
"_gECF311_clstr"], VarRC +
"_" +
name +
"_gECF311_clstr");
1339 systematicTree->makeOutputVariable(
m_met_met,
"met_met");
1340 systematicTree->makeOutputVariable(
m_met_sumet,
"met_sumet");
1341 systematicTree->makeOutputVariable(
m_met_phi,
"met_phi");
1343 systematicTree->makeOutputVariable(
m_met_sig,
"met_sig");
1344 systematicTree->makeOutputVariable(
m_met_sigET,
"met_sigET");
1345 systematicTree->makeOutputVariable(
m_met_sigHT,
"met_sigHT");
1346 systematicTree->makeOutputVariable(
m_met_sigRho,
"met_sigRho");
1347 systematicTree->makeOutputVariable(
m_met_sigVarL,
"met_sigVarL");
1348 systematicTree->makeOutputVariable(
m_met_sigVarT,
"met_sigVarT");
1351 if(
m_config->writeMETBuiltWithLooseObjects())
1364 if (
m_config->KLFitterOutput() ==
"FULL") {
1378 if (
m_config->KLFitterOutput() ==
"FULL" ||
m_config->KLFitterOutput() ==
"JETPERM_ONLY") {
1380 if (
m_config->KLFitterLH() ==
"ttbar" ||
m_config->KLFitterLH() ==
"ttZTrilepton" ||
m_config->KLFitterLH() ==
"ttH" ||
m_config->KLFitterLH() ==
"ttbar_JetAngles" ||
m_config->KLFitterLH() ==
"ttbar_Angular" ||
m_config->KLFitterLH() ==
"ttbar_BoostedLJets") {
1409 if (
m_config->KLFitterLH() !=
"ttbar_BoostedLJets") {
1416 if (
m_config->KLFitterLH() ==
"ttZTrilepton") {
1432 if (
m_config->KLFitterLH() ==
"ttH") {
1446 }
else if (
m_config->KLFitterLH() ==
"ttbar_AllHadronic") {
1485 if (
m_config->KLFitterOutput() ==
"FULL" ||
m_config->KLFitterOutput() ==
"FITTEDTOPS_ONLY") {
1486 if (
m_config->KLFitterLH() ==
"ttbar" ||
m_config->KLFitterLH() ==
"ttZTrilepton" ||
m_config->KLFitterLH() ==
"ttH" ||
m_config->KLFitterLH() ==
"ttbar_JetAngles" ||
m_config->KLFitterLH() ==
"ttbar_Angular") {
1529 for (
const auto& trigger_name :
m_config->allTriggers_Tight(branchName)) {
1532 for (
const auto& trigger_name :
m_config->allTriggers_Loose(branchName)) {
1538 for (
const auto& trigger_name :
m_config->electronTriggers_Tight(branchName))
1540 for (
const auto& trigger_name :
m_config->electronTriggers_Loose(branchName)) {
1545 for (
const auto& trigger_name :
m_config->muonTriggers_Tight(branchName))
1547 for (
const auto& trigger_name :
m_config->muonTriggers_Loose(branchName)) {
1552 for (
const auto& trigger_name :
m_config->photonTriggers_Tight(branchName))
1554 for (
const auto& trigger_name :
m_config->photonTriggers_Loose(branchName)) {
1563 systematicTree->makeOutputVariable(trig_name.second, trig_name.first);
1565 systematicTree->makeOutputVariable(trig_name.second,
"el_trigMatch_" + trig_name.first);
1567 systematicTree->makeOutputVariable(trig_name.second,
"mu_trigMatch_" + trig_name.first);
1569 systematicTree->makeOutputVariable(trig_name.second,
"ph_trigMatch_" + trig_name.first);
1627 if (
m_config->useTruthElectrons()) {
1670 if(
m_config->softmuonAdditionalTruthInfo())
1701 if (
m_config->useTruthLargeRJets()) {
1786 std::string VarRC =
"vrcjet";
1791 std::string
name =
rho + mass_scale;
1871 if (
m_config->doMCGeneratorWeights()) {
1917 if (
m_config->saveOnlySelectedEvents() && !
event.m_saveEvent)
return;
1941 m_weight_mc =
event.m_info->auxdataConst<
float>(
"AnalysisTop_eventWeight");
1968 if (
event.m_info->isAvailable<
double>(
"Sherpa22VJetsWeight")) {
1992 if (
m_config->electronEfficiencySystematicModel() !=
"TOTAL") {
2009 if (
m_config->muonBreakDownSystematics()) {
2056 if (
m_config->doLooseEvents() &&
m_config->muonQualityLoose() ==
"HighPt") {
2066 if (
m_config->muonBreakDownSystematics()) {
2124 if (
m_config->getfJVTWP() !=
"None"){
2132 for (
const std::string& tagWP :
m_config->bTagWP_calib()) {
2142 for (
const auto&
name :
m_config->btagging_namedSysts(tagWP)) {
2148 for (
const std::string& tagWP :
m_config->bTagWP_calib_trkJet()) {
2158 for (
const auto&
name :
m_config->trkjet_btagging_namedSysts(tagWP)) {
2168 if (
m_config->saveBootstrapWeights()) {
2169 m_weight_poisson =
event.m_info->auxdataConst<std::vector<int> >(
"weight_poisson");
2184 if (
event.m_info->isAvailable<
unsigned int>(
"RandomRunNumber"))
m_randomRunNumber =
event.m_info->auxdataConst<
unsigned int>(
"RandomRunNumber");
2197 if (
m_config->useMuons() &&
event.m_info->isAvailable<
char>(
"AnalysisTop_HASBADMUON"))
m_hasBadMuon =
event.m_info->auxdataConst<
char>(
"AnalysisTop_HASBADMUON");
2200 m_mu_original =
event.m_info->averageInteractionsPerCrossing();
2214 if (
event.m_info->isAvailable<
float>(
"corrected_averageInteractionsPerCrossing"))
m_mu =
event.m_info->auxdataConst<
float>(
"corrected_averageInteractionsPerCrossing");
2215 if (
event.m_info->isAvailable<
float>(
"corrected_actualInteractionsPerCrossing"))
m_mu_actual =
event.m_info->auxdataConst<
float>(
"corrected_actualInteractionsPerCrossing");
2223 unsigned int n_electrons =
event.m_fwdElectrons.size();
2233 for (
const auto*
const elPtr :
event.m_fwdElectrons) {
2250 if (
event.m_isLoose) {
2251 if (elPtr->isAvailable<
char>(
"passPreORSelection")) {
2263 unsigned int n_electrons =
event.m_electrons.size();
2268 m_el_e.resize(n_electrons);
2287 if (
m_config->enablePromptLeptonImprovedVetoStudies()) {
2317 static const SG::AuxElement::Accessor<float> PLIV_el_PromptLeptonImprovedInput_CandVertex_normDistToPriVtxLongitudinalBest_ThetaCutVtx(
"PromptLeptonImprovedInput_CandVertex_normDistToPriVtxLongitudinalBest_ThetaCutVtx");
2321 for (
const auto*
const elPtr :
event.m_electrons) {
2330 if (
event.m_isLoose) {
2331 if (elPtr->isAvailable<
char>(
"passPreORSelection")) {
2332 m_el_isTight[
i] = elPtr->auxdataConst<
char>(
"passPreORSelection");
2335 if (elPtr->isAvailable<
char>(
"passChargeID"))
m_el_CF[
i] = elPtr->auxdataConst<
char>(
"passChargeID");
2337 std::string trig =
"TRIGMATCH_" +
trigger.first;
2340 if (elPtr->isAvailable<
float>(
"d0sig"))
m_el_d0sig[
i] = elPtr->auxdataConst<
float>(
"d0sig");
2341 if (elPtr->isAvailable<
float>(
"delta_z0_sintheta"))
m_el_delta_z0_sintheta[
i] = elPtr->auxdataConst<
float>(
"delta_z0_sintheta");
2343 if (
m_config->enablePromptLeptonImprovedVetoStudies()) {
2391 unsigned int n_muons =
event.m_muons.size();
2409 if (
m_config->enablePromptLeptonImprovedVetoStudies()) {
2430 static const SG::AuxElement::Accessor<float> PLIV_mu_PromptLeptonImprovedInput_ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500rel(
"PromptLeptonImprovedInput_ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500rel");
2432 static const SG::AuxElement::Accessor<float> PLIV_mu_PromptLeptonImprovedInput_CandVertex_normDistToPriVtxLongitudinalBest(
"PromptLeptonImprovedInput_CandVertex_normDistToPriVtxLongitudinalBest");
2435 for (
const auto*
const muPtr :
event.m_muons) {
2443 if (
event.m_isLoose) {
2444 if (muPtr->isAvailable<
char>(
"passPreORSelection")) {
2445 m_mu_isTight[
i] = muPtr->auxdataConst<
char>(
"passPreORSelection");
2449 std::string trig =
"TRIGMATCH_" +
trigger.first;
2452 if (muPtr->isAvailable<
float>(
"d0sig"))
m_mu_d0sig[
i] = muPtr->auxdataConst<
float>(
"d0sig");
2453 if (muPtr->isAvailable<
float>(
"delta_z0_sintheta"))
m_mu_delta_z0_sintheta[
i] = muPtr->auxdataConst<
float>(
"delta_z0_sintheta");
2455 if (
m_config->enablePromptLeptonImprovedVetoStudies()) {
2486 unsigned int n_muons =
event.m_softmuons.size();
2511 if(
m_config->softmuonAdditionalTruthInfo())
2521 for (
const auto*
const muPtr :
event.m_softmuons) {
2535 if (muPtr->isAvailable<
float>(
"d0sig"))
m_softmu_d0sig[
i] = muPtr->auxdataConst<
float>(
"d0sig");
2536 if (muPtr->isAvailable<
float>(
"delta_z0_sintheta"))
m_softmu_delta_z0_sintheta[
i] = muPtr->auxdataConst<
float>(
"delta_z0_sintheta");
2559 if(
m_config->softmuonAdditionalTruthInfo())
2564 if(
m_config->softmuonAdditionalTruthInfoCheckPartonOrigin())
2578 if(Mother.
isAvailable(*muPtr)) mother=Mother(*muPtr);
2583 if(BMother.
isAvailable(*muPtr)) Bmother=BMother(*muPtr);
2588 if(CMother.
isAvailable(*muPtr)) Cmother=CMother(*muPtr);
2608 for (
const auto*
const phPtr :
event.m_photons) {
2615 if (phPtr->isAvailable<
float>(
"ptvarcone20"))
m_ph_iso[
i] = phPtr->auxdata<
float>(
"ptvarcone20");
2617 std::string trig =
"TRIGMATCH_" +
trigger.first;
2634 for (
const auto*
const tauPtr :
event.m_tauJets) {
2663 for (
const auto*
const trkPtr :
event.m_tracks){
2700 if (
m_config->useJetGhostTrack()) {
2733 for (
const std::string& tagWP :
m_config->bTagWP()) {
2734 if (tagWP.find(
"Continuous") == std::string::npos)
2741 for (
const std::string& tagWP :
m_config->bTagWP_calib()) {
2749 for (
const std::string&
name :
m_config->btagging_namedSysts(tagWP)) {
2755 for (
const auto*
const jetPtr :
event.m_jets) {
2762 if (jetPtr->isAvailable<
int>(
"HadronConeExclTruthLabelID")) {
2766 if (jetPtr->isAvailable<
int>(
"PartonTruthLabelID")) {
2770 if (jetPtr->isAvailable<
char>(
"AnalysisTop_isHS")) {
2774 if (jetPtr->isAvailable<
int>(
"HadronConeExclExtendedTruthLabelID")) {
2784 std::vector<const xAOD::TrackParticle*> ghostTracks;
2788 const unsigned int nghostTracks = ghostTracks.size();
2807 for (
unsigned int iGhost = 0; iGhost < nghostTracks; ++iGhost) {
2809 top::check(ghostTracks.at(iGhost),
"Error in EventSaverFlatNtuple: Found jet with null pointer in ghost track vector.");
2811 if(ghostTracks.at(iGhost)->auxdataConst<
char >(
"passPreORSelection") != 1)
2827 for (
const std::string& tagWP :
m_config->bTagWP()) {
2828 if (tagWP.find(
"Continuous") == std::string::npos) {
2830 if (jetPtr->isAvailable<
char>(
"isbtagged_" + tagWP))
2831 m_jet_isbtagged[tagWP][
i] = jetPtr->auxdataConst<
char>(
"isbtagged_" + tagWP);
2834 if (jetPtr->isAvailable<
int>(
"tagWeightBin_" + tagWP))
2840 for (
const std::string& tagWP :
m_config->bTagWP_calib()) {
2854 for (
const std::string&
name :
m_config->btagging_namedSysts(tagWP)) {
2865 if (jetPtr->isAvailable<
float>(
"NNJvt")) {
2866 m_jet_jvt[
i] = jetPtr->auxdataConst<
float>(
"NNJvt");
2870 if (jetPtr->isAvailable<
float>(
"fJvt")){
2871 m_jet_fjvt[
i] = jetPtr->auxdataConst<
float>(
"fJvt");
2874 if (jetPtr->isAvailable<
char>(
"AnalysisTop_fJVTdecision")){
2875 m_jet_passfjvt[
i] = jetPtr->getAttribute<
char>(
"AnalysisTop_fJVTdecision");
2884 std::vector<float>& m_jet_DLx_pick =
m_jet_DLx.at(algo.first);
2885 std::vector<float>& m_jet_DLx_pb_pick =
m_jet_DLx_pb.at(algo.first);
2886 std::vector<float>& m_jet_DLx_pc_pick =
m_jet_DLx_pc.at(algo.first);
2887 std::vector<float>& m_jet_DLx_pu_pick =
m_jet_DLx_pu.at(algo.first);
2888 std::vector<float>& m_jet_DLx_ptau_pick =
m_jet_DLx_ptau.at(algo.first);
2891 for (
const auto*
const jetPtr :
event.m_jets) {
2892 m_jet_DLx_pick[
i] = DLx_acc(*jetPtr);
2897 std::string taggerName = algo.first;
2898 if(taggerName ==
"GN2v00LegacyWP" || taggerName ==
"GN2v00NewAliasWP"){
2899 taggerName =
"GN2v00";
2907 btag->
pu(taggerName,
pu);
2908 btag->
pc(taggerName,
pc);
2909 btag->
pb(taggerName,
pb);
2910 btag->
ptau(taggerName, ptau);
2912 m_jet_DLx_pb_pick[
i] =
pb;
2913 m_jet_DLx_pc_pick[
i] =
pc;
2914 m_jet_DLx_pu_pick[
i] =
pu;
2915 m_jet_DLx_ptau_pick[
i] = ptau;
2936 if (
m_config->useJetGhostTrack()) {
2954 for (
const auto*
const jetPtr :
event.m_failJvt_jets) {
2961 if (jetPtr->isAvailable<
int>(
"HadronConeExclTruthLabelID")) {
2965 if (jetPtr->isAvailable<
int>(
"PartonTruthLabelID")) {
2969 if (jetPtr->isAvailable<
char>(
"AnalysisTop_isHS")) {
2973 if (jetPtr->isAvailable<
int>(
"HadronConeExclExtendedTruthLabelID")) {
2983 std::vector<const xAOD::TrackParticle*> ghostTracks;
2986 const unsigned int nghostTracks = ghostTracks.size();
3004 for (
unsigned int iGhost = 0; iGhost < nghostTracks; ++iGhost) {
3006 top::check(ghostTracks.at(iGhost),
"Error in EventSaverFlatNtuple: Found jet with null pointer in ghost track vector.");
3008 if(ghostTracks.at(iGhost)->auxdataConst<
char >(
"passPreORSelection") != 1)
3024 if (jetPtr->isAvailable<
float>(
"NNJvt")) {
3029 if (jetPtr->isAvailable<
float>(
"fJvt")) {
3033 if (jetPtr->isAvailable<
char>(
"AnalysisTop_fJVTdecision")) {
3043 if (
m_config->getfJVTWP() !=
"None" &&
m_config->saveFailForwardJVTJets()) {
3055 if (
m_config->useJetGhostTrack()) {
3073 for (
const auto*
const jetPtr :
event.m_failFJvt_jets) {
3080 if (jetPtr->isAvailable<
int>(
"HadronConeExclTruthLabelID")) {
3084 if (jetPtr->isAvailable<
int>(
"PartonTruthLabelID")) {
3088 if (jetPtr->isAvailable<
char>(
"AnalysisTop_isHS")) {
3092 if (jetPtr->isAvailable<
int>(
"HadronConeExclExtendedTruthLabelID")) {
3102 std::vector<const xAOD::TrackParticle*> ghostTracks;
3105 const unsigned int nghostTracks = ghostTracks.size();
3124 for (
unsigned int iGhost = 0; iGhost < nghostTracks; ++iGhost) {
3125 top::check(ghostTracks.at(iGhost),
"Error in EventSaverFlatNtuple: Found jet with null pointer in ghost track vector.");
3127 if(ghostTracks.at(iGhost)->auxdataConst<
char >(
"passPreORSelection") != 1)
3145 if (jetPtr->isAvailable<
float>(
"NNJvt")) {
3149 if (jetPtr->isAvailable<
char>(
"NNJvtPass")) {
3153 if (jetPtr->isAvailable<
float>(
"fJvt")) {
3165 const unsigned int nLargeRJets =
event.m_largeJets.size();
3172 for (
const auto&
it :
m_config->largeRJetSubstructureVariables()) {
3190 for (
const auto*
const jetPtr :
event.m_largeJets) {
3197 for (
const auto&
it :
m_config->largeRJetSubstructureVariables()) {
3202 m_ljet_isTagged[taggerName][
i] = jetPtr->getAttribute<
bool>(taggerName +
"_Tagged");
3208 for (
const std::pair<const std::string, std::string>& tagSF :
m_config->boostedTaggerSFnames()) {
3209 const std::string& taggerName = tagSF.first;
3210 const std::string& sfNameNominal = tagSF.second;
3212 m_ljet_tagSF[taggerName][
i] = jetPtr->auxdata<
float>(sfNameNominal);
3215 const std::vector<std::string>& sysNames =
m_config->boostedTaggersSFSysNames().at(taggerName);
3217 for(
size_t iname = 0; iname<sysNames.size();iname++) {
3241 for (
const std::string& tagWP :
m_config->bTagWP_trkJet()) {
3242 if (tagWP.find(
"Continuous") == std::string::npos)
3249 for (
const std::string& tagWP :
m_config->bTagWP_calib_trkJet()) {
3257 for (
const std::string&
name :
m_config->trkjet_btagging_namedSysts(tagWP)) {
3263 for (
const auto*
const jetPtr :
event.m_trackJets) {
3269 for (
const std::string& tagWP :
m_config->bTagWP_trkJet()) {
3270 if (tagWP.find(
"Continuous") == std::string::npos) {
3272 if (jetPtr->isAvailable<
char>(
"isbtagged_" + tagWP))
3276 if (jetPtr->isAvailable<
int>(
"tagWeightBin_" + tagWP))
3282 for (
const std::string& tagWP :
m_config->bTagWP_calib_trkJet()) {
3296 for (
const std::string&
name :
m_config->trkjet_btagging_namedSysts(tagWP)) {
3309 std::vector<float>& m_tjet_DLx_pick =
m_tjet_DLx.at(algo.first);
3310 std::vector<float>& m_tjet_DLx_pb_pick =
m_tjet_DLx_pb.at(algo.first);
3311 std::vector<float>& m_tjet_DLx_pc_pick =
m_tjet_DLx_pc.at(algo.first);
3312 std::vector<float>& m_tjet_DLx_pu_pick =
m_tjet_DLx_pu.at(algo.first);
3315 for (
const auto*
const jetPtr :
event.m_trackJets) {
3316 m_tjet_DLx_pick[
i] = DLx_acc(*jetPtr);
3323 btag->
pu(algo.first,
pu);
3324 btag->
pc(algo.first,
pc);
3325 btag->
pb(algo.first,
pb);
3326 m_tjet_DLx_pb_pick[
i] =
pb;
3327 m_tjet_DLx_pc_pick[
i] =
pc;
3328 m_tjet_DLx_pu_pick[
i] =
pu;
3378 unsigned int sizeOfRCjets(
event.m_RCJets.size());
3435 m_rcjetsub_e.resize(sizeOfRCjets, std::vector<float>());
3479 for (
auto jet_itr =
event.m_RCJets.begin(); jet_itr !=
event.m_RCJets.end(); ++jet_itr) {
3542 subjet =
static_cast<const xAOD::Jet*
>(rc_jet_subjet->rawConstituent());
3556 std::string VarRC =
"vrcjet";
3560 std::string
name =
rho + mass_scale;
3603 unsigned int sizeOfRCjets = vrc_jets->
size();
3658 for (
auto jet_ptr : *vrc_jets) {
3718 subjet =
static_cast<const xAOD::Jet*
>(rc_jet_subjet->rawConstituent());
3737 if(
event.m_met->isAvailable<
float>(
"metSig")){
3738 m_met_sig =
event.m_met->auxdata<
float>(
"metSig");
3740 if(
event.m_met->isAvailable<
float>(
"metSigET")){
3741 m_met_sigET =
event.m_met->auxdata<
float>(
"metSigET");
3743 if(
event.m_met->isAvailable<
float>(
"metSigHT")){
3744 m_met_sigHT =
event.m_met->auxdata<
float>(
"metSigHT");
3746 if(
event.m_met->isAvailable<
float>(
"metSigRho")){
3747 m_met_sigRho =
event.m_met->auxdata<
float>(
"metSigRho");
3749 if(
event.m_met->isAvailable<
float>(
"metSigVarL")){
3752 if(
event.m_met->isAvailable<
float>(
"metSigVarT")){
3757 if(
m_config->writeMETBuiltWithLooseObjects())
3769 unsigned int nPermutations(0), iPerm(0), bestPerm(0);
3770 bool validKLFitter(
false);
3772 if (
event.m_KLFitterResults !=
nullptr) {
3773 validKLFitter =
true;
3775 nPermutations =
event.m_KLFitterResults->size();
3792 if (
m_config->KLFitterLH() ==
"ttbar" ||
m_config->KLFitterLH() ==
"ttZTrilepton" ||
m_config->KLFitterLH() ==
"ttH" ||
m_config->KLFitterLH() ==
"ttbar_JetAngles" ||
m_config->KLFitterLH() ==
"ttbar_Angular" ||
m_config->KLFitterLH() ==
"ttbar_BoostedLJets") {
3812 if (
m_config->KLFitterLH() !=
"ttbar_BoostedLJets") {
3819 if (
m_config->KLFitterLH() ==
"ttH") {
3856 }
else if (
m_config->KLFitterLH() ==
"ttbar_AllHadronic") {
3894 if (validKLFitter) {
3895 for (
const auto*
const klPtr : *
event.m_KLFitterResults) {
3897 std::hash<std::string> st_hash;
3898 for (
unsigned int s = 0;
s <
m_config->allSelectionNames()->
size(); ++
s) {
3899 if (st_hash(
m_config->allSelectionNames()->at(
s)) == klPtr->selectionCode()) {
3911 if (klPtr->bestPermutation() == 1) {
3921 if (
m_config->KLFitterLH() ==
"ttbar" ||
m_config->KLFitterLH() ==
"ttZTrilepton" ||
m_config->KLFitterLH() ==
"ttH" ||
m_config->KLFitterLH() ==
"ttbar_JetAngles" ||
m_config->KLFitterLH() ==
"ttbar_Angular" ||
m_config->KLFitterLH() ==
"ttbar_BoostedLJets") {
3940 if (
m_config->KLFitterLH() !=
"ttbar_BoostedLJets") {
3947 if (
m_config->KLFitterLH() ==
"ttH") {
3983 }
else if (
m_config->KLFitterLH() ==
"ttbar_AllHadronic") {
4026 if (
m_config->KLFitterLH() ==
"ttbar" ||
m_config->KLFitterLH() ==
"ttZTrilepton" ||
m_config->KLFitterLH() ==
"ttH" ||
m_config->KLFitterLH() ==
"ttbar_JetAngles" ||
m_config->KLFitterLH() ==
"ttbar_Angular") {
4027 if (nPermutations != 0) {
4028 TLorentzVector bhad, blep, lq1, lq2, lep, nu, top_had, top_lep, ttbar;
4037 top_had = bhad + lq1 + lq2;
4038 top_lep = blep + lep + nu;
4039 ttbar = top_had + top_lep;
4069 if (!
event.m_isLoose) {
4075 pseudoTopResult = pseudoTopResultContainer->
at(0);
4122 eventInfo->
auxdecor<
unsigned int>(
"RandomLumiBlockNumber") = eventInfo->
lumiBlock();
4123 eventInfo->
auxdecor<
float>(
"PileupWeight") = 1.;
4147 if (truth !=
nullptr) {
4149 unsigned int truthSize = truth->
size();
4153 m_mc_e.resize(truthSize);
4159 for (
const auto*
const mcPtr : *truth) {
4165 if (!(mcPtr->p4().CosTheta() * mcPtr->p4().CosTheta() >= 1 && mcPtr->p4().Pz() != 0)) {
4183 if (
m_config->doTopPartonHistory()) {
4186 if (
evtStore()->contains<xAOD::PartonHistoryContainer>(
m_config->sgKeyTopPartonHistory())) {
4188 if (partonHistoryContainer->
size() == 1) {
4189 partonHistory = partonHistoryContainer->
at(0);
4193 if (partonHistory !=
nullptr) {
4194 if (!
m_config->isTopPartonHistoryRegisteredInNtuple()) {
4196 m_config->setTopPartonHistoryRegisteredInNtuple();
4209 if (not
m_config->doTopParticleLevel()) {
4252 if (
m_config->useTruthElectrons()) {
4281 if(elPtr->isAvailable<
unsigned int>(
"particleType"))
m_el_true_type[
i] = elPtr->auxdata<
unsigned int>(
"particleType");
4282 else if(elPtr->isAvailable<
unsigned int>(
"classifierParticleType"))
m_el_true_type[
i] = elPtr->auxdata<
unsigned int>(
"classifierParticleType");
4285 if(elPtr->isAvailable<
unsigned int>(
"particleOrigin"))
m_el_true_origin[
i] = elPtr->auxdata<
unsigned int>(
"particleOrigin");
4286 else if(elPtr->isAvailable<
unsigned int>(
"classifierParticleOrigin"))
m_el_true_origin[
i] = elPtr->auxdata<
unsigned int>(
"classifierParticleOrigin");
4311 for (
const auto *muPtr : *plEvent.
m_muons) {
4323 if(muPtr->isAvailable<
unsigned int>(
"particleType"))
m_mu_true_type[
i] = muPtr->auxdata<
unsigned int>(
"particleType");
4324 else if(muPtr->isAvailable<
unsigned int>(
"classifierParticleType"))
m_mu_true_type[
i] = muPtr->auxdata<
unsigned int>(
"classifierParticleType");
4327 if(muPtr->isAvailable<
unsigned int>(
"particleOrigin"))
m_mu_true_origin[
i] = muPtr->auxdata<
unsigned int>(
"particleOrigin");
4328 else if(muPtr->isAvailable<
unsigned int>(
"classifierParticleOrigin"))
m_mu_true_origin[
i] = muPtr->auxdata<
unsigned int>(
"classifierParticleOrigin");
4346 if(
m_config->softmuonAdditionalTruthInfo())
4362 if(muPtr->isAvailable<
unsigned int>(
"particleType"))
m_softmu_true_type[
i] = muPtr->auxdata<
unsigned int>(
"particleType");
4363 else if(muPtr->isAvailable<
unsigned int>(
"classifierParticleType"))
m_softmu_true_type[
i] = muPtr->auxdata<
unsigned int>(
"classifierParticleType");
4366 if(muPtr->isAvailable<
unsigned int>(
"particleOrigin"))
m_softmu_true_origin[
i] = muPtr->auxdata<
unsigned int>(
"particleOrigin");
4367 else if(muPtr->isAvailable<
unsigned int>(
"classifierParticleOrigin"))
m_softmu_true_origin[
i] = muPtr->auxdata<
unsigned int>(
"classifierParticleOrigin");
4370 if(
m_config->softmuonAdditionalTruthInfo())
4374 if(
m_config->softmuonAdditionalTruthInfoCheckPartonOrigin())
4388 if(Mother.
isAvailable(*muPtr)) mother=Mother(*muPtr);
4393 if(BMother.
isAvailable(*muPtr)) Bmother=BMother(*muPtr);
4398 if(CMother.
isAvailable(*muPtr)) Cmother=CMother(*muPtr);
4416 for (
const auto*
const phPtr : *plEvent.
m_photons) {
4439 for (
const auto *jetPtr : *plEvent.
m_jets) {
4445 if(ghostBHadronsFinalCount.
isAvailable(*jetPtr)) {
4449 ATH_MSG_DEBUG(
"Found a jet with no GhostBHadronFinalCount auxdata");
4453 if(ghostCHadronsFinalCount.
isAvailable(*jetPtr)) {
4457 ATH_MSG_DEBUG(
"Found a jet with no GhostCHadronFinalCount auxdata");
4466 if (
m_config->useTruthLargeRJets()) {
4481 if(ghostBHadronsFinalCount.
isAvailable(*jetPtr)) {
4485 ATH_MSG_DEBUG(
"Found a jet with no GhostBHadronFinalCount auxdata");
4489 if(ghostCHadronsFinalCount.
isAvailable(*jetPtr)) {
4493 ATH_MSG_DEBUG(
"Found a jet with no GhostCHadronFinalCount auxdata");
4512 for (
const auto *tauPtr : *plEvent.
m_taus) {
4518 if (tauPtr->isAvailable<
char>(
"IsHadronicTau")) {
4622 m_rcjetsub_e.resize(sizeOfRCjets, std::vector<float>());
4667 for (
const auto *rc_jet : plEvent.
m_RCJets) {
4724 for (
const auto *rc_jet_subjet : rc_jet->getConstituents()) {
4725 subjet =
static_cast<const xAOD::Jet*
>(rc_jet_subjet->rawConstituent());
4735 ATH_MSG_DEBUG(
"Found a jet with no GhostBHadronFinalCount auxdata");
4743 ATH_MSG_DEBUG(
"Found a jet with no GhostCHadronFinalCount auxdata");
4754 std::string VarRC =
"vrcjet";
4758 std::string
name =
rho + mass_scale;
4800 unsigned int sizeOfRCjets = vrc_jets->
size();
4853 for (
auto jet_ptr : *vrc_jets) {
4913 subjet =
static_cast<const xAOD::Jet*
>(rc_jet_subjet->rawConstituent());
4939 if (
evtStore()->contains<xAOD::PseudoTopResultContainer>(
m_config->sgKeyPseudoTop(0))) {
4942 pseudoTopResult = pseudoTopResultContainer->
at(0);
4976 if (truthEvent !=
nullptr) {
4978 unsigned int truthEventSize = truthEvent->
size();
4987 for (
const auto*
const tePtr : *truthEvent) {
4991 std::string PDFinfoVarName =
"X1";
4992 if (truthEvent->isAvailable<
float>(PDFinfoVarName))
m_PDFinfo_X1[
i] = (*tePtr).auxdataConst<
float >(PDFinfoVarName);
4993 PDFinfoVarName =
"X2";
4994 if (truthEvent->isAvailable<
float>(PDFinfoVarName))
m_PDFinfo_X2[
i] = (*tePtr).auxdataConst<
float >(PDFinfoVarName);
4995 PDFinfoVarName =
"PDGID1";
4996 if (truthEvent->isAvailable<
int>(PDFinfoVarName))
m_PDFinfo_PDGID1[
i] = (*tePtr).auxdataConst<
int >(PDFinfoVarName);
4997 PDFinfoVarName =
"PDGID2";
4998 if (truthEvent->isAvailable<
int>(PDFinfoVarName))
m_PDFinfo_PDGID2[
i] = (*tePtr).auxdataConst<
int >(PDFinfoVarName);
4999 PDFinfoVarName =
"XF1";
5000 if (truthEvent->isAvailable<
float>(PDFinfoVarName))
m_PDFinfo_XF1[
i] = (*tePtr).auxdataConst<
float >(PDFinfoVarName);
5001 PDFinfoVarName =
"XF2";
5002 if (truthEvent->isAvailable<
float>(PDFinfoVarName))
m_PDFinfo_XF2[
i] = (*tePtr).auxdataConst<
float >(PDFinfoVarName);
5003 PDFinfoVarName =
"Q";
5004 if (truthEvent->isAvailable<
float>(PDFinfoVarName))
m_PDFinfo_Q[
i] = (*tePtr).auxdataConst<
float >(PDFinfoVarName);
5015 for (
const auto *tePtr : *truthEvent) {
5016 for (
const std::string& pdf_name :
m_config->LHAPDFSets()) {
5017 if (tePtr->isAvailable<std::vector<float> >(
"AnalysisTop_" + pdf_name +
"_Weights")) {
5018 m_PDF_eventWeights[ pdf_name ] = tePtr->auxdata<std::vector<float> >(
"AnalysisTop_" + pdf_name +
"_Weights");
5041 if (!
obj.container()->getConstStore())
return;
5048 (
obj.container()->getConstStore() ?
5049 obj.container()->getConstStore()->getAuxIDs() :
5050 obj.getConstStore()->getAuxIDs());
5055 const std::type_info* ti =
reg.getType(auxid);
5057 const std::string
name =
reg.getName(auxid);
5060 if (*ti ==
typeid(
int)) {
5062 }
else if (*ti ==
typeid(
float)) {
5065 ATH_MSG_INFO(
"insertObjectIntoTruthTree - you need another variable map for more types!");
5080 if (!
obj.container()->getConstStore())
return;
5086 (
obj.container()->getConstStore() ?
5087 obj.container()->getConstStore()->getAuxIDs() :
5088 obj.getConstStore()->getAuxIDs());
5093 const std::type_info* ti =
reg.getType(auxid);
5095 const std::string
name =
reg.getName(auxid);
5098 if (*ti ==
typeid(
int)) {
5101 *((*itr).second) =
obj.auxdataConst<
int> (
name);
5103 }
else if (*ti ==
typeid(
float)) {
5106 *((*itr).second) =
obj.auxdataConst<
float> (
name);
5109 ATH_MSG_INFO(
"saveObjectIntoTruthTree - you need another variable map for more types!");
5116 std::string
str =
"FixedCutBEff_";
5117 std::string
out =
WP;
5118 if (
out.find(
str) != std::string::npos) {
5126 std::string
str =
"FT_EFF_";
5128 if (
out.find(
str) != std::string::npos) {
5132 while (
out.find(
str) != std::string::npos) {
5136 while (
out.find(
str) != std::string::npos) {
5147 bool isprompt = (
type == 2 ||
5148 (
type == 4 && origin == 5 && fabs(egMotherPdgId) == 11) ||
5150 (
type == 4 && origin == 7 && egMotherType == 2 && (egMotherOrigin == 10 || egMotherOrigin == 12 || egMotherOrigin == 13 || egMotherOrigin == 14 || egMotherOrigin == 43) && fabs(egMotherPdgId) == 11) ||
5152 (
type == 1 && egMotherType == 2 && egMotherOrigin == 47 && fabs(egMotherPdgId) == 11));
5154 bool isChargeFl =
false;
5156 if (egMotherPdgId * RecoCharge > 0) isChargeFl =
true;
5157 if (isprompt)
return std::make_pair(
true, isChargeFl);
5160 if (
type == 4 && origin == 5 && egMotherOrigin == 40)
return std::make_pair(
true,
false);
5163 if (
type == 15 && origin == 40)
return std::make_pair(
true,
false);
5166 if (
type == 4 && origin == 7 && egMotherType == 15 && egMotherOrigin == 40)
return std::make_pair(
true,
false);
5168 return std::make_pair(
false,
false);
5174 (origin == 10 || origin == 12 || origin == 13 || origin == 14 || origin == 15 || origin == 22 || origin == 43));
5180 std::vector<std::string> filteredBranches;
5181 if(treeManager->
name() ==
"truth") filteredBranches=
m_config->filterPartonLevelBranches();
5182 else if(treeManager->
name() ==
"particleLevel") filteredBranches=
m_config->filterParticleLevelBranches();
5183 else if(treeManager->
name() ==
"nominal_Loose") filteredBranches=
m_config->filterNominalLooseBranches();
5184 else if(treeManager->
name() ==
"nominal") {
5185 if (
m_config->filterNominalBranches().empty()) {
5186 filteredBranches=
m_config->filterBranches();
5188 filteredBranches=
m_config->filterNominalBranches();
5190 }
else filteredBranches=
m_config->filterBranches();
5196 if (!
match.empty())
return true;
5201 for (std::string
filter : filteredBranches) {
5205 if (matches_wildcard((
"^" +
filter).c_str()))
return 0;