Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9624)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9625)
@@ -19,4 +19,15 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2010/08/06 Thomas Bretz
+
+   * msimcamera/MSimCamera.[h,cc]:
+     - added the possibility to set an overall baseline, baseline-noise
+       and gain.
+
+   * ceres.rc:
+     - added entries for the new values
+
+
+
  2010/07/28 Daniela Dorner
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 9624)
+++ trunk/MagicSoft/Mars/NEWS	(revision 9625)
@@ -38,4 +38,10 @@
      has been implemented to set an artificial run-number:
         ---run-number=12345
+
+   * The baseline, the baseline noise and the gain (multiplicator to the
+     pulse) are now accessible from the outside. The new values are:
+        MSimCamera.DefaultOffset
+        MSimCamera.DefaultNoise
+        MSimCamera.DefaultGain
 
  ;star:
Index: trunk/MagicSoft/Mars/ceres.rc
===================================================================
--- trunk/MagicSoft/Mars/ceres.rc	(revision 9624)
+++ trunk/MagicSoft/Mars/ceres.rc	(revision 9625)
@@ -233,4 +233,18 @@
 #MPulseShape.Function.Xmax:   45
 
+# Old values
+# Baseline at 15 like in MAGIC
+# 1.5 bit noise for a gain of 64
+# This allows a maximum of 200phe/pix
+MSimCamera.DefaultOffset: 960
+MSimCamera.DefaultNoise:   96
+MSimCamera.DefaultGain:   256
+
+# New values
+#MSimCamera.DefaultOffset: 1000
+#MSimCamera.DefaultNoise:    30
+#MSimCamera.DefaultGain:    190
+
+
 # -------------------------------------------------------------------------
 # Setup an image cleaning on the pure gamma signal (without noise)
Index: trunk/MagicSoft/Mars/msimcamera/MSimCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/msimcamera/MSimCamera.cc	(revision 9624)
+++ trunk/MagicSoft/Mars/msimcamera/MSimCamera.cc	(revision 9625)
@@ -74,5 +74,7 @@
 MSimCamera::MSimCamera(const char* name, const char *title)
     : fEvt(0), fStat(0), fRunHeader(0), fElectronicNoise(0), fGain(0),
-    fCamera(0), fMcEvt(0), fSpline(0), fBaselineGain(kFALSE)
+    fCamera(0), fMcEvt(0), fSpline(0), fBaselineGain(kFALSE),
+    fDefaultOffset(-1), fDefaultNoise(-1), fDefaultGain(-1)
+
 {
     fName  = name  ? name  : "MSimCamera";
@@ -171,19 +173,23 @@
     for (int i=0; i<fElectronicNoise->GetSize(); i++)
     {
-        // 64 -> Dynamic range 12 bit left
         MPedestalPix &ped = (*fElectronicNoise)[i];
-        ped.SetPedestal(15*64);     // Baseline at 15 like in MAGIC
-        ped.SetPedestalRms(1.5*64); //2.0); // 1.5 bit noise for a gain of 64
+        if (fDefaultOffset>0)
+            ped.SetPedestal(fDefaultOffset);
+        if (fDefaultNoise>0)
+            ped.SetPedestalRms(fDefaultNoise);
+
         ped.SetPedestalABoffset(0);
         ped.SetNumEvents(0);
 
-        // 256 scale from 8bit to 16bit
-        // 8 signal height of one phe
+
         MPedestalPix &gain = (*fGain)[i];
-        gain.SetPedestal(4*64);     // This allows a maximum of 200phe/pix
+        if (fDefaultGain>0)
+            gain.SetPedestal(fDefaultGain);
+
         gain.SetPedestalRms(0);
         gain.SetPedestalABoffset(0);
         gain.SetNumEvents(0);
     }
+
     return kTRUE;
 }
@@ -302,4 +308,20 @@
     }
 
+    if (IsEnvDefined(env, prefix, "DefaultOffset", print))
+    {
+        rc = kTRUE;
+        fDefaultOffset = GetEnvValue(env, prefix, "DefaultOffset", fDefaultOffset);
+    }
+    if (IsEnvDefined(env, prefix, "DefaultNoise", print))
+    {
+        rc = kTRUE;
+        fDefaultNoise = GetEnvValue(env, prefix, "DefaultNoise", fDefaultNoise);
+    }
+    if (IsEnvDefined(env, prefix, "DefaultGain", print))
+    {
+        rc = kTRUE;
+        fDefaultGain = GetEnvValue(env, prefix, "DefaultGain", fDefaultGain);
+    }
+
     return rc;
 }
Index: trunk/MagicSoft/Mars/msimcamera/MSimCamera.h
===================================================================
--- trunk/MagicSoft/Mars/msimcamera/MSimCamera.h	(revision 9624)
+++ trunk/MagicSoft/Mars/msimcamera/MSimCamera.h	(revision 9625)
@@ -32,4 +32,8 @@
     Bool_t fBaselineGain;  // Should the gain be applied to baseline and electronic noise?
 
+    Double_t fDefaultOffset;  // Default offset added to all channels
+    Double_t fDefaultNoise;   // Default noise (RMS) added to all samples
+    Double_t fDefaultGain;    // Default gain (multiplication factor to the given/used pulse shape)
+
     // MParContainer
     Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
