58 TruthTausEvent& truthTausEvent =
dynamic_cast<TruthTausEvent&
> (itruthTausEvent);
59 const EventContext& ctx = Gaudi::Hive::currentContext();
64 ATH_MSG_WARNING(
"There was a failure in finding the matched truth tau");
71 ATH_MSG_DEBUG(
"TauJetContainer has truthParticleLink available while IsTruthMatched not available. Re-evaluate IsTruthMatched");
73 if (accTruthParticleLink(xTau)) {
74 decIsTruthMatched(xTau) = (char)
true;
76 decIsTruthMatched(xTau) = (char)
false;
81 if (
static_cast<bool>(accIsTruthMatched(xTau)))
83 if (accTruthParticleLink(xTau).
isValid())
85 return *accTruthParticleLink(xTau);
308 const xAOD::Jet* xTruthJetMatch =
nullptr;
313 for (
auto xTruthTauIt : xTruthTauContainer)
315 TLorentzVector vTruthVisTLV;
316 vTruthVisTLV.SetPtEtaPhiM(
m_accPtVis(*xTruthTauIt),
323 if (
static_cast<bool>(accIsHadronicTau(*xTruthTauIt)))
328 xTruthMatch = xTruthTauIt;
334 if (!xTruthMatch and truthTausEvent.m_xTruthMuonContainerConst)
337 for (
auto xTruthMuonIt : *truthTausEvent.m_xTruthMuonContainerConst)
341 if (xTruthMuonIt->pt()<dPtMax)
344 xTruthMatch = xTruthMuonIt;
345 dPtMax = xTruthMuonIt->
pt();
350 if (!xTruthMatch and truthTausEvent.m_xTruthElectronContainerConst)
353 for (
auto xTruthElectronIt : *truthTausEvent.m_xTruthElectronContainerConst)
357 if (xTruthElectronIt->pt()<dPtMax)
360 xTruthMatch = xTruthElectronIt;
361 dPtMax = xTruthElectronIt->
pt();
366 if (truthTausEvent.m_xTruthJetContainerConst)
369 for (
auto xTruthJetIt : *truthTausEvent.m_xTruthJetContainerConst)
373 if (xTruthJetIt->pt()<dPtMax)
375 xTruthJetMatch = xTruthJetIt;
376 dPtMax = xTruthJetIt->
pt();
382 decIsTruthMatched(xTau) = (char)
true;
384 decIsTruthMatched(xTau) = (char)
false;
388 ElementLink < xAOD::JetContainer > lTruthParticleLink(xTruthJetMatch, *truthTausEvent.m_xTruthJetContainerConst);
389 decTruthJetLink(xTau) = lTruthParticleLink;
393 ElementLink < xAOD::JetContainer > lTruthParticleLink;
394 decTruthJetLink(xTau) = lTruthParticleLink;
404 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, xTruthTauContainer);
405 decTruthParticleLink(xTau) = lTruthParticleLink;
407 else if (eTruthMatchedParticleType ==
TruthMuon)
409 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, *truthTausEvent.m_xTruthMuonContainerConst);
410 decTruthParticleLink(xTau) = lTruthParticleLink;
414 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, *truthTausEvent.m_xTruthElectronContainerConst);
415 decTruthParticleLink(xTau) = lTruthParticleLink;
420 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink;
421 decTruthParticleLink(xTau) = lTruthParticleLink;
424 return StatusCode::SUCCESS;
virtual double pt() const override final
The transverse momentum ( ) of the particle.