7 #include <GaudiKernel/SystemOfUnits.h>
13 #include <TLorentzVector.h>
69 return StatusCode::FAILURE;
72 for (
const std::string prod_mode : {
"GGF",
"VBF",
"WH",
"QQ2ZH",
"GG2ZH",
"TTH",
"BBH",
"TH",
"THQB",
"WHT"}) {
74 if (prod_mode ==
"GGF")
76 else if (prod_mode ==
"VBF")
78 else if (prod_mode ==
"WH")
80 else if (prod_mode ==
"QQ2ZH")
82 else if (prod_mode ==
"GG2ZH")
84 else if (prod_mode ==
"TTH")
86 else if (prod_mode ==
"BBH")
88 else if (prod_mode ==
"TH")
90 else if (prod_mode ==
"THQB") {
93 }
else if (prod_mode ==
"WHT") {
97 std::vector<std::string> dsid_str =
CxxUtils::tokenize(
config.GetValue(Form(
"HTXS.MCsamples.%s", prod_mode.c_str()),
""),
" ");
98 for (
const std::string&
dsid : dsid_str) { smp.dsids.insert(
std::atoi(
dsid.c_str())); }
101 return StatusCode::SUCCESS;
108 const TLorentzVector& p4)
const {
110 return SG::makeHandle<float> (
key, ctx)(eventInfo);
113 floatEIDecor (
keys.eta) = p4.Eta();
114 floatEIDecor (
keys.phi) = p4.Phi();
116 ATH_MSG_DEBUG(
"Decorate "<<
keys.prefix<<
" with pT: "<<p4.Pt()<<
" [GeV], eta: "<<p4.Eta()<<
", phi: "<<p4.Phi()<<
", M: "<<p4.M());
117 return StatusCode::SUCCESS;
124 const std::vector<TLorentzVector>& p4s)
const {
126 return SG::makeHandle<std::vector<float> > (
key, ctx)(eventInfo);
128 std::vector<float>&
pt = floatVEIDecor (
keys.pt);
129 std::vector<float>&eta = floatVEIDecor (
keys.eta);
130 std::vector<float>&phi = floatVEIDecor (
keys.phi);
131 std::vector<float>&
m = floatVEIDecor (
keys.m);
132 pt.reserve (p4s.size());
133 eta.reserve (p4s.size());
134 phi.reserve (p4s.size());
135 m.reserve (p4s.size());
136 for (
const TLorentzVector& p4 : p4s) {
138 eta.push_back(p4.Eta());
139 phi.push_back(p4.Phi());
141 ATH_MSG_DEBUG(
"Decorate "<<
keys.prefix<<
" with pT: "<<p4.Pt()<<
" [GeV], eta: "<<p4.Eta()<<
", phi: "<<p4.Phi()<<
", M: "<<p4.M());
143 return StatusCode::SUCCESS;
150 if (!eventInfo.isValid()) {
152 return StatusCode::FAILURE;
156 return SG::makeHandle<int> (
key, ctx)(*eventInfo);
159 return SG::makeHandle<float> (
key, ctx)(*eventInfo);
165 std::vector<HTXSSample>::const_iterator smp_itr =
171 <<
" is not a Higgs sample and not of further interest. Decorate the prod mode information only");
172 return StatusCode::SUCCESS;
180 if (!xTruthEventContainer.isValid()) {
182 return StatusCode::FAILURE;
185 std::vector<HepMC::GenEvent> hepmc_evts =
m_xAODtoHepMCTool->getHepMCEvents(xTruthEventContainer.cptr(), eventInfo.cptr());
187 if (hepmc_evts.empty()) {
190 return StatusCode::FAILURE;
192 ATH_MSG_DEBUG(
"Found "<<hepmc_evts.size()<<
" HepMC events.");
196 std::unique_ptr<HTXS::HiggsClassification> htxs{
m_higgsTruthCatTool->getHiggsTruthCategoryObject(hepmc_evts[0], prodMode)};
257 return StatusCode::SUCCESS;