Index: trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 2886)
+++ trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 2889)
@@ -74,4 +74,8 @@
     fADC2PhOuter = 1.;
 
+    fAmplitude = -1.;
+    fAmplitudeOuter = -1.;
+    fConversionHiLo = -1.;
+
     fFillCalibrationCam = kTRUE;
 
@@ -178,4 +182,24 @@
 
     //
+    // Initialize Fadc simulation parameters:
+    //
+    if ( fAmplitude < 0. )
+      {
+	fAmplitude = fHeaderFadc->GetAmplitud();
+	fAmplitudeOuter = fHeaderFadc->GetAmplitudOuter();
+	fConversionHiLo = fHeaderFadc->GetLow2HighGain();
+      }
+    else   // Check that following files have all the same FADC parameters
+      {
+	if ( fabs(fHeaderFadc->GetAmplitud()-fAmplitude) > 1.e-6  ||
+	     fabs(fHeaderFadc->GetAmplitudOuter()-fAmplitudeOuter) > 1.e-6  ||
+	     fabs(fConversionHiLo-fHeaderFadc->GetLow2HighGain()) > 1.e-6 )
+	  {
+	    *fLog << err << endl << endl << dbginf << "Parameters of MMcFadcHeader are not the same for all the read files. Aborting..." << endl << endl;
+	    return kFALSE;
+	  }
+      }
+
+    //
     // If MCalibrationCam already existed in the parameter list before
     // MMcCalibrationUpdate::PreProcess was executed (from a 
@@ -189,11 +213,5 @@
     // Set the ADC to photons conversion factor for outer pixels:
     //
-    fADC2PhOuter = fADC2PhInner *
-      (fHeaderFadc->GetAmplitud() / fHeaderFadc->GetAmplitudOuter());
-
-    //
-    // Set the conversion factor between high and low gain:
-    //
-    fConversionHiLo = fHeaderFadc->GetLow2HighGain();
+    fADC2PhOuter = fADC2PhInner * (fAmplitude / fAmplitudeOuter);
 
     const int num = fCalCam->GetSize();
Index: trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h	(revision 2886)
+++ trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h	(revision 2889)
@@ -28,7 +28,11 @@
     Float_t fADC2PhInner; // Conversion factor from ADC counts to photons
     Float_t fADC2PhOuter; // for inner and outer pixels.
-    Float_t fConversionHiLo;
 
     Bool_t  fFillCalibrationCam;
+
+    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.
+
 
 public:
