Skip to content
Snippets Groups Projects
Commit 304b9178 authored by Laura Stephanie Miller's avatar Laura Stephanie Miller Committed by Walter Lampl
Browse files

Updated clusters and tracks associated to the tau to better reflect objects...

Updated clusters and tracks associated to the tau to better reflect objects used in tau reconstruction
parent 4cd48938
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( eflowRec )
......@@ -11,7 +11,7 @@ atlas_add_component( eflowRec
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives Identifier xAODBase xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib ICaloTrkMuIdTools)
LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives Identifier xAODBase xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib ICaloTrkMuIdTools tauRecToolsLib)
# Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "eflowRec/PFTauFlowElementAssoc.h"
......@@ -7,6 +7,7 @@
#include "xAODTau/TauTrack.h"
#include "xAODPFlow/FlowElementContainer.h"
#include "xAODPFlow/FlowElement.h"
#include "tauRecTools/HelperFunctions.h"
typedef ElementLink<xAOD::TauJetContainer> TauJetLink_t;
typedef ElementLink<xAOD::FlowElementContainer> FELink_t;
......@@ -72,10 +73,16 @@ StatusCode PFTauFlowElementAssoc::execute(const EventContext &ctx) const {
// Loop over the taus
for (const xAOD::TauJet* tau : *tauNeutralFEWriteDecorHandle) {
// Get tau vertex
const xAOD::Vertex* tauVertex = tauRecTools::getTauVertex(*tau);
// Get the clusters associated to the tau
std::vector< ElementLink<xAOD::IParticleContainer> > tauClusters = tau->clusterLinks();
for (auto clusLink : tauClusters) {
const xAOD::IParticle* clus = *clusLink;
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());
// Check if the cluster is within R = 0.2 of tau axis
if (vertexedClus.p4().DeltaR(tau->p4(xAOD::TauJetParameters::IntermediateAxis)) > 0.2) continue;
// Get the index of the cluster associated to the tau
size_t tauClusterIndex = clus->index();
......@@ -105,7 +112,7 @@ StatusCode PFTauFlowElementAssoc::execute(const EventContext &ctx) const {
// Loop over the taus
for (const xAOD::TauJet* tau : *tauChargedFEWriteDecorHandle) {
// Get tau tracks associated to the tau
std::vector<const xAOD::TauTrack*> tauTracks = tau->tracks(xAOD::TauJetParameters::coreTrack);
std::vector<const xAOD::TauTrack*> tauTracks = tau->tracks();
for (auto tauTrack : tauTracks) {
// Get track associated to the tau track to use for matching
const xAOD::TrackParticle* tauIDTrack = tauTrack->track();
......
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