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);
349 const xAOD::Jet* xTruthJetMatch =
nullptr;
354 for (
auto xTruthTauIt : xTruthTauContainer)
356 TLorentzVector vTruthVisTLV;
357 vTruthVisTLV.SetPtEtaPhiM(
m_accPtVis(*xTruthTauIt),
364 if (
static_cast<bool>(accIsHadronicTau(*xTruthTauIt)))
369 xTruthMatch = xTruthTauIt;
375 if (!xTruthMatch and truthTausEvent.m_xTruthMuonContainerConst)
378 for (
auto xTruthMuonIt : *truthTausEvent.m_xTruthMuonContainerConst)
382 if (xTruthMuonIt->pt()<dPtMax)
385 xTruthMatch = xTruthMuonIt;
386 dPtMax = xTruthMuonIt->
pt();
391 if (!xTruthMatch and truthTausEvent.m_xTruthElectronContainerConst)
394 for (
auto xTruthElectronIt : *truthTausEvent.m_xTruthElectronContainerConst)
398 if (xTruthElectronIt->pt()<dPtMax)
401 xTruthMatch = xTruthElectronIt;
402 dPtMax = xTruthElectronIt->
pt();
407 if (truthTausEvent.m_xTruthJetContainerConst)
410 for (
auto xTruthJetIt : *truthTausEvent.m_xTruthJetContainerConst)
414 if (xTruthJetIt->pt()<dPtMax)
416 xTruthJetMatch = xTruthJetIt;
417 dPtMax = xTruthJetIt->
pt();
423 decIsTruthMatched(xTau) = (char)
true;
425 decIsTruthMatched(xTau) = (char)
false;
429 ElementLink < xAOD::JetContainer > lTruthParticleLink(xTruthJetMatch, *truthTausEvent.m_xTruthJetContainerConst);
430 decTruthJetLink(xTau) = lTruthParticleLink;
434 ElementLink < xAOD::JetContainer > lTruthParticleLink;
435 decTruthJetLink(xTau) = lTruthParticleLink;
445 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, xTruthTauContainer);
446 decTruthParticleLink(xTau) = lTruthParticleLink;
448 else if (eTruthMatchedParticleType ==
TruthMuon)
450 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, *truthTausEvent.m_xTruthMuonContainerConst);
451 decTruthParticleLink(xTau) = lTruthParticleLink;
455 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, *truthTausEvent.m_xTruthElectronContainerConst);
456 decTruthParticleLink(xTau) = lTruthParticleLink;
461 ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink;
462 decTruthParticleLink(xTau) = lTruthParticleLink;
465 return StatusCode::SUCCESS;
Class providing the definition of the 4-vector interface.
virtual double pt() const override final
The transverse momentum ( ) of the particle.