From 9f2f50db4ff57bd1628c24e80f72dd259b89c75d Mon Sep 17 00:00:00 2001
From: Carlos Yero <cyero002@fiu.edu>
Date: Tue, 25 Apr 2017 15:22:03 -0400
Subject: [PATCH] Modified THcHallCSpectrometer to avoid segmentation faults
 when Hodoscope apparatus not defined.

---
 src/THcHallCSpectrometer.cxx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/THcHallCSpectrometer.cxx b/src/THcHallCSpectrometer.cxx
index da226d0..7cea33b 100644
--- a/src/THcHallCSpectrometer.cxx
+++ b/src/THcHallCSpectrometer.cxx
@@ -357,11 +357,11 @@ Int_t THcHallCSpectrometer::FindVertices( TClonesArray& tracks )
 
   }
 
-  if ( ( fSelUsingScin == 0 ) && ( fSelUsingPrune == 0 ) ) {
+  if (fHodo==0 || ( fSelUsingScin == 0 ) && ( fSelUsingPrune == 0 ) ) {
     BestTrackSimple();
-  } else if (fSelUsingPrune !=0) {
+  } else if (fHodo!=0 && fSelUsingPrune !=0) {
     BestTrackUsingPrune();
-  } else {
+  } else if (fHodo!=0){
     BestTrackUsingScin();
   }
 
@@ -560,6 +560,8 @@ Int_t THcHallCSpectrometer::BestTrackUsingScin()
 //_____________________________________________________________________________
 Int_t THcHallCSpectrometer::BestTrackUsingPrune()
 {
+
+
   Int_t nGood;
   Double_t chi2Min;
 
-- 
GitLab