17 TauTruthTrackMatchingTool::TauTruthTrackMatchingTool(
const std::string&
name )
23 TauTruthTrackMatchingTool::~TauTruthTrackMatchingTool( )
30 return StatusCode::SUCCESS;
37 if (!m_bIsHadronicTrackAvailable.isValid())
40 bool avail = accIsHadronicTrack.
isAvailable(xTrackParticle);
41 m_bIsHadronicTrackAvailable.set (avail);
44 ATH_MSG_DEBUG(
"IsHadronicTrack decoration is available on first track processed, switched of rerun for further taus.");
45 ATH_MSG_DEBUG(
"If a truth track matching needs to be redone, please pass a shallow copy of the original track.");
48 if (*m_bIsHadronicTrackAvailable.ptr())
49 return StatusCode::SUCCESS;
51 ATH_CHECK(checkTrackIsTauInheritant(xTrackParticle));
52 ATH_CHECK(checkTrackType(xTrackParticle));
53 return StatusCode::SUCCESS;
57 StatusCode TauTruthTrackMatchingTool::classifyTracks(std::vector<const xAOD::TauTrack*>& vTrackParticles)
const
59 for (
auto xTrackParticle : vTrackParticles)
61 ATH_CHECK(checkTrackIsTauInheritant(*xTrackParticle));
62 ATH_CHECK(checkTrackType(*xTrackParticle));
64 return StatusCode::SUCCESS;
77 return StatusCode::SUCCESS;
82 if (accTruthMatchProbability(*(xTrackParticle.
track())) < 0.5)
85 return StatusCode::SUCCESS;
90 if ((
bool)accIsHadronicTrack(xTrackParticle) and accIsHadronicTrackDecayDepth(xTrackParticle) == 0)
93 return StatusCode::SUCCESS;
104 return StatusCode::SUCCESS;
114 return StatusCode::SUCCESS;
120 return StatusCode::SUCCESS;
122 for (
size_t iIncomingParticle = 0; iIncomingParticle < xProdVertex->
nIncomingParticles(); ++iIncomingParticle )
127 ATH_MSG_WARNING(
"Truth parent of tau decay was not found in TruthParticles container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.\nInformation on how to do this can be found here:\nhttps://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/TauPreRecommendations2015#Accessing_Tau_Truth_Information");
129 return StatusCode::SUCCESS;
135 return StatusCode::SUCCESS;
139 size_t iElectrons = 0;
140 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xProdVertex->
nOutgoingParticles(); ++iOutgoingParticle )
145 ATH_MSG_WARNING(
"Truth daughter of tau decay was not found in TruthParticles container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.\nInformation on how to do this can be found here:\nhttps://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/TauPreRecommendations2015#Accessing_Tau_Truth_Information");
147 return StatusCode::SUCCESS;
153 return StatusCode::SUCCESS;
160 return StatusCode::SUCCESS;
163 return StatusCode::SUCCESS;
170 auto xTruthParticleLink = accTruthParticleLink(*(xTrackParticle.
track()));
172 if (xTruthParticleLink.isValid())
173 return (*xTruthParticleLink);
183 decIsHadronicTrack(xTrackParticle) = (
char)
false;
186 std::string sHistory =
"";
190 if (checkTruthParent(*xTruthParticle, iDepth, sHistory))
192 decIsHadronicTrack(xTrackParticle) = (
char)
true;
195 decIsHadronicTrackDecayDepth(xTrackParticle) = iDepth;
196 decDecayHistory(xTrackParticle) = sHistory;
198 return StatusCode::SUCCESS;
202 bool TauTruthTrackMatchingTool::checkTruthParent(
const xAOD::TruthParticle& xTruthParticle,
int& iDepth, std::string& sHistory)
const
213 if (xTruthParticleParent) {
222 return checkTruthParent(*xTruthParticleParent, iDepth, sHistory);
225 ATH_MSG_WARNING(
"vertex has incoming particles but no valid parent particle");