From c37fb81d172107d92caf560ff90e3d39fa465e48 Mon Sep 17 00:00:00 2001
From: Vardan Tadevosyan <tadevosn@jlab.org>
Date: Thu, 16 May 2013 08:59:46 -0400
Subject: [PATCH] Replaced constant ped. limits in the ShowerPlane by the read
 from hcal.param.

---
 examples/PARAM/hcal.param | 120 +-------------------------------------
 examples/hodtest.C        |   4 +-
 src/THcShower.cxx         |  36 ++++++------
 src/THcShower.h           |  19 ++++--
 src/THcShowerPlane.cxx    |  37 +++++++++---
 5 files changed, 63 insertions(+), 153 deletions(-)
 mode change 100644 => 120000 examples/PARAM/hcal.param

diff --git a/examples/PARAM/hcal.param b/examples/PARAM/hcal.param
deleted file mode 100644
index 614215e..0000000
--- a/examples/PARAM/hcal.param
+++ /dev/null
@@ -1,119 +0,0 @@
-; Slop in x position.  Allowed distance between track and edge of block (in cm)
-; too tight djm hcal_slop = 7.5
-hcal_slop = 7.5
-
-;Turn on HMS cal. fiducial volume cut. 0="no cut"
-;Default hcal_fv_test=0
-
-hcal_fv_test = 0
-
-hcal_pos_cal_const =0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005
-                    0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005
-                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
-                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
-
-hcal_neg_cal_const =0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005
-                    0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005,0.0005
-                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
-                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
-
-hcal_pos_gain_ini  =1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-
-hcal_neg_gain_ini  =1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-
-hcal_pos_gain_cur  =1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-
-hcal_neg_gain_cur  =1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
-
-;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-hcal_pos_ped_limit =1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-
-hcal_neg_ped_limit =1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
-
-;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-; Calibration constants for run   48816,  35730 events processed
-;
-;hcal_pos_gain_cor= 0.454, 0.272, 0.377, 0.437, 0.367, 0.471, 0.371, 0.480, 0.382, 0.453, 0.306, 0.337, 0.300,
-;                   0.264, 0.451, 0.324, 0.300, 0.356, 0.358, 0.331, 0.391, 0.319, 0.309, 0.401, 0.450, 0.263,
-;                   0.746, 0.743, 0.703, 0.881, 0.760, 0.720, 0.636, 0.671, 1.003, 0.791, 0.607, 0.696, 0.817,
-;                   1.147, 0.920, 0.753, 0.829, 0.869, 0.876, 0.915, 0.899, 0.983, 0.763, 0.806, 0.915, 0.663,
-;hcal_neg_gain_cor= 0.413, 0.827, 0.455, 0.366, 0.368, 0.403, 0.463, 0.402, 0.364, 0.371, 0.352, 0.534, 0.372,
-;                   0.475, 0.365, 0.446, 0.552, 0.454, 0.445, 0.418, 0.427, 0.457, 0.365, 0.377, 0.395, 0.416,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-
-; Calibration constants for run   49064,  28202 events processed
-
-;hcal_pos_gain_cor= 0.374, 0.368, 0.364, 0.336, 0.298, 0.424, 0.395, 0.452, 0.415, 0.000, 0.000, 0.000, 0.000,
-;                   0.311, 0.275, 0.234, 0.263, 0.312, 0.316, 0.264, 0.292, 0.624, 0.000, 0.000, 0.000, 0.000,
-;                   0.938, 0.668, 0.617, 0.785, 0.634, 0.624, 0.501, 0.568, 1.060, 0.000, 0.000, 0.000, 0.000,
-;                   0.047, 0.759, 0.725, 0.785, 0.833, 0.881, 0.938, 0.920, 1.856, 0.000, 0.000, 0.000, 0.000,
-;hcal_neg_gain_cor= 0.391, 0.328, 0.357, 0.367, 0.314, 0.243, 0.353, 0.328, 0.241, 0.000, 0.000, 0.000, 0.000,
-;                   0.364, 0.450, 0.484, 0.563, 0.436, 0.442, 0.402, 0.453, 0.104, 0.000, 0.000, 0.000, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-
-; Calibration constants for run   49098,  23159 events processed
-
-;hcal_pos_gain_cor= 0.344, 0.427, 0.342, 0.355, 0.291, 0.568, 0.536, 0.387, 0.000, 0.000, 0.000, 0.000, 0.000,
-;                   0.292, 0.319, 0.228, 0.295, 0.372, 0.436, 0.220, 0.392, 0.586, 0.000, 0.000, 0.000, 0.000,
-;                   0.938, 0.648, 0.625, 0.808, 0.636, 0.659, 0.544, 0.533, 1.229, 0.000, 0.000, 0.000, 0.000,
-;                   0.033, 0.769, 0.720, 0.886, 0.823, 0.925, 0.880, 1.089, 0.000, 0.000, 0.000, 0.000, 0.000,
-;hcal_neg_gain_cor= 0.454, 0.301, 0.380, 0.370, 0.341, 0.099, 0.246, 0.474, 0.000, 0.000, 0.000, 0.000, 0.000,
-;                   0.412, 0.430, 0.542, 0.606, 0.400, 0.355, 0.515, 0.378, 0.804, 0.000, 0.000, 0.000, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-
-
-; the following lines are from calibration file
-; written by the perlscript mkcalpar.prl
-
-;hcal_pos_gain_cor= 0.000, 0.328, 0.240, 0.482, 0.202, 0.397, 0.279, 0.327, 0.270, 0.299, 0.297, 0.309, 0.000,
-;                   0.000, 0.375, 0.317, 0.389, 0.390, 0.171, 0.274, 0.383, 0.310, 0.323, 0.297, 0.606, 1.168,
-;                   0.000, 0.744, 0.618, 0.853, 0.732, 0.674, 0.532, 0.646, 0.710, 0.714, 0.484, 0.773, 0.000,
-;                   0.000, 0.000, 0.684, 0.596, 0.716, 0.692, 0.694, 0.595, 0.806, 0.640, 0.841, 0.000, 0.000,
-;hcal_neg_gain_cor= 0.000, 0.167, 0.372, 0.317, 0.255, 0.279, 0.376, 0.338, 0.336, 0.315, 0.295, 0.277, 0.000,
-;                   0.000, 0.246, 0.366, 0.471, 0.359, 0.549, 0.435, 0.427, 0.399, 0.298, 0.313, 0.342, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-
-
-hcal_pos_gain_cor= 0.973,0.775,0.814,0.839,0.638,0.72,0.699,0.74,0.794,0.805,0.658,0.694,0.604
-                  0.794,0.756,0.688,0.719,0.791,0.795,0.715,0.879,0.744,0.725,0.8,1.129,0.424
-                  0.716,0.66,0.623,0.899,0.682,0.764,0.609,0.641,0.924,0.835,0.55,0.671,0.888
-                  1.468,0.754,0.789,1.015,0.869,1.083,1.148,0.962,1.236,0.745,0.949,1.004,0.892
-hcal_neg_gain_cor= 0.864,0.672,0.749,0.755,0.657,0.600,1.056,0.996,0.693,0.876,0.717,0.726,0.662
-                  0.694,0.826,0.818,1.009,0.829,0.781,0.848,0.796,0.779,0.668,0.762,0.742,0.842
-                  0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000
-                  0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000
-;
-; Calibration constants for run   63504,  51956 events processed
-
-;hcal_pos_gain_cor= 0.335, 0.316, 0.367, 0.498, 0.366, 0.363, 0.408, 0.451, 0.380, 0.473, 0.369, 0.416, 0.287,
-;                   0.417, 0.388, 0.361, 0.363, 0.314, 0.384, 0.349, 0.411, 0.356, 0.339, 0.412, 0.591, 0.286,
-;                   0.677, 0.707, 0.675, 0.986, 0.793, 0.760, 0.649, 0.725, 0.748, 0.876, 0.611, 0.706, 0.989,
-;                   1.011, 0.648, 0.685, 0.871, 0.791, 0.939, 1.035, 0.865, 0.967, 0.758, 0.866, 0.856, 0.504,
-;hcal_neg_gain_cor= 0.490, 0.429, 0.436, 0.402, 0.349, 0.249, 0.435, 0.455, 0.378, 0.408, 0.332, 0.299, 0.394,
-;                   0.415, 0.480, 0.446, 0.630, 0.555, 0.460, 0.497, 0.514, 0.487, 0.449, 0.408, 0.486, 0.348,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-;                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
diff --git a/examples/PARAM/hcal.param b/examples/PARAM/hcal.param
new file mode 120000
index 0000000..71fec94
--- /dev/null
+++ b/examples/PARAM/hcal.param
@@ -0,0 +1 @@
+../../analyzer_mdual/replay/PARAM/hcal.param
\ No newline at end of file
diff --git a/examples/hodtest.C b/examples/hodtest.C
index dc58902..7f31ff5 100644
--- a/examples/hodtest.C
+++ b/examples/hodtest.C
@@ -65,8 +65,8 @@
   // the pedestal events
   //  run->SetEventRange(1,2000);//  Physics Event number, does not
                                 // include scaler or control events
-  //  run->SetEventRange(1,999999);
-  run->SetEventRange(1,1);
+  run->SetEventRange(1,999999);
+  //  run->SetEventRange(1,1);
 
   // Define the analysis parameters
   analyzer->SetEvent( event );
diff --git a/src/THcShower.cxx b/src/THcShower.cxx
index fca64ee..8ffb015 100644
--- a/src/THcShower.cxx
+++ b/src/THcShower.cxx
@@ -204,36 +204,36 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
   cout << "Total number of blocks in he calorimeter: " << fNtotBlocks << endl;
 
   //Pedestal limits from hcal.param.
-  fCalPosPedLimit = new Int_t [fNtotBlocks];
-  fCalNegPedLimit = new Int_t [fNtotBlocks];
+  fShPosPedLimit = new Int_t [fNtotBlocks];
+  fShNegPedLimit = new Int_t [fNtotBlocks];
 
   //Calibration constants
-  fCalPosCalConst = new Double_t [fNtotBlocks];
-  fCalNegCalConst = new Double_t [fNtotBlocks];
+  fPosCalConst = new Double_t [fNtotBlocks];
+  fNegCalConst = new Double_t [fNtotBlocks];
 
   //Read in parameters from hcal.param
   Double_t hcal_pos_cal_const[fNtotBlocks];
   //  Double_t hcal_pos_gain_ini[fNtotBlocks];
   //  Double_t hcal_pos_gain_cur[fNtotBlocks];
-  Int_t    hcal_pos_ped_limit[fNtotBlocks];
+  //  Int_t    hcal_pos_ped_limit[fNtotBlocks];
   Double_t hcal_pos_gain_cor[fNtotBlocks];
 
   Double_t hcal_neg_cal_const[fNtotBlocks];
   //  Double_t hcal_neg_gain_ini[fNtotBlocks];
   //  Double_t hcal_neg_gain_cur[fNtotBlocks];
-  Int_t    hcal_neg_ped_limit[fNtotBlocks];
+  //  Int_t    hcal_neg_ped_limit[fNtotBlocks];
   Double_t hcal_neg_gain_cor[fNtotBlocks];
 
   DBRequest list[]={
     {"cal_pos_cal_const", hcal_pos_cal_const, kDouble, fNtotBlocks},
     //    {"cal_pos_gain_ini",  hcal_pos_gain_ini,  kDouble, fNtotBlocks},
     //    {"cal_pos_gain_cur",  hcal_pos_gain_cur,  kDouble, fNtotBlocks},
-    {"cal_pos_ped_limit", hcal_pos_ped_limit, kInt,    fNtotBlocks},
+    {"cal_pos_ped_limit", fShPosPedLimit, kInt,    fNtotBlocks},
     {"cal_pos_gain_cor",  hcal_pos_gain_cor,  kDouble, fNtotBlocks},
     {"cal_neg_cal_const", hcal_neg_cal_const, kDouble, fNtotBlocks},
     //    {"cal_neg_gain_ini",  hcal_neg_gain_ini,  kDouble, fNtotBlocks},
     //    {"cal_neg_gain_cur",  hcal_neg_gain_cur,  kDouble, fNtotBlocks},
-    {"cal_neg_ped_limit", hcal_neg_ped_limit, kInt,    fNtotBlocks},
+    {"cal_neg_ped_limit", fShNegPedLimit, kInt,    fNtotBlocks},
     {"cal_neg_gain_cor",  hcal_neg_gain_cor,  kDouble, fNtotBlocks},
     {0}
   };
@@ -265,10 +265,10 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
   //    cout <<  endl;
   //  };
 
-  cout << "hcal_pos_ped_limit:" << endl;
+  cout << "fShPosPedLimit:" << endl;
   for (Int_t j=0; j<fNLayers; j++) {
     for (Int_t i=0; i<fNBlocks[j]; i++) {
-      cout << hcal_pos_ped_limit[j*fNBlocks[j]+i] << " ";
+      cout << fShPosPedLimit[j*fNBlocks[j]+i] << " ";
     };
     cout <<  endl;
   };
@@ -307,10 +307,10 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
   //    cout <<  endl;
   //  };
 
-  cout << "hcal_neg_ped_limit:" << endl;
+  cout << "fShNegPedLimit:" << endl;
   for (Int_t j=0; j<fNLayers; j++) {
     for (Int_t i=0; i<fNBlocks[j]; i++) {
-      cout << hcal_neg_ped_limit[j*fNBlocks[j]+i] << " ";
+      cout << fShNegPedLimit[j*fNBlocks[j]+i] << " ";
     };
     cout <<  endl;
   };
@@ -326,22 +326,22 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
   //Calibration constants in GeV per ADC channel.
 
   for (Int_t i=0; i<fNtotBlocks; i++) {
-    fCalPosCalConst[i] = hcal_pos_cal_const[i] *  hcal_pos_gain_cor[i];
-    fCalNegCalConst[i] = hcal_neg_cal_const[i] *  hcal_neg_gain_cor[i];
+    fPosCalConst[i] = hcal_pos_cal_const[i] *  hcal_pos_gain_cor[i];
+    fNegCalConst[i] = hcal_neg_cal_const[i] *  hcal_neg_gain_cor[i];
   }
 
-  cout << "fCalPosCalConst:" << endl;
+  cout << "fPosCalConst:" << endl;
   for (Int_t j=0; j<fNLayers; j++) {
     for (Int_t i=0; i<fNBlocks[j]; i++) {
-      cout << fCalPosCalConst[j*fNBlocks[j]+i] << " ";
+      cout << fPosCalConst[j*fNBlocks[j]+i] << " ";
     };
     cout <<  endl;
   };
 
-  cout << "fCalNegCalConst:" << endl;
+  cout << "fNegCalConst:" << endl;
   for (Int_t j=0; j<fNLayers; j++) {
     for (Int_t i=0; i<fNBlocks[j]; i++) {
-      cout << fCalNegCalConst[j*fNBlocks[j]+i] << " ";
+      cout << fNegCalConst[j*fNBlocks[j]+i] << " ";
     };
     cout <<  endl;
   };
diff --git a/src/THcShower.h b/src/THcShower.h
index 808271a..0c3e63b 100644
--- a/src/THcShower.h
+++ b/src/THcShower.h
@@ -37,19 +37,28 @@ public:
   Int_t GetNBlocks(Int_t plane) const { return fNBlocks[plane-1];}
   friend class THaScCalib;
 
+  Int_t fGetPedLimit(Int_t NBlock, Int_t NLayer, Int_t Side) {
+    if (Side!=0&&Side!=1) {
+      cout << "*** Wrong Side in fGetPedLimit:" << Side << " ***" << endl;
+      return -1;
+    }
+    Int_t nelem = NBlock+NLayer*fNBlocks[NLayer];
+    return ( Side == 0 ? fShPosPedLimit[nelem] : fShNegPedLimit[nelem]);
+  }
+
   THcShower();  // for ROOT I/O
 
 protected:
 
   Int_t fAnalyzePedestals;
 
-  // Number of events for pedestal calculations.
-  Int_t* fCalPosPedLimit;
-  Int_t* fCalNegPedLimit;
+  // ADC signal limits for pedestal calculations.
+  Int_t* fShPosPedLimit;
+  Int_t* fShNegPedLimit;
 
   // Calibration constants
-  Double_t* fCalPosCalConst;
-  Double_t* fCalNegCalConst;
+  Double_t* fPosCalConst;
+  Double_t* fNegCalConst;
 
   // Per-event data
 
diff --git a/src/THcShowerPlane.cxx b/src/THcShowerPlane.cxx
index 0afc59c..c370149 100644
--- a/src/THcShowerPlane.cxx
+++ b/src/THcShowerPlane.cxx
@@ -58,6 +58,7 @@ THcShowerPlane::~THcShowerPlane()
   delete [] fA_Neg_p;
 
 }
+
 THaAnalysisObject::EStatus THcShowerPlane::Init( const TDatime& date )
 {
   // Extra initialization for shower layer: set up DataDest map
@@ -107,6 +108,9 @@ Int_t THcShowerPlane::ReadDatabase( const TDatime& date )
 
   fNelem = fParent->GetNBlocks(fLayerNum);
 
+  //  cout << "THcShowerPlane::ReadDatabase: fLayerNum=" << fLayerNum 
+  //       << "  fNelem=" << fNelem << endl;
+
   fA_Pos = new Float_t[fNelem];
   fA_Neg = new Float_t[fNelem];
   fA_Pos_p = new Float_t[fNelem];
@@ -127,9 +131,26 @@ Int_t THcShowerPlane::ReadDatabase( const TDatime& date )
   
   // Create arrays to hold results here
 
- InitializePedestals();
+  fPosPedLimit = new Int_t [fNelem];
+  fNegPedLimit = new Int_t [fNelem];
+
+  for(Int_t i=0;i<fNelem;i++) {
+    fPosPedLimit[i] = fParent->fGetPedLimit(i,fLayerNum,0);
+    fNegPedLimit[i] = fParent->fGetPedLimit(i,fLayerNum,1);
+  }
+
+  cout << "   fPosPedLimit:";
+  for(Int_t i=0;i<fNelem;i++) cout << " " << fPosPedLimit[i];
+  cout << endl;
+  cout << "   fNegPedLimit:";
+  for(Int_t i=0;i<fNelem;i++) cout << " " << fNegPedLimit[i];
+  cout << endl;
+
+  InitializePedestals();
+
   return kOK;
 }
+
 //_____________________________________________________________________________
 Int_t THcShowerPlane::DefineVariables( EMode mode )
 {
@@ -171,6 +192,7 @@ Int_t THcShowerPlane::Decode( const THaEvData& evdata )
 
   return 0;
 }
+
 //_____________________________________________________________________________
 Int_t THcShowerPlane::CoarseProcess( TClonesArray& tracks )
 {
@@ -185,6 +207,7 @@ Int_t THcShowerPlane::FineProcess( TClonesArray& tracks )
 {
   return 0;
 }
+
 Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
 {
   // Extract the data for this layer from hit list
@@ -240,6 +263,7 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
   }
   return(ihit);
 }
+
 //_____________________________________________________________________________
 Int_t THcShowerPlane::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
 {
@@ -282,9 +306,8 @@ Int_t THcShowerPlane::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
 
   return(ihit);
 }
-
     
- //_____________________________________________________________________________
+//_____________________________________________________________________________
 void THcShowerPlane::CalculatePedestals( )
 {
   // Use the accumulated pedestal data to calculate pedestals
@@ -317,11 +340,11 @@ void THcShowerPlane::InitializePedestals( )
   fMinPeds = 500; 		// In engine, this is set in parameter file
   fPosPedSum = new Int_t [fNelem];
   fPosPedSum2 = new Int_t [fNelem];
-  fPosPedLimit = new Int_t [fNelem];
+  //  fPosPedLimit = new Int_t [fNelem];
   fPosPedCount = new Int_t [fNelem];
   fNegPedSum = new Int_t [fNelem];
   fNegPedSum2 = new Int_t [fNelem];
-  fNegPedLimit = new Int_t [fNelem];
+  //  fNegPedLimit = new Int_t [fNelem];
   fNegPedCount = new Int_t [fNelem];
 
   fPosSig = new Double_t [fNelem];
@@ -333,13 +356,9 @@ void THcShowerPlane::InitializePedestals( )
   for(Int_t i=0;i<fNelem;i++) {
     fPosPedSum[i] = 0;
     fPosPedSum2[i] = 0;
-    fPosPedLimit[i] = 1000;	// In engine, this are set in parameter file
     fPosPedCount[i] = 0;
     fNegPedSum[i] = 0;
     fNegPedSum2[i] = 0;
-    fNegPedLimit[i] = 1000;	// In engine, this are set in parameter file
     fNegPedCount[i] = 0;
   }
 } 
-  
-
-- 
GitLab