Index: trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 7004)
+++ trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 7005)
@@ -79,17 +79,10 @@
 
 MMcCalibrationUpdate::MMcCalibrationUpdate(const char *name, const char *title)
+  :  fFillCalibrationCam(kTRUE), fOuterPixelsGainScaling(kTRUE), fAmplitude(-1.), 
+     fAmplitudeOuter(-1.), fConversionHiLo(-1.), fUserLow2HiGainFactor(-1.), 
+     fSignalType(MCalibrateData::kPhe)
 {
     fName  = name  ? name  : "MMcCalibrationUpdate";
     fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container";
-
-
-    fAmplitude = -1.;
-    fAmplitudeOuter = -1.;
-    fConversionHiLo = -1.;
-
-    fSignalType = MCalibrateData::kPhot;
-
-    fFillCalibrationCam = kTRUE;
-    fOuterPixelsGainScaling = kTRUE;
 }
 
@@ -194,5 +187,22 @@
 	  {
 	    fAmplitudeOuter = fHeaderFadc->GetAmplitudOuter();
-	    fConversionHiLo = fHeaderFadc->GetLow2HighGain();
+
+	    fHeaderLow2HiGainFactor = fHeaderFadc->GetLow2HighGain();
+
+	    // The high to low gain ratio is stored in MMcFadcHeader.Low2HighGain. 
+	    // However, this is just the ratio of total pulse integrals. Since the 
+	    // shape of the low gain pulse is different from that of the high gain,
+	    // the factor to be applied to signals extracted from low gain depends
+	    // on the type of signal extractor (for instance if we extract the pulse 
+	    // height, the factor is larger than Low2HighGain, because the low gain
+	    // pulse shape is wider and hence lower than the high gain pulse. So the 
+	    // user can set manually the value of the factor to be applied. If such 
+	    // value has not been set by the user, then we takes as default Low2HighGain.
+
+	    if (fUserLow2HiGainFactor < 0.)
+	      fConversionHiLo = fHeaderLow2HiGainFactor;
+	    else
+	      fConversionHiLo = fUserLow2HiGainFactor;
+
 	  }
 	else // old MC files, camera  < v0.7
@@ -203,5 +213,5 @@
 
     }
-    else   // Check that following files have all the same FADC parameters
+    else   // Check that the following files have all the same FADC parameters as the first
     {
       if ( fabs(fHeaderFadc->GetAmplitud()-fAmplitude) > 1.e-6 )
@@ -211,8 +221,8 @@
 	}
 
-      if (mcrunh->GetCamVersion() > 60) // old MC files, camera < v0.7
+      if (mcrunh->GetCamVersion() > 60) // files from camera 0.7 or newer
 	{
 	  if( fabs(fHeaderFadc->GetAmplitudOuter()-fAmplitudeOuter) > 1.e-6  ||
-	      fabs(fConversionHiLo-fHeaderFadc->GetLow2HighGain())  > 1.e-6 )
+	      fabs(fHeaderLow2HiGainFactor-fHeaderFadc->GetLow2HighGain()) > 1.e-6 )
 	    {
 	      *fLog << err << "Parameters of MMcFadcHeader are not the same for all files... aborting." << endl;
Index: trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h	(revision 7004)
+++ trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h	(revision 7005)
@@ -42,5 +42,9 @@
     Float_t fAmplitude;      // FADC parameters from camera simulation (see camera manual)
     Float_t fAmplitudeOuter; // to be read from the MMcFadcHeader.
-    Float_t fConversionHiLo; // Ratio of high to low gain.
+    Float_t fConversionHiLo; // Ratio of high to low gain to be used for low gain signal calibration.
+
+    Float_t fHeaderLow2HiGainFactor; // Ratio of high to low gain, as read from the MMcFadcHeader
+    Float_t fUserLow2HiGainFactor;   // Ratio of high to low gain, as set manually by the user
+
 
     Float_t fOuterPixelsLightCollection; 
@@ -58,4 +62,6 @@
       { fOuterPixelsGainScaling = tf; }
 
+    void SetUserLow2HiGainFactor(Float_t x) { fUserLow2HiGainFactor = x; }
+
     void SetSignalType (MCalibrateData::SignalType_t x) { fSignalType = x; }
     MCalibrateData::SignalType_t GetSignalType () const { return fSignalType; }
