From 7a0a683ebf91cbada18fd6b99c23b8185d85ce5c Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <saw@jlab.org>
Date: Tue, 13 Mar 2012 14:48:28 -0400
Subject: [PATCH] Start of a Hall C analyzer class

---
 Makefile            |  2 +-
 src/HallC_LinkDef.h |  1 +
 src/THcAnalyzer.cxx | 67 +++++++++++++++++++++++++++++++++++++++++++++
 src/THcAnalyzer.h   | 29 ++++++++++++++++++++
 4 files changed, 98 insertions(+), 1 deletion(-)
 create mode 100644 src/THcAnalyzer.cxx
 create mode 100644 src/THcAnalyzer.h

diff --git a/Makefile b/Makefile
index 03a70d5..ed2a5c5 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@
 # there must be a corresponding header file (*.h).
 
 
-SRC  =  src/THcInterface.cxx src/THcParmList.cxx
+SRC  =  src/THcInterface.cxx src/THcParmList.cxx src/THcAnalyzer.cxx
 
 # Name of your package. 
 # The shared library that will be built will get the name lib$(PACKAGE).so
diff --git a/src/HallC_LinkDef.h b/src/HallC_LinkDef.h
index ef0afab..6508840 100644
--- a/src/HallC_LinkDef.h
+++ b/src/HallC_LinkDef.h
@@ -8,5 +8,6 @@
 
 #pragma link C++ class THcInterface+;
 #pragma link C++ class THcParmList+;
+#pragma link C++ class THcAnalyzer+;
 
 #endif
diff --git a/src/THcAnalyzer.cxx b/src/THcAnalyzer.cxx
new file mode 100644
index 0000000..a667d80
--- /dev/null
+++ b/src/THcAnalyzer.cxx
@@ -0,0 +1,67 @@
+//*-- Author :    Stephen Wood  13-March-2012
+
+//////////////////////////////////////////////////////////////////////////
+//
+// THcAnalyzer
+//
+// THcAnalyzer is the base class for a "Hall C analyzer" class.
+// An analyzer defines the basic actions to perform during analysis.
+// THcAnalyzer is the default analyzer that is used if no user class is
+// defined.  It performs a standard analysis consisting of
+//
+//   1. Decoding/Calibrating
+//   2. Track Reconstruction
+//   3. Physics variable processing
+//
+// At the end of each step, testing and histogramming are done for
+// the appropriate block defined in the global test/histogram lists.
+//
+// Hall C has their own analyzer class because some things are bound to
+// be different.
+//
+//////////////////////////////////////////////////////////////////////////
+
+#include "THcAnalyzer.h"
+#include "THaBenchmark.h"
+#include "TList.h"
+
+#include <fstream>
+#include <algorithm>
+#include <iomanip>
+#include <cstring>
+
+using namespace std;
+
+
+// Pointer to single instance of this object
+//THcAnalyzer* THcAnalyzer::fgAnalyzer = 0;
+
+//FIXME: 
+// do we need to "close" scalers/EPICS analysis if we reach the event limit?
+
+//_____________________________________________________________________________
+THcAnalyzer::THcAnalyzer()
+{
+
+  THaAnalyzer();
+ 
+}
+
+//_____________________________________________________________________________
+THcAnalyzer::~THcAnalyzer()
+{
+  // Destructor. 
+
+  Close();
+  delete fPostProcess;  //deletes PostProcess objects
+  delete fBench;
+  delete [] fStages;
+  delete [] fCounters;
+  if( fgAnalyzer == this )
+    fgAnalyzer = NULL;
+}
+
+//_____________________________________________________________________________
+
+ClassImp(THcAnalyzer)
+
diff --git a/src/THcAnalyzer.h b/src/THcAnalyzer.h
new file mode 100644
index 0000000..172d125
--- /dev/null
+++ b/src/THcAnalyzer.h
@@ -0,0 +1,29 @@
+#ifndef ROOT_THcAnalyzer
+#define ROOT_THcAnalyzer
+
+//////////////////////////////////////////////////////////////////////////
+//
+// THcAnalyzer
+// 
+//////////////////////////////////////////////////////////////////////////
+
+#include "THaAnalyzer.h"
+
+class THcAnalyzer : public THaAnalyzer {
+
+public:
+
+  THcAnalyzer();
+  virtual ~THcAnalyzer();
+
+protected:
+    
+private:
+  //  THcAnalyzer( const THcAnalyzer& );
+  //  THcAnalyzer& operator=( const THcAnalyzer& );
+  
+  ClassDef(THcAnalyzer,0)  //Hall C Analyzer Standard Event Loop
+
+};
+
+#endif
-- 
GitLab