Index: trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx	(revision 6695)
+++ trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx	(revision 6710)
@@ -227,4 +227,5 @@
     fadc_time_offset = trigger_delay - p2 / FADC_SLICES_PER_NSEC; // ns
 
+
     for (i=0; i< fResponseSlicesFadc ; i++ )
       {
@@ -241,13 +242,17 @@
 				   p3+p4*exp(-p1*(exp(-p1*zed_slices)+
 						  p5*zed_slices))+p6*d);
+	response_sum_inner += sing_resp[i];
+
+
+	// Now the low gain:
 
 	zed_slices = x * FADC_SLICES_PER_NSEC - p2_LG;
 	d = (zed_slices>0)? 0.5 : -0.5;
+
 	sing_resp_lowgain[i] =  (Float_t) (p0_LG*exp(-p1_LG*(exp(-p1_LG*zed_slices)+zed_slices))+
-					   p3+p4*exp(-p1_LG*(exp(-p1_LG*zed_slices)+
-							  p5*zed_slices))+p6*d);
-
-	response_sum_inner += sing_resp[i];
+					   p3_LG+p4_LG*exp(-p1_LG*(exp(-p1_LG*zed_slices)+
+							  p5_LG*zed_slices))+p6_LG*d);
 	response_sum_inner_LG += sing_resp_lowgain[i];
+
       }
 
@@ -268,5 +273,4 @@
     sigma = fwhm_resp_outer / 2.35 ; 
     x0 = 3*sigma ; 
-    fadc_time_offset = trigger_delay-x0; // ns
     
     for (i = 0; i < fResponseSlicesFadc ; i++ ) 
@@ -309,16 +313,4 @@
     p6_LG = fPulseParametersLG[6];
 
-    // Now define the time before trigger to read FADC signal when it
-    // has to be written. Here FADC_SLICES_PER_NSEC (=0.3) is the value
-    // for the 300 MHz MAGIC FADCs and must NOT be changed, even if you
-    // use a faster sampling in the simulation (through the input card 
-    // command "fadc_GHz"), because this is just a conversion of units. The
-    // parameters of the "pulpo" pulse shape were obtained with the 300 MHz
-    // FADC and so we convert the time parameter to units of 3.3 ns slices 
-    // just to use the provided parametrization, and no matter what sampling 
-    // frequency we are simulating!
-
-    fadc_time_offset = trigger_delay - p2 / FADC_SLICES_PER_NSEC; // ns
-
     for (i=0; i< fResponseSlicesFadc ; i++ )
       {
@@ -336,12 +328,15 @@
 					p4*exp(-p1*(exp(-p1*zed_slices)+
 						    p5*zed_slices))+p6*d);
+	response_sum_outer += sing_resp_outer[i];
+
+
+	// Now the low gain:
 
 	zed_slices = x * FADC_SLICES_PER_NSEC - p2_LG;
 	d = (zed_slices>0)? 0.5 : -0.5;
+
 	sing_resp_outer_lowgain[i] =  (Float_t) (p0_LG*exp(-p1_LG*(exp(-p1_LG*zed_slices)+zed_slices))+
-						 p3+p4*exp(-p1_LG*(exp(-p1_LG*zed_slices)+
-								   p5*zed_slices))+p6*d);
-
-	response_sum_outer += sing_resp_outer[i];
+						 p3_LG+p4_LG*exp(-p1_LG*(exp(-p1_LG*zed_slices)+
+								   p5_LG*zed_slices))+p6_LG*d);
 	response_sum_outer_LG += sing_resp_outer_lowgain[i];
       }
@@ -492,5 +487,5 @@
     // We take the pulse height in the middle of FADC slices, we start in the
     // first such point after the time "time" (=ichan in response bins). Each
-    // FADC slice corresponds to SUBBINS response bins (SUBBINS=5 by default).
+    // FADC slice corresponds to SUBBINS response bins.
 
     Int_t first_i =  Int_t(SUBBINS/2) - ichan%(Int_t)SUBBINS;
