Index: trunk/Mars/msimcamera/MSimCamera.cc
===================================================================
--- trunk/Mars/msimcamera/MSimCamera.cc	(revision 17662)
+++ trunk/Mars/msimcamera/MSimCamera.cc	(revision 17663)
@@ -47,4 +47,6 @@
 #include "MLogManip.h"
 
+#include "MTruePhotonsPerPixelCont.h"
+
 #include "MSpline3.h"
 #include "MParSpline.h"
@@ -149,4 +151,11 @@
     {
         *fLog << err << "CrosstalkCoeffParam [MParameterD] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fTruePhotons = (MTruePhotonsPerPixelCont*)pList->FindCreateObj("MTruePhotonsPerPixelCont");
+    if (!fTruePhotons)
+    {
+        *fLog << err << "MTruePhotonsPerPixelCont not found... aborting." << endl;
         return kFALSE;
     }
@@ -344,5 +353,33 @@
 
         if (ph.GetPrimary()!=MMcEvt::kNightSky && ph.GetPrimary()!=MMcEvt::kArtificial)
+        {
             tot += ph.GetWeight();
+            (*fTruePhotons->cherenkov_photons_weight)[idx] += ph.GetWeight();
+            (*fTruePhotons->cherenkov_photons_number)[idx] += 1;
+
+            (*fTruePhotons->cherenkov_arrival_time_mean)[idx] += t;
+            (*fTruePhotons->cherenkov_arrival_time_variance)[idx] += t*t;
+
+            if (ph.GetPrimary()==MMcEvt::kMUON)
+            {
+                (*fTruePhotons->muon_cherenkov_photons_weight)[idx] += ph.GetWeight();
+                (*fTruePhotons->muon_cherenkov_photons_number)[idx] += 1;
+            }
+
+            // find min
+            if (t < (*fTruePhotons->cherenkov_arrival_time_min)[idx] )
+            {
+                (*fTruePhotons->cherenkov_arrival_time_min)[idx] = t;
+            }
+            // find max
+            if (t > (*fTruePhotons->cherenkov_arrival_time_max)[idx] )
+            {
+               (*fTruePhotons->cherenkov_arrival_time_max)[idx] = t;
+            }
+        }
+        else
+        {
+            (*fTruePhotons->noise_photons_weight)[idx] += ph.GetWeight();
+        }
 
         // Sorry, the name "pedestal" is misleading here
@@ -352,4 +389,13 @@
         // === FIXME === FIXME === FIXME === Frequency!!!!
         (*fCamera)[idx].AddPulse(*fSpline, t, ph.GetWeight()*gain);
+    }
+
+    for (unsigned int i=0 ; i < 1440 ; i++)
+    {
+        float number = (*fTruePhotons->cherenkov_photons_number)[i];
+        (*fTruePhotons->cherenkov_arrival_time_mean)[i] /= number;
+        float mean = (*fTruePhotons->cherenkov_arrival_time_mean)[i];
+        float sum_tt = (*fTruePhotons->cherenkov_arrival_time_variance)[i];
+        (*fTruePhotons->cherenkov_arrival_time_variance)[i] = (sum_tt / number - mean*mean) /(number - 1);
     }
 
Index: trunk/Mars/msimcamera/MSimCamera.h
===================================================================
--- trunk/Mars/msimcamera/MSimCamera.h	(revision 17662)
+++ trunk/Mars/msimcamera/MSimCamera.h	(revision 17663)
@@ -5,4 +5,6 @@
 #include "MTask.h"
 #endif
+
+#include "MArrayF.h"
 
 class MMcEvt;
@@ -13,4 +15,6 @@
 class MAnalogChannels;
 class MPedestalCam;
+class MArrayF;
+class MTruePhotonsPerPixelCont;
 
 class MSpline3;
@@ -31,4 +35,5 @@
 
     MParameterD       *fCrosstalkCoeffParam;
+    MTruePhotonsPerPixelCont    *fTruePhotons;  //! Container to store the number of photons per pixel
 
     const MSpline3    *fSpline;          // Pulse Shape    
