From 7807024e896de423fbfce5da5eb95cd0a1041337 Mon Sep 17 00:00:00 2001
From: Zafar Ahmed <zahmed@jlab.org>
Date: Sat, 16 May 2015 16:13:44 -0400
Subject: [PATCH] Global variables are  added for efficiency calculation.

---
 src/THcDC.cxx                | 3 +++
 src/THcDC.h                  | 1 +
 src/THcDriftChamber.cxx      | 2 ++
 src/THcScintillatorPlane.cxx | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/src/THcDC.cxx b/src/THcDC.cxx
index f1e8290..d714583 100644
--- a/src/THcDC.cxx
+++ b/src/THcDC.cxx
@@ -346,6 +346,7 @@ Int_t THcDC::DefineVariables( EMode mode )
   // Register variables in global list
 
   RVarDef vars[] = {
+    { "stubtest", "stub test",  "fStubTest" },
     { "nhit", "Number of DC hits",  "fNhits" },
     { "tnhit", "Number of good DC hits",  "fNthits" },
     { "trawhit", "Number of true raw DC hits", "fN_True_RawHits" },
@@ -422,6 +423,7 @@ inline
 void THcDC::ClearEvent()
 {
   // Reset per-event data.
+  fStubTest = 0;
   fNhits = 0;
   fNthits = 0;
   fN_True_RawHits=0;
@@ -695,6 +697,7 @@ void THcDC::LinkStubs()
 	       && (TMath::Abs(dposyp) < fYptTrCriterion)) {
 	      if(newtrack) {
 		assert(sptracks==0);
+		fStubTest = 1;
 		//stubtest=1;  Used in h_track_tests.f
 		// Make a new track if there are not to many
 		if(fNDCTracks < MAXTRACKS) {
diff --git a/src/THcDC.h b/src/THcDC.h
index 71bd496..d11f233 100644
--- a/src/THcDC.h
+++ b/src/THcDC.h
@@ -103,6 +103,7 @@ protected:
                                 // Was used for SOS in ENGINE.
 
   // Per-event data
+  Int_t fStubTest;
   Int_t fNhits;
   Int_t fNthits;
   Int_t fN_True_RawHits;
diff --git a/src/THcDriftChamber.cxx b/src/THcDriftChamber.cxx
index b9ed691..95906b6 100644
--- a/src/THcDriftChamber.cxx
+++ b/src/THcDriftChamber.cxx
@@ -224,6 +224,8 @@ Int_t THcDriftChamber::DefineVariables( EMode mode )
   // Register variables in global list
 
    RVarDef vars[] = {
+     { "maxhits",     "Maximum hits allowed",    "fMaxHits" },
+     { "spacepoints", "Space points of DC",      "fNSpacePoints" },
      { "nhit", "Number of DC hits",  "fNhits" },
      { "trawhit", "Number of True Raw hits", "fN_True_RawHits" },
      { 0 }
diff --git a/src/THcScintillatorPlane.cxx b/src/THcScintillatorPlane.cxx
index f56ef15..01f1ae6 100644
--- a/src/THcScintillatorPlane.cxx
+++ b/src/THcScintillatorPlane.cxx
@@ -232,6 +232,8 @@ Int_t THcScintillatorPlane::DefineVariables( EMode mode )
      "frNegADCHits.THcSignalHit.GetPaddleNumber()"},
     //    {"fptime", "Time at focal plane", 
     //     "GetFpTime()"},
+    {"nhits", "Number of hits",      
+     "GetNScinHits() "},
     { 0 }
   };
 
-- 
GitLab