Skip to content
Snippets Groups Projects
Commit bc4444d9 authored by Laura Stephanie Miller's avatar Laura Stephanie Miller
Browse files

Added check for vertex existence to address ATLASRECTS-6164

parent fd21966c
No related branches found
No related tags found
No related merge requests found
......@@ -79,10 +79,14 @@ StatusCode PFTauFlowElementAssoc::execute(const EventContext &ctx) const {
std::vector<const xAOD::IParticle*> tauClusters = tau->clusters();
for (auto cluster : tauClusters) {
const xAOD::CaloCluster* clus = static_cast<const xAOD::CaloCluster*>(cluster);
// Correct cluster to tau vertex
xAOD::CaloVertexedTopoCluster vertexedClus(*clus, tauVertex->position());
TLorentzVector clusterp4 = clus->p4();
// Correct cluster to tau vertex if it exists
if (tauVertex != nullptr) {
xAOD::CaloVertexedTopoCluster vertexedClus(*clus, tauVertex->position());
clusterp4 = vertexedClus.p4();
}
// Check if the cluster is within R = 0.2 of tau axis
if (vertexedClus.p4().DeltaR(tau->p4(xAOD::TauJetParameters::IntermediateAxis)) > 0.2) continue;
if (clusterp4.DeltaR(tau->p4(xAOD::TauJetParameters::IntermediateAxis)) > 0.2) continue;
// Get the index of the cluster associated to the tau
size_t tauClusterIndex = clus->index();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment