From 56d3f4cf3d43bb8b218cf21b91cc194e0339a717 Mon Sep 17 00:00:00 2001
From: Buddhini Waidyawansa <buddhini@jlab.org>
Date: Mon, 5 May 2014 12:09:25 -0400
Subject: [PATCH] Added parameters for run 52947 into raster_test.database In
 raster_jun04.map, reassigned the raster channels into a single plane instead
 of different planes. This makes it easier for comparision with the engine.
 Modified raster_test.C to analyze run 52947 in the cache directory. Some
 minor clean up in the THcRaster.cxx class- removing comments and unused
 variables.

---
 examples/DBASE/raster_test.database |  6 ++++++
 examples/MAPS/raster_jun04.map      | 11 ++++++-----
 examples/raster_test.C              |  8 ++++----
 src/THcRaster.cxx                   |  9 ++-------
 4 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/examples/DBASE/raster_test.database b/examples/DBASE/raster_test.database
index cb15f86..76fef1a 100644
--- a/examples/DBASE/raster_test.database
+++ b/examples/DBASE/raster_test.database
@@ -5,6 +5,12 @@
 g_ctp_parm_filename ="PARAM/general.param"
 g_decode_map_filename ="MAPS/raster_jun04.map"
 g_ctp_kinematics_filename ="DBASE/jan05.kinematics"
+
+52947
+g_ctp_parm_filename ="PARAM/general.param"
+g_decode_map_filename ="MAPS/raster_jun04.map"
+g_ctp_kinematics_filename ="DBASE/jan05.kinematics"
+
 52426
 g_ctp_parm_filename ="DBASE/52426.param"
 g_decode_map_filename ="HCANA_MAPS/july04.map"
diff --git a/examples/MAPS/raster_jun04.map b/examples/MAPS/raster_jun04.map
index 9d37836..8f0a847 100644
--- a/examples/MAPS/raster_jun04.map
+++ b/examples/MAPS/raster_jun04.map
@@ -1980,17 +1980,18 @@ Slot= 5 ! ADC  Second set of tubes on first two layers
 !
   detector= 18 ! RASTER
 !
-! buddhini-w :To make things easier and consistent between detectors, we now use the plane and signal to identify the different raster signals 02-12-2014
+! buddhini-w :To make things easier and consistent between detectors, 
+! we now use the plane and signal to identify the different raster signals 02-12-2014
 !..............................................................................
 ! For raster : 0-->ADC X-sync
 !	       1-->ADC Y-signal
 !              2-->ADC Y-sync
 !              3-->ADC Y-signal
 
-  12, 1, 1, 0 !ADC ROC#1 Sl#13 Ch#12 Fast Raster X-sync
-  13, 1, 1, 1 !ADC ROC#1 Sl#13 Ch#13 Fast Raster X-signal
-  14, 1, 1, 2 !ADC ROC#1 Sl#13 Ch#14 Fast Raster Y-sync
-  15, 1, 1, 3 !ADC ROC#1 Sl#13 Ch#15 Fast Raster Y-signal
+  12, 2, 1, 0 !ADC ROC#1 Sl#13 Ch#12 Fast Raster X-sync
+  13, 2, 1, 1 !ADC ROC#1 Sl#13 Ch#13 Fast Raster X-signal
+  14, 2, 1, 2 !ADC ROC#1 Sl#13 Ch#14 Fast Raster Y-sync
+  15, 2, 1, 3 !ADC ROC#1 Sl#13 Ch#15 Fast Raster Y-signal
 !
   detector= 6 ! GMISC
 !
diff --git a/examples/raster_test.C b/examples/raster_test.C
index b707af6..a28f414 100644
--- a/examples/raster_test.C
+++ b/examples/raster_test.C
@@ -5,9 +5,9 @@
   //  Steering script to test raster signal decoding
   //
   
-  Int_t RunNumber=50017;
-  char* RunFileNamePattern="daq04_%d.log.0";
-  
+  Int_t RunNumber=52947;
+  char* RunFileNamePattern="/cache/mss/hallc/daq04/raw/daq04_52947.log.0";
+    
  
   // Open the database
   //
@@ -90,7 +90,7 @@
   // Define the analysis parameters
   //
   analyzer->SetEvent(event);
-  analyzer->SetOutFile("raster_test.root");
+  analyzer->SetOutFile("raster_compare_52947.root");
   analyzer->SetOdefFile("output_bpw.def");
   analyzer->SetCutFile("hodtest_cuts.def");        // optional
   analyzer->SetCountMode(2);// Counter event number same as gen_event_ID_number
diff --git a/src/THcRaster.cxx b/src/THcRaster.cxx
index 0d8aa4c..de128f3 100644
--- a/src/THcRaster.cxx
+++ b/src/THcRaster.cxx
@@ -280,8 +280,7 @@ Int_t THcRaster::Decode( const THaEvData& evdata )
 //_____________________________________________________________________________
 Int_t THcRaster::Process( ){
 
-  Double_t tmp = 0;
-  Double_t eBeam = 0;
+  Double_t eBeam = 0.001;
   /*
     calculate raster position from ADC value.
     From ENGINE/g_analyze_misc.f -
@@ -301,14 +300,10 @@ Int_t THcRaster::Process( ){
     gfrx = (gfrx_adc/gfrx_adcpercm)*(gfr_cal_mom/ebeam)
     gfry = (gfry_adc/gfry_adcpercm)*(gfr_cal_mom/ebeam)
   */
-  // bpw- Iam not sure how to access the global variables. the below code doesnt work. so for now, hard code the beam energy.
-  eBeam=0.0001;
+ 
   if(gHcParms->Find("gpbeam")){
     eBeam=*(Double_t *)gHcParms->Find("gpbeam")->GetValuePointer();
   }
-  //  cout <<"e Beam  = "<< eBeam << " " << fgpbeam << endl;
-  
-  //  eBeam = 4.02187;
   fXpos = (fXADC/fFrXADCperCM)*(fFrCalMom/eBeam);
   fYpos = (fYADC/fFrYADCperCM)*(fFrCalMom/eBeam);
 
-- 
GitLab