Index: trunk/MagicSoft/Simulation/Detector/Camera/TOBEDONE
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/TOBEDONE	(revision 6713)
+++ trunk/MagicSoft/Simulation/Detector/Camera/TOBEDONE	(revision 6714)
@@ -3,8 +3,4 @@
 
 - Introduce correlations in the electronic noise
-
-- Change default delay of low gain pulse w.r.t. high gain (add option in input card). Make that it can have any value, not just a number of slices.
-
-- Introduce realistic time jitter of PMTs 
 
 - Make one MMcConfigRunHeader per telescope
Index: trunk/MagicSoft/Simulation/Detector/Camera/input.card
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/input.card	(revision 6713)
+++ trunk/MagicSoft/Simulation/Detector/Camera/input.card	(revision 6714)
@@ -11,5 +11,5 @@
 # The values below correspond roughly to 10 LED UV 
 #calibration_run 375. 12. 120. 2.5 5000
-calibration_run 375. 12. 120. 0.01 1
+calibration_run 375. 12. 200. 0.01 1
 # line below shows how to create a pedestal run (= cal. with 0-photon pulses):
 #calibration_run 0. 0. 0. 0. 1000
Index: trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx	(revision 6713)
+++ trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx	(revision 6714)
@@ -24,5 +24,5 @@
 	     Float_t trigger_delay, Float_t fadc_slices_per_ns,
 	     Int_t fadc_slices_written, Int_t gainswitchamp,
-	     Int_t shiftfromswitch2lowgain, Int_t hi2logainpeak) {
+	     Int_t shiftfromswitch2lowgain, Float_t hi2logainpeak) {
   //
   //  Constructor overloaded II 
@@ -213,4 +213,6 @@
     p5_LG = fPulseParametersLG[5];
     p6_LG = fPulseParametersLG[6];
+
+    p2_LG += (fHi2LoGainPeak - fFadcSlices); // Adjust distance between high and low gain peaks
 
 
@@ -313,4 +315,6 @@
     p6_LG = fPulseParametersLG[6];
 
+    p2_LG += (fHi2LoGainPeak - fFadcSlices); // Adjust distance between high and low gain peaks
+
     for (i=0; i< fResponseSlicesFadc ; i++ )
       {
@@ -988,6 +992,4 @@
 
       // Now put the low gain:
-      // FIXME: for now, the shift between the high and low gain peaks has to be an integer number
-      // of FADC slices. But in the data the shift is ~16.5 slices. This has to be implemented.
       i=0;
       for ( Int_t is = iFirstSlice; is < (iFirstSlice+fFadcSlices); is++ ) 
@@ -997,5 +999,5 @@
 	      if (switch_i > 0 && (i+fFadcSlices) >= switch_i)
 		output_lowgain[ip][i] = pedestal[ip] + 
-		  (sig_LG[ip][is-(fHi2LoGainPeak-fFadcSlices)]-pedestal[ip])/high2low_gain;
+		  (sig_LG[ip][is]-pedestal[ip])/high2low_gain;
 	      // Once the shift occurs, low gain is filled with the high
 	      // gain signal scaled down by the factor high2low_gain
Index: trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.hxx	(revision 6713)
+++ trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.hxx	(revision 6714)
@@ -120,5 +120,5 @@
   // By default it is now 13 slices (see constructor)
 
-  Int_t fHi2LoGainPeak;
+  Float_t fHi2LoGainPeak;
   // Distance in FADC slices from the signal peak in the high gain to the signal peak in
   // the low gain. By default we set now 16 slices (see constructor).
@@ -151,5 +151,5 @@
 	Int_t   gainswitchamp = 120,
 	Int_t   shiftfromswitch2lowgain = 13,
-	Int_t   hi2logainpeak = 16);
+	Float_t hi2logainpeak = 16.5);
 
   void SetSeed(UInt_t seed)  {GenElec->SetSeed(seed);}
