Index: trunk/Mars/msim/MHPhotonEvent.cc
===================================================================
--- trunk/Mars/msim/MHPhotonEvent.cc	(revision 19533)
+++ trunk/Mars/msim/MHPhotonEvent.cc	(revision 19534)
@@ -69,4 +69,8 @@
 //  + replaced TH2D by TH2F
 //
+// Class Version 4:
+// ----------------
+//  + added fMaxImpact
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MHPhotonEvent.h"
@@ -140,5 +144,5 @@
 //
 MHPhotonEvent::MHPhotonEvent(Double_t max, const char *name, const char *title)
-    : fHistT("", "", 1, 0, 1, 1, 0, 1), fType(-1), fPermanentReset(kFALSE)
+    : fHistT("", "", 1, 0, 1, 1, 0, 1), fType(-1), fPermanentReset(kFALSE), fMaxImpact(25000)
 {
     // pre-initialization of the profile is necessary to get fZmin and fZmax set
@@ -159,5 +163,5 @@
 //
 MHPhotonEvent::MHPhotonEvent(Int_t type, const char *name, const char *title)
-    : fHistT("", "", 1, 0, 1, 1, 0, 1), fType(type), fPermanentReset(kFALSE)
+    : fHistT("", "", 1, 0, 1, 1, 0, 1), fType(type), fPermanentReset(kFALSE), fMaxImpact(25000)
 {
     // pre-initialization of the profile is necessary to get fZmin and fZmax set
@@ -195,5 +199,5 @@
 {
     Double_t xmax =  -1;
-    Int_t    num  = 100;
+    Int_t    num  = 100;  // N=100: see ReInit
 
     const Int_t f = fPermanentReset ? 2 : 1;
@@ -207,5 +211,5 @@
         // case0: Take a value defined by the user
     case 1:
-        xmax = 25000;
+        xmax = fMaxImpact;
         break;
     case 2:
@@ -296,4 +300,12 @@
     }
 
+    if (fType==1)
+    {
+        // N=100: see SetupFill
+        MBinning *bins = (MBinning*)pList->FindObject("BinningImpact", "MBinning");
+        if (bins)
+            SetBinningXY(100, bins->GetEdgeHi()*100);
+    }
+
     /*
     // What is the size of the light pool onm the ground?
@@ -454,4 +466,9 @@
         fPermanentReset = GetEnvValue(env, prefix, "PermanentReset", fPermanentReset);
     }
+    if (IsEnvDefined(env, prefix, "MaxImpact", print))
+    {
+        rc = kTRUE;
+        fMaxImpact = GetEnvValue(env, prefix, "MaxImpact", fMaxImpact);
+    }
 
     return rc;
Index: trunk/Mars/msim/MHPhotonEvent.h
===================================================================
--- trunk/Mars/msim/MHPhotonEvent.h	(revision 19533)
+++ trunk/Mars/msim/MHPhotonEvent.h	(revision 19534)
@@ -29,4 +29,5 @@
     Int_t      fType;
     Bool_t     fPermanentReset;
+    Float_t    fMaxImpact;
 
     // MHPhotonEvent
@@ -65,5 +66,5 @@
     const TProfile2D &GetHistT() const  { return fHistT; }
 
-    ClassDef(MHPhotonEvent, 3) // Histogram to display the information of MPhotonEvents
+    ClassDef(MHPhotonEvent, 4) // Histogram to display the information of MPhotonEvents
 };
 
