Skip to content
Snippets Groups Projects
Commit 99b555da authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'master-tau-fe-link-update' into 'master'

Updates to tau-flow element links

See merge request !42238
parents bdf5d46b 304b9178
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!42238Updates to tau-flow element links
# 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: # Declare the package name:
atlas_subdir( eflowRec ) atlas_subdir( eflowRec )
...@@ -11,7 +11,7 @@ atlas_add_component( eflowRec ...@@ -11,7 +11,7 @@ atlas_add_component( eflowRec
src/*.cxx src/*.cxx
src/components/*.cxx src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} 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: # Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) 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" #include "eflowRec/PFTauFlowElementAssoc.h"
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "xAODTau/TauTrack.h" #include "xAODTau/TauTrack.h"
#include "xAODPFlow/FlowElementContainer.h" #include "xAODPFlow/FlowElementContainer.h"
#include "xAODPFlow/FlowElement.h" #include "xAODPFlow/FlowElement.h"
#include "tauRecTools/HelperFunctions.h"
typedef ElementLink<xAOD::TauJetContainer> TauJetLink_t; typedef ElementLink<xAOD::TauJetContainer> TauJetLink_t;
typedef ElementLink<xAOD::FlowElementContainer> FELink_t; typedef ElementLink<xAOD::FlowElementContainer> FELink_t;
...@@ -72,10 +73,16 @@ StatusCode PFTauFlowElementAssoc::execute(const EventContext &ctx) const { ...@@ -72,10 +73,16 @@ StatusCode PFTauFlowElementAssoc::execute(const EventContext &ctx) const {
// Loop over the taus // Loop over the taus
for (const xAOD::TauJet* tau : *tauNeutralFEWriteDecorHandle) { for (const xAOD::TauJet* tau : *tauNeutralFEWriteDecorHandle) {
// Get tau vertex
const xAOD::Vertex* tauVertex = tauRecTools::getTauVertex(*tau);
// Get the clusters associated to the tau // Get the clusters associated to the tau
std::vector< ElementLink<xAOD::IParticleContainer> > tauClusters = tau->clusterLinks(); std::vector<const xAOD::IParticle*> tauClusters = tau->clusters();
for (auto clusLink : tauClusters) { for (auto cluster : tauClusters) {
const xAOD::IParticle* clus = *clusLink; 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 // Get the index of the cluster associated to the tau
size_t tauClusterIndex = clus->index(); size_t tauClusterIndex = clus->index();
...@@ -105,7 +112,7 @@ StatusCode PFTauFlowElementAssoc::execute(const EventContext &ctx) const { ...@@ -105,7 +112,7 @@ StatusCode PFTauFlowElementAssoc::execute(const EventContext &ctx) const {
// Loop over the taus // Loop over the taus
for (const xAOD::TauJet* tau : *tauChargedFEWriteDecorHandle) { for (const xAOD::TauJet* tau : *tauChargedFEWriteDecorHandle) {
// Get tau tracks associated to the tau // 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) { for (auto tauTrack : tauTracks) {
// Get track associated to the tau track to use for matching // Get track associated to the tau track to use for matching
const xAOD::TrackParticle* tauIDTrack = tauTrack->track(); 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