From 437dd1e18d68b35648519586bfc31fba3c0bf96e Mon Sep 17 00:00:00 2001
From: Atlas-Software Librarian <Atlas-Software.Librarian@cern.ch>
Date: Fri, 8 Apr 2016 15:57:15 +0200
Subject: [PATCH] 'CMakeLists.txt' (CommissionRec-00-02-06)

	* src/ComTimeRec.cxx (execute): Fix logic issue introduced in
	previous tag where TrackRecordCollection was never
	retrieved. ATLASSIM-1867.
	* tag CommissionRec-00-02-06
---
 Commission/CommissionRec/CMakeLists.txt     | 29 +++++++++++++++++++++
 Commission/CommissionRec/src/ComTimeRec.cxx | 10 +++----
 2 files changed, 34 insertions(+), 5 deletions(-)
 create mode 100644 Commission/CommissionRec/CMakeLists.txt

diff --git a/Commission/CommissionRec/CMakeLists.txt b/Commission/CommissionRec/CMakeLists.txt
new file mode 100644
index 00000000000..4fb77c0f1b5
--- /dev/null
+++ b/Commission/CommissionRec/CMakeLists.txt
@@ -0,0 +1,29 @@
+################################################################################
+# Package: CommissionRec
+################################################################################
+
+# Declare the package name:
+atlas_subdir( CommissionRec )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          Commission/CommissionUtils
+                          Control/AthenaBaseComps
+                          GaudiKernel
+                          PRIVATE
+                          Commission/CommissionEvent
+                          Simulation/G4Sim/TrackRecord )
+
+# External dependencies:
+find_package( CLHEP )
+
+# Component(s) in the package:
+atlas_add_component( CommissionRec
+                     src/*.cxx
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} CommissionUtilsLib AthenaBaseComps GaudiKernel CommissionEvent )
+
+# Install files from the package:
+atlas_install_headers( CommissionRec )
+
diff --git a/Commission/CommissionRec/src/ComTimeRec.cxx b/Commission/CommissionRec/src/ComTimeRec.cxx
index a509dfdab41..6a1570302e6 100755
--- a/Commission/CommissionRec/src/ComTimeRec.cxx
+++ b/Commission/CommissionRec/src/ComTimeRec.cxx
@@ -78,16 +78,16 @@ StatusCode ComTimeRec::execute()
 
     // Use the Timed Track Record of the muon entering the cavern.
 
-    // const TimedTrackRecordCollection* coll;
-    const TrackRecordCollection *coll(NULL);
-    if(evtStore()->contains<TrackRecordCollection>(m_TTRKey) ){
-      ATH_MSG_ERROR( " can not retrieve TTR with key " << m_TTRKey );
+    if(!evtStore()->contains<TrackRecordCollection>(m_TTRKey) ){
+      ATH_MSG_ERROR( " can not retrieve TrackRecordCollection with key " << m_TTRKey );
       // Put default ComTime into SG for.
       ComTime *theComTime = new ComTime();
       CHECK( evtStore()->record(theComTime, m_comTimeKey) );
       return StatusCode::SUCCESS;
     }
-
+    // const TimedTrackRecordCollection* coll;
+    const TrackRecordCollection *coll(NULL);
+    CHECK( evtStore()->retrieve(coll, m_TTRKey) );
     int    nMuons           = 0;
     double earliestMuonTime = -1.;
     // TimedTrackRecord* earliestMuon=NULL;
-- 
GitLab