Index: trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc
===================================================================
--- trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc	(revision 9306)
+++ trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc	(revision 9307)
@@ -27,4 +27,12 @@
 //  MSimReflector
 //
+//  fDetectorMargin is a margin (in mm) which is given to the
+//  MGeomCam::HitDetector. It should define a margin around the area
+//  defined in HitDetector on the focal plane in which photons are kept.
+//  Usually this can be 0 because photons not hitting the detector are
+//  obsolete except they can later be "moved" inside the detector, e.g.
+//  if you use MSimPSF to emulate a PSF by moving photons randomly
+//  on the focal plane.
+//
 //////////////////////////////////////////////////////////////////////////////
 #include "MSimReflector.h"
@@ -554,2 +562,17 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// DetectorMargin: 0
+//
+Int_t MSimReflector::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
+{
+    Bool_t rc = kFALSE;
+    if (IsEnvDefined(env, prefix, "DetectorMargin", print))
+    {
+        rc = kTRUE;
+        fDetectorMargin = GetEnvValue(env, prefix, "DetectorMargin", 0);
+    }
+
+    return rc;
+}
Index: trunk/MagicSoft/Mars/msimreflector/MSimReflector.h
===================================================================
--- trunk/MagicSoft/Mars/msimreflector/MSimReflector.h	(revision 9306)
+++ trunk/MagicSoft/Mars/msimreflector/MSimReflector.h	(revision 9307)
@@ -34,4 +34,7 @@
     Double_t fDetectorMargin;    // A margin around the detector (MGeomCam::HitCamera) in which photons are also stored
 
+    // MParContainer
+    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
+
     // MTask
     Int_t PreProcess(MParList *pList);
