27 const IInterface*
p) :
34 ATH_CHECK(m_mcTruthClassifier.retrieve());
38 ATH_CHECK(m_truthPileupSGKey.initialize());
42 m_Truth_dR_Key = m_containerKey.key() +
".MCTFallback_dR";
43 m_Truth_type_Key = m_containerKey.key() +
".MCTFallback_truthType";
44 m_Truth_origin_Key = m_containerKey.key() +
".MCTFallback_truthOrigin";
47 ATH_CHECK(m_Truth_origin_Key.initialize());
49 m_Truth_PU_dR_Key = m_containerKey.key() +
".MCTFallbackPU_dR";
50 m_Truth_PU_type_Key = m_containerKey.key() +
".MCTFallbackPU_truthType";
51 m_Truth_PU_origin_Key = m_containerKey.key() +
".MCTFallbackPU_truthOrigin";
52 ATH_CHECK(m_Truth_PU_dR_Key.initialize());
53 ATH_CHECK(m_Truth_PU_type_Key.initialize());
54 ATH_CHECK(m_Truth_PU_origin_Key.initialize());
56 return StatusCode::SUCCESS;
63 if (!
parts.isValid()) {
64 ATH_MSG_ERROR(
"No Muon collection with name " << m_containerKey.fullKey() <<
" found in StoreGate!");
65 return StatusCode::FAILURE;
69 ATH_MSG_ERROR(
"No truth collection with name " << m_truthSGKey.fullKey() <<
" found in StoreGate!");
70 return StatusCode::FAILURE;
73 if (!tpec.isValid()) {
74 ATH_MSG_DEBUG(
"No truth pileup collection with name " << m_truthPileupSGKey.fullKey() <<
" found in StoreGate. Pile-up information will not be filled");
78 if (!truthMuons.isValid()) {
79 ATH_MSG_ERROR(
"No truth muon collection with name " << m_truthMuonSGKey.fullKey() <<
" found in StoreGate!");
80 return StatusCode::FAILURE;
90 if (dR > minDR)
continue;
96 for (
size_t parti = 0; parti <
event->nTruthParticles(); parti++) {
99 tpart->
pt() < m_minPt)
102 if (dR > minDR)
continue;
108 decorator_dR(*
part) = closest ? std::sqrt(minDR) : -1;
110 int newType{-1}, newOrigin{-1};
111 if (closest && closest->
isMuon()) {
112 newType = acc_tT(*closest);
113 newOrigin = acc_tO(*closest);
114 }
else if (closest) {
115 auto res = m_mcTruthClassifier->particleTruthClassifier(closest);
117 newOrigin =
res.second;
119 decorator_type(*
part) = newType;
120 decorator_origin(*
part) = newOrigin;
122 decorator_pu_dR(*
part) = -1;
123 decorator_pu_type(*
part) = -1;
124 decorator_pu_origin(*
part) = -1;
128 if (tpec.isValid()) {
130 for (
auto event : *tpec) {
131 for (
size_t parti = 0; parti <
event->nTruthParticles(); parti++) {
134 tpart->
pt() < m_minPt)
137 if (dR > minDR)
continue;
138 closestPileup = tpart;
142 decorator_pu_dR(*
part) = (closestPileup ? std::sqrt(minDR) : -1);
143 int newPileupType{-1}, newPileupOrigin{-1};
145 auto res = m_mcTruthClassifier->particleTruthClassifier(closestPileup);
146 newPileupType =
res.first;
147 newPileupOrigin =
res.second;
149 decorator_pu_type(*
part) = newPileupType;
150 decorator_pu_origin(*
part) = newPileupOrigin;
154 return StatusCode::SUCCESS;