Index: equalization_gain/trunk/src/PlotScurvesAll-diffFit.cc
===================================================================
--- equalization_gain/trunk/src/PlotScurvesAll-diffFit.cc	(revision 201)
+++ equalization_gain/trunk/src/PlotScurvesAll-diffFit.cc	(revision 202)
@@ -774,6 +774,6 @@
 Analysis::Analysis():ch(0),dac_half_sum(0),dac_spe_sum(0),dac_sfit_sum(0),diff_sum(0),mean_sum(0),maxBinSum(0) 
 {
- 
-  cout << " analysis initialisation " << endl;
+  if(DEBUG)
+    cout << " START Analysis Constructor " << endl;
 
  /*********************** SIGNAL RUN ********************/
@@ -790,5 +790,6 @@
   maxBinSum         = 0;
 
-
+ if(DEBUG)
+    cout << " END Analysis Constructor " << endl;
 }
 //--------------------------------------------------------------------------------------------------------
@@ -801,7 +802,12 @@
 {
  
+ if(DEBUG)
+    cout << " START Analysis Destructor " << endl;
+
   if(input!=0) delete input;
   if(input_ped!=0) delete input_ped;
 
+if(DEBUG)
+    cout << " END Analysis Destructor " << endl;
 
 }
@@ -847,4 +853,21 @@
 {
 
+if(DEBUG)
+{
+    cout << " START Analysis::PlotScurve " << endl;
+    cout << " \t - kDrawCh = " << kDrawCh << endl;
+    cout << " \t - fname = " << fname << endl;
+    cout << " \t - fname_ped = " << fname_ped <<endl;
+    cout << " \t - dac_half_spe_fix = " << dac_half_spe_fix << endl;
+
+    cout << " \t - fname_gain = " << fname_gain << endl;
+    cout << " \t - fit_min = " << fit_min << endl;
+    cout << " \t - fit_max = " << fit_max << endl;
+    cout << " \t - fit_min_scurve = " << fit_min_scurve << endl;
+    cout << " \t - fit_max_scurve = " << fit_max_scurve << endl;
+    cout << " \t - kBoard = " << kBoard << " 0:ASIC_C, 1:ASIC_D " << endl;
+    cout << " \t - kChRef = " << kChRef << " ASIC_C " << endl;
+    cout << " \t - checkAve = " << checkAve << " 0:use ref pix, 1:check average " << endl;	
+}
   // reset all variables
   Init();
@@ -877,5 +900,6 @@
   OutputGain(kFnameOut);
 
-
+if(DEBUG)
+    cout << " END Analysis::PlotSCurve " << endl;
 
 }
@@ -888,4 +912,7 @@
 void Analysis::Init()
 {
+
+if(DEBUG)
+    cout << " START Analysis::Init " << endl;
 
   if(input!=0) delete input;
@@ -938,4 +965,6 @@
  }
 
+if(DEBUG)
+    cout << " END Analysis::Init " << endl;
 
   
@@ -948,4 +977,9 @@
 void Analysis::OpenGainFile(const TString fname_gain)
 {
+if(DEBUG)
+    cout << " START Analysis::OpenGainFile " << endl;
+
+
+
   TString input_gain(fname_gain);
   ifstream in_gain(input_gain.Data());
@@ -957,4 +991,8 @@
   in_gain.clear();
 
+if(DEBUG)
+    cout << " END Analysis::OpenGainFile " << endl;
+
+
 }
 //--------------------------------------------------------------------------------------------------------
@@ -965,4 +1003,9 @@
 void Analysis::FillHistoName()
 {
+
+if(DEBUG)
+    cout << " START Analysis::FillHistoName " << endl;
+
+
   
 // first loop on channels to fill histonames
@@ -982,4 +1025,9 @@
   }
 
+if(DEBUG)
+    cout << " END Analysis::FillHistoName " << endl;
+
+
+
 }
 //--------------------------------------------------------------------------------------------------------
@@ -994,4 +1042,15 @@
 void Analysis::ReadGainFile(const TString fname_gain,Bool_t kBoard)
 {
+
+if(DEBUG)
+{
+    cout << " START Analysis::ReadGainFile " << endl;
+    cout << " \t - fname_gain = " << fname_gain << endl;
+    cout << " \t - kBoard = " << kBoard << " 0:ASIC_C, 1:ASIC_D " << endl;
+   	
+}
+
+
+
   TString input_gain(fname_gain);
   ifstream in_gain(input_gain.Data());
@@ -1022,4 +1081,9 @@
   in_gain.clear();
  
+if(DEBUG)
+{
+    cout << " END Analysis::ReadGainFile " << endl;
+   	
+}
 
 }
@@ -1046,4 +1110,26 @@
 				    )
 {
+
+
+if(DEBUG)
+{
+  cout << " START Analysis::ProcessSingleChannel ch=" << ch << endl;
+    cout << " \t - kDrawCh = " << kDrawCh << endl;
+    cout << " \t - fname = " << fname << endl;
+    cout << " \t - fname_ped = " << fname_ped <<endl;
+    cout << " \t - dac_half_spe_fix = " << dac_half_spe_fix << endl;
+
+    cout << " \t - fname_gain = " << fname_gain << endl;
+    cout << " \t - fit_min = " << fit_min << endl;
+    cout << " \t - fit_max = " << fit_max << endl;
+    cout << " \t - fit_min_scurve = " << fit_min_scurve << endl;
+    cout << " \t - fit_max_scurve = " << fit_max_scurve << endl;
+    cout << " \t - kBoard = " << kBoard << " 0:ASIC_C, 1:ASIC_D " << endl;
+    cout << " \t - kChRef = " << kChRef << " ASIC_C " << endl;
+    //    cout << " \t - checkAve = " << checkAve << " 0:use ref pix, 1:check average " << endl;L	
+}
+
+
+
     input[ch] += fname;
     input[ch] += "-ch";
@@ -1398,15 +1484,30 @@
       hist_scurve_ped[ch].Draw("lsame");
     }
+
+
+if(DEBUG)
+{
+    cout << " END Analysis::ProcessSingleChannel " << endl;   	
+}
     
   }// end of process single  channels
-
 //---------------------------------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------------------------------
-
+// Compute some averages
 //---------------------------------------------------------------------------------------------------
 void Analysis::ComputeDACAverage(Double_t dac_half_spe_fix ,Int_t    kChRef, Bool_t   checkAve )//0:use ref pix, 1:check average
 {
+
+
+if(DEBUG)
+{
+  cout << " START Analysis::ComputeDACAverage " << endl;
+ 
+    cout << " \t - dac_half_spe_fix = " << dac_half_spe_fix << endl; 
+    cout << " \t - kChRef = " << kChRef << " ASIC_C " << endl;
+    cout << " \t - checkAve = " << checkAve << " 0:use ref pix, 1:check average " << endl;	
+}
 
  // SDC 24/09/2013 :: In a compiled program, I have to declare the following variables outside the parenthesis
@@ -1472,4 +1573,12 @@
   ldac_ped_ave_copy->Draw("same");
 
+if(DEBUG)
+{
+  cout << " END Analysis::ComputeDACAverage " << endl;
+ 
+    cout << " \t - dac_half_spe_fix = " << dac_half_spe_fix << endl; 
+    cout << " \t - kChRef = " << kChRef << " ASIC_C " << endl;
+    cout << " \t - checkAve = " << checkAve << " 0:use ref pix, 1:check average " << endl;	
+}
  
 
@@ -1481,4 +1590,10 @@
 void Analysis::OutputGain(const TString fname_out)
 {
+
+if(DEBUG)
+{
+  cout << " START Analysis::OutputGain " << endl;
+  cout << " \t - fname_out = " << fname_out << endl; 	
+}
 
  ofstream out(fname_out.Data()); 
@@ -1539,3 +1654,15 @@
   out.close();
 
-}
+if(DEBUG)
+{
+  cout << " END Analysis::OutputGain " << endl;	
+}
+
+
+}
+//-------------------------------------------------------------------------------------------------
+// Configure (x)emacs for this file ...
+// Local Variables:
+// mode: c++
+// compile-command: "(make;) "
+// End:
Index: equalization_gain/trunk/src/PlotScurvesAll-diffFit.h
===================================================================
--- equalization_gain/trunk/src/PlotScurvesAll-diffFit.h	(revision 201)
+++ equalization_gain/trunk/src/PlotScurvesAll-diffFit.h	(revision 202)
@@ -162,2 +162,8 @@
 #endif
 
+//-------------------------------------------------------------------------------------------------
+// Configure (x)emacs for this file ...
+// Local Variables:
+// mode: c++
+// compile-command: "(make;) "
+// End:
Index: equalization_gain/trunk/src/PlotScurvesAll-diffFitConst.h
===================================================================
--- equalization_gain/trunk/src/PlotScurvesAll-diffFitConst.h	(revision 201)
+++ equalization_gain/trunk/src/PlotScurvesAll-diffFitConst.h	(revision 202)
@@ -35,4 +35,6 @@
 */
 
+
+const int DEBUG=1;
 
 /*** signal file ***/
@@ -140,2 +142,8 @@
 
 #endif
+//-------------------------------------------------------------------------------------------------
+// Configure (x)emacs for this file ...
+// Local Variables:
+// mode: c++
+// compile-command: "(make;) "
+// End:
Index: equalization_gain/trunk/src/PlotScurvesAllMain.cc
===================================================================
--- equalization_gain/trunk/src/PlotScurvesAllMain.cc	(revision 201)
+++ equalization_gain/trunk/src/PlotScurvesAllMain.cc	(revision 202)
@@ -30,2 +30,9 @@
     theApp->Run();
 }
+
+//-------------------------------------------------------------------------------------------------
+// Configure (x)emacs for this file ...
+// Local Variables:
+// mode: c++
+// compile-command: "(make;) "
+// End:
