Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9566)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9567)
@@ -18,4 +18,17 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2010/04/13 Thomas Bretz
+
+   * msim/MHPhotonEvent.cc:
+     - automatic binning for case 3
+     - new case 5
+
+   * msim/MHPhotonEvent.h:
+     - this can be a huge memory consumption and we don't need double
+       precision (range) accordingly changed all TH*D to TH*F.
+       consequently increased class version number
+
+
 
  2010/03/30 Thomas Bretz
Index: trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc	(revision 9566)
+++ trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc	(revision 9567)
@@ -38,17 +38,22 @@
 // Type 1:
 //   The maximum in x and y is determined from MCorsikaRunHeader
-//   (not yet implemented. Fixed to 25000)
+//   (not yet implemented. Fixed to 25000, 100 bins)
 //
 // Type 2:
 //   The maximum in x and y is determined from MReflector->GetMaxR();
+//   (100 bins)
 //
 // Type 3:
 //   The maximum in x and y is determined from MGeomCam->GetMaxR();
+//   (roughly 10 bins per pixel)
 //
 // Type 4:
-//   As type 3 but divided by 10.
-//
-// The binning is optimized using MH::FindGoodLimits. The number of bins
-// in 100 in the default case and 50 for type 3-4.
+//   Two times the traversal size of pixel #0 ( 4*MGeomCam[0].GetT() )
+//   (101 bins, units cm)
+//
+// Type 5:
+//   As type 3 but in cm instead of mm
+//
+// The binning is optimized using MH::FindGoodLimits.
 //
 // Fill expects a MPhotonEvent (the second argumnet in MFillH).
@@ -59,4 +64,8 @@
 //  + TH1D fHistH;
 //
+// Class Version 3:
+// ----------------
+//  + replaced TH1D by TH1F
+//  + replaced TH2D by TH2F
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -173,5 +182,5 @@
 
     MH::FindGoodLimits(num, num, min, max, kFALSE);
-
+    MH::FindGoodLimits(num, num, min, max, kFALSE);
     MBinning binsd, binsa, binsz;
     binsd.SetEdges(num, min, max);
@@ -213,6 +222,13 @@
             break;
         }
-    case 3: // The maximum radius
+    case 3: // The maximum radius (mm)
+        fHistXY.SetXTitle("X [mm]");
+        fHistXY.SetYTitle("Y [mm]");
+        fHistT.SetXTitle("X [mm]");
+        fHistT.SetYTitle("Y [mm]");
+        // *Fallthrough*
+
     case 4: // Two times the pixel-0 traversal size
+    case 5: // The maximum radius (cm)
         {
             MGeomCam *c = (MGeomCam*)pList->FindObject("MGeomCam");
@@ -222,6 +238,10 @@
                 return kFALSE;
             }
-            xmax = fType==3 ? c->GetMaxRadius()/10 : 2*(*c)[0].GetT()/10;
-            num  = 50;
+            // Type 3: Define ~10 bins per pixel
+            xmax = fType==3 ? c->GetMaxRadius() : 4*(*c)[0].GetT()/10;
+            num  = fType==3 ? TMath::Nint(10*(2*c->GetMaxRadius())/(2*(*c)[0].GetT())) : 101;
+
+            if (fType==5)
+                xmax /= 10;
 
             break;
Index: trunk/MagicSoft/Mars/msim/MHPhotonEvent.h
===================================================================
--- trunk/MagicSoft/Mars/msim/MHPhotonEvent.h	(revision 9566)
+++ trunk/MagicSoft/Mars/msim/MHPhotonEvent.h	(revision 9567)
@@ -19,9 +19,9 @@
 {
 private:
-    TH2D       fHistXY;
-    TH2D       fHistUV;
+    TH2F       fHistXY;
+    TH2F       fHistUV;
     TProfile2D fHistT;
-    TH1D       fHistWL;
-    TH1D       fHistH;
+    TH1F       fHistWL;
+    TH1F       fHistH;
 
     Int_t      fType;
@@ -60,5 +60,8 @@
     }
 
-    ClassDef(MHPhotonEvent, 2) // Histogram to display the information of MPhotonEvents
+    const TH2F &GetHistXY() const { return fHistXY; }
+    const TProfile2D &GetHistT() const  { return fHistT; }
+
+    ClassDef(MHPhotonEvent, 3) // Histogram to display the information of MPhotonEvents
 };
 
