From 764131f0f79cb1c3dba9eb1010da793fade4fde6 Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <zviwood@gmail.com>
Date: Sun, 15 Apr 2012 22:09:01 -0400
Subject: [PATCH] Make gHcDetectorMap global available

---
 src/THcDetectorMap.cxx | 6 +++---
 src/THcGlobals.h       | 3 ++-
 src/THcHodoscope.cxx   | 4 +++-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/THcDetectorMap.cxx b/src/THcDetectorMap.cxx
index 7614167..7cb72aa 100644
--- a/src/THcDetectorMap.cxx
+++ b/src/THcDetectorMap.cxx
@@ -42,9 +42,9 @@ THcDetectorMap::~THcDetectorMap()
 {
 }
 
-//bool THcDetectorMap::compare(const ChaninMod *first, const ChaninMod *second) {
-//      return((first->channel < second->channel)? true: false);
-//}
+bool THcDetectorMap::compare(const ChaninMod *first, const ChaninMod *second) {
+      return((first->channel < second->channel)? true: false);
+}
 struct Functor
 {
   bool operator() (const THcDetectorMap::ChaninMod &first, const THcDetectorMap::ChaninMod &second)
diff --git a/src/THcGlobals.h b/src/THcGlobals.h
index 39b40da..c18bf53 100644
--- a/src/THcGlobals.h
+++ b/src/THcGlobals.h
@@ -6,8 +6,9 @@
 #include "DllImport.h"
 #endif
 
-// Global Analyzer variables. Defined in THaInterface implementation file.
+// Global Analyzer variables. Defined in THcInterface implementation file.
 
 R__EXTERN class THcParmList*  gHcParms;      //List of global symbolic variables
+R__EXTERN class THcDetectorMap*  gHcDetectorMap;   //Cached map file
 
 #endif
diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx
index 221dab6..1fc80f6 100644
--- a/src/THcHodoscope.cxx
+++ b/src/THcHodoscope.cxx
@@ -10,6 +10,8 @@
 #include "THcHodoscope.h"
 #include "THaEvData.h"
 #include "THaDetMap.h"
+#include "THcDetectorMap.h"
+#include "THcGlobals.h"
 #include "VarDef.h"
 #include "VarType.h"
 #include "THaTrack.h"
@@ -69,7 +71,7 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date )
   // maximum number of hits after setting up the detector map
 
   THcHitList::InitHitList(fDetMap, "THcHodoscopeHit", 100);
-  if( gHcDetectorMap->FillMap("detectorname",fDetMap) < 0 ) {
+  if( gHcDetectorMap->FillMap(fDetMap, "detectorname") < 0 ) {
       Error( Here(here), "Error filling detectormap for %s.", 
 	     "detectorname");
       return kInitError;
-- 
GitLab