Index: equalization_gain/trunk/src/PlotScurvesAll-diffFit.cc
===================================================================
--- equalization_gain/trunk/src/PlotScurvesAll-diffFit.cc	(revision 202)
+++ equalization_gain/trunk/src/PlotScurvesAll-diffFit.cc	(revision 203)
@@ -775,5 +775,5 @@
 {
   if(DEBUG)
-    cout << " START Analysis Constructor " << endl;
+    cout << " >>>>>>> START Analysis Constructor " << endl;
 
  /*********************** SIGNAL RUN ********************/
@@ -791,5 +791,5 @@
 
  if(DEBUG)
-    cout << " END Analysis Constructor " << endl;
+    cout << " >>>>>>> END Analysis Constructor " << endl;
 }
 //--------------------------------------------------------------------------------------------------------
@@ -803,5 +803,5 @@
  
  if(DEBUG)
-    cout << " START Analysis Destructor " << endl;
+    cout << " >>>>>>> START Analysis Destructor " << endl;
 
   if(input!=0) delete input;
@@ -809,5 +809,5 @@
 
 if(DEBUG)
-    cout << " END Analysis Destructor " << endl;
+    cout << " >>>>>>> END Analysis Destructor " << endl;
 
 }
@@ -855,5 +855,5 @@
 if(DEBUG)
 {
-    cout << " START Analysis::PlotScurve " << endl;
+    cout << " >>>>>>> START Analysis::PlotScurve " << endl;
     cout << " \t - kDrawCh = " << kDrawCh << endl;
     cout << " \t - fname = " << fname << endl;
@@ -901,5 +901,5 @@
 
 if(DEBUG)
-    cout << " END Analysis::PlotSCurve " << endl;
+    cout << " >>>>>>> END Analysis::PlotSCurve " << endl;
 
 }
@@ -914,8 +914,8 @@
 
 if(DEBUG)
-    cout << " START Analysis::Init " << endl;
-
-  if(input!=0) delete input;
-  if(input_ped!=0) delete input_ped;
+    cout << " >>>>>>> START Analysis::Init " << endl;
+
+//if(input!=0) delete input;
+//if(input_ped!=0) delete input_ped;
 
   // recreate the name 
@@ -966,5 +966,5 @@
 
 if(DEBUG)
-    cout << " END Analysis::Init " << endl;
+    cout << " >>>>>>> END Analysis::Init " << endl;
 
   
@@ -978,5 +978,5 @@
 {
 if(DEBUG)
-    cout << " START Analysis::OpenGainFile " << endl;
+    cout << " >>>>>>> START Analysis::OpenGainFile " << endl;
 
 
@@ -992,5 +992,5 @@
 
 if(DEBUG)
-    cout << " END Analysis::OpenGainFile " << endl;
+    cout << " >>>>>>> END Analysis::OpenGainFile " << endl;
 
 
@@ -1005,5 +1005,5 @@
 
 if(DEBUG)
-    cout << " START Analysis::FillHistoName " << endl;
+    cout << " >>>>>>> START Analysis::FillHistoName " << endl;
 
 
@@ -1026,5 +1026,5 @@
 
 if(DEBUG)
-    cout << " END Analysis::FillHistoName " << endl;
+    cout << " >>>>>>> END Analysis::FillHistoName " << endl;
 
 
@@ -1045,5 +1045,5 @@
 if(DEBUG)
 {
-    cout << " START Analysis::ReadGainFile " << endl;
+    cout << " >>>>>>> START Analysis::ReadGainFile " << endl;
     cout << " \t - fname_gain = " << fname_gain << endl;
     cout << " \t - kBoard = " << kBoard << " 0:ASIC_C, 1:ASIC_D " << endl;
@@ -1083,5 +1083,5 @@
 if(DEBUG)
 {
-    cout << " END Analysis::ReadGainFile " << endl;
+    cout << " >>>>>>> END Analysis::ReadGainFile " << endl;
    	
 }
@@ -1114,5 +1114,5 @@
 if(DEBUG)
 {
-  cout << " START Analysis::ProcessSingleChannel ch=" << ch << endl;
+  cout << " >>>>>>> START Analysis::ProcessSingleChannel ch=" << ch << endl;
     cout << " \t - kDrawCh = " << kDrawCh << endl;
     cout << " \t - fname = " << fname << endl;
@@ -1488,5 +1488,5 @@
 if(DEBUG)
 {
-    cout << " END Analysis::ProcessSingleChannel " << endl;   	
+    cout << " >>>>>>> END Analysis::ProcessSingleChannel " << endl;   	
 }
     
@@ -1504,5 +1504,5 @@
 if(DEBUG)
 {
-  cout << " START Analysis::ComputeDACAverage " << endl;
+  cout << " >>>>>>> START Analysis::ComputeDACAverage " << endl;
  
     cout << " \t - dac_half_spe_fix = " << dac_half_spe_fix << endl; 
@@ -1575,9 +1575,5 @@
 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;	
+  cout << " >>>>>>> END Analysis::ComputeDACAverage " << endl;	
 }
  
@@ -1593,5 +1589,5 @@
 if(DEBUG)
 {
-  cout << " START Analysis::OutputGain " << endl;
+  cout << " >>>>>>> START Analysis::OutputGain " << endl;
   cout << " \t - fname_out = " << fname_out << endl; 	
 }
@@ -1656,9 +1652,75 @@
 if(DEBUG)
 {
-  cout << " END Analysis::OutputGain " << endl;	
-}
-
-
-}
+  cout << " >>>>>>> END Analysis::OutputGain " << endl;	
+}
+
+
+}
+//--------------------------------------------------------------------------------------------------------
+
+
+
+
+
+
+
+//--------------------------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------------------------
+void Analysis::Help()
+{
+
+  cout << "This is the Help of the PlotScurveAll-diffFit" <<endl;
+  cout << " Version 2.0 from September 27 2013 " <<endl;
+  cout << " Main author Hiroko Miyamoto " << endl;
+  cout << " Adapted for modularity and compilable program by Sylvie Dagoret " << endl;
+  cout << " ==> Please from shell execute directly the compiled program :  " <<endl;
+  cout << " ==> ../../src/PlotScurvesAllMain  " << endl;
+   
+}
+//--------------------------------------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------------------------
+void Analysis::Menu()
+{
+ cout << "This is the Detailed menu information for running the PlotScurveAll-diffFit" <<endl;
+
+ cout << " void PlotScurve( " << endl;
+ cout << " \t " <<  " Int_t    kDrawCh=31, " << endl;
+ cout << " \t " <<  " TString  fname=kFname, " << endl;
+ cout << " \t " <<  " TString  fname_ped=kFnamePed, //ASIC_D ped_file " << endl;
+ cout << " \t " <<  " Double_t dac_half_spe_fix = -1," << endl;
+ cout << " \t " <<  " TString  fname_gain=\"gain-org.txt\"," << endl;
+ cout << " \t " <<  " Int_t    fit_min=kFitMin," << endl;
+ cout << " \t " <<  " Int_t    fit_max=kFitMax," << endl;
+ cout << " \t " <<  " Int_t    fit_min_scurve=kFitMinS," << endl;
+ cout << " \t " <<  " Int_t    fit_max_scurve=kFitMaxS," << endl;
+ cout << " \t " <<  " Bool_t   kBoard=1, //0:ASIC_C, 1:ASIC_D " << endl;
+ cout << " \t " <<  " Int_t    kChRef=kRefCh,//ASIC_C " << endl;
+ cout << " \t " <<  " Bool_t   checkAve=0 //0:use ref pix, 1:check average " << endl;
+ cout << " ) " << endl;		
+ cout << "Set the parameters on the top of the program depending on your analysis:  " << endl;
+ cout << "General policy: parameters starting with a \"k\" at the beginning is fixed gloval parameter and usually set in the header file, never change through the program. " << endl;
+ cout << " : " << endl;
+ cout << " - kDrawCh: channel just you want to check on display. doens't effect the analysis. " << endl;
+ 
+ cout << " - fname, fname_ped (kFname, kFnamePed): \"YOUR DATA FILE\" without .data"  << endl;
+ cout << " See examples in the header file. " << endl;
+ cout << " - dac_half_spe_fix: set DAC value only when you want to adjust the gain to particular pulse height (DAC value) instead of either average of the pulse height of reference pixel. Usually just leave it -1. " << endl;
+ cout << " - fit_min, fit_max (kFitMin, kFitMax): leave them as default, it is not currently used for the analysis."  << endl;
+ cout << " - fit_min_scurve, fit_max_scurve (kFitMinS, kFitMaxS): define the range of s-curve fitting. search proper values by yourself with running root program a few times."  << endl;
+ cout << " - kBoard: don't forget to change 0(C) or 1(D) depending on which ASIC you're analysing "  << endl;
+ cout << " - kChRef (kRefCh): a pixel whose gain remains 64 thorough the gain adjustment. " << endl;
+ cout << " - checkAve: for the first run, set this parameter 1, and find a pixel which remains 64. In the case of parameter 1, all the gains are adjusted to the average pulse height. " << endl;
+   cout <<  " Once you choose the reference pixel, set the parameter 0, as well as set kRefCh the pixel number. (better to keep in the header file for the record of each PMTs.) " << endl;
+
+   cout << " Actual configuration " << endl;
+   cout << " \t " <<  "TString kFname = " << kFname << endl;
+   cout << " \t " <<  "TString  kFnamePed = " << kFnamePed  << endl;
+   cout << " \t " <<  "Int_t kFitMin = " << kFitMin << endl; 
+   cout << " \t " <<  "Int_t kFitMax = " << kFitMax << endl;
+
+}
+
 //-------------------------------------------------------------------------------------------------
 // Configure (x)emacs for this file ...
Index: equalization_gain/trunk/src/PlotScurvesAll-diffFit.h
===================================================================
--- equalization_gain/trunk/src/PlotScurvesAll-diffFit.h	(revision 202)
+++ equalization_gain/trunk/src/PlotScurvesAll-diffFit.h	(revision 203)
@@ -47,5 +47,7 @@
   // Main analysis function to be called from outside
 
-void PlotScurve(
+  void Menu();
+  void Help();
+  void PlotScurve(
 		Int_t    kDrawCh=31,
 		TString  fname=kFname,
Index: equalization_gain/trunk/src/PlotScurvesAllMain.cc
===================================================================
--- equalization_gain/trunk/src/PlotScurvesAllMain.cc	(revision 202)
+++ equalization_gain/trunk/src/PlotScurvesAllMain.cc	(revision 203)
@@ -20,11 +20,14 @@
    TRint *theApp=new TRint("ROOT-PlotScurvesAll",&argc,argv);
     
-   //Help();
    
-   PlotScurve();
+   // SDC (27/09/2013) :: Old fashion of calling the function directly
+   //PlotScurve();
 
-   // to debug
-   //Analysis* pa = new Analysis;
-   //pa->PlotScurve();
+   // SDC (27/09/2013) :: class analysis working now 
+   Analysis* ana = new Analysis;
+
+   ana->Help();
+   ana->Menu();
+   ana->PlotScurve();
 
     theApp->Run();
