From 2e4a8972434b7273822b181e30ef8155d4c69d39 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 13 May 2019 15:31:28 +0200
Subject: [PATCH] TrigCaloRec: Avoid EventContext TLS lookups.

Don't fetch EventContext from thread-local storage if we already have
it as an argument.
---
 .../TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx   | 2 +-
 .../TrigCaloRec/src/HLTCaloCellSumMaker.cxx               | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx
index 0b7ca1ab7f0..c91155fe022 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx
@@ -49,7 +49,7 @@ StatusCode HLTCaloCellMaker::initialize() {
 StatusCode HLTCaloCellMaker::execute( const EventContext& context ) const {
 
 
-  auto roisHandle = SG::makeHandle( m_roiCollectionKey );
+  auto roisHandle = SG::makeHandle( m_roiCollectionKey, context );
   const TrigRoiDescriptorCollection* roiCollection = roisHandle.cptr();
 
   // datahandle 
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellSumMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellSumMaker.cxx
index 873b4471cc9..947a9282665 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellSumMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellSumMaker.cxx
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+ *   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
  *   */
 
  /*
@@ -36,13 +36,13 @@ StatusCode HLTCaloCellSumMaker::initialize() {
         return StatusCode::SUCCESS;
 }
 
-StatusCode HLTCaloCellSumMaker::execute( const EventContext& /*context*/ ) const {
+StatusCode HLTCaloCellSumMaker::execute( const EventContext& context ) const {
 
 
   if ( m_roiMode ) {
   int cc=0;
   // datahandle
-  auto roisHandle = SG::makeHandle( m_cellContainerKey );
+  auto roisHandle = SG::makeHandle( m_cellContainerKey, context );
   const CaloCellContainer* roiCollection = roisHandle.cptr();
   if ( !roiCollection ){
   	ATH_MSG_INFO( "empty container"); 
@@ -53,7 +53,7 @@ StatusCode HLTCaloCellSumMaker::execute( const EventContext& /*context*/ ) const
   ATH_MSG_INFO ( "Executing " << name() << "..." << "RoIToSum Single : " << cc << " " << sum );
 
   } else {
-  auto roisHandle = SG::makeHandle( m_cellContainerVKey );
+  auto roisHandle = SG::makeHandle( m_cellContainerVKey, context );
   const ConstDataVector<CaloCellContainerVector>* roiCollection = roisHandle.cptr();
 
   int cc=0;
-- 
GitLab