Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 9271)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 9272)
@@ -202,4 +202,8 @@
     fSamplingFrequency=300;
     fFadcResolution=8;
+
+    fHeaderSizeRun=0;
+    fHeaderSizeEvt=0;
+    fHeaderSizeCrate=0;
 }
 
Index: trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.cc	(revision 9271)
+++ trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.cc	(revision 9272)
@@ -107,20 +107,11 @@
     }
 
-
-    fEvt     = 0;
-    fTrigger = 0;
-
-    if (fRunHeader->IsCalibrationRun())
-    {
-        fEvt = (MPhotonEvent*)pList->FindCreateObj("MPhotonEvent");
-        if (!fEvt)
-            return kFALSE;
-    }
-    else
-    {
-        fTrigger = (MParameterD*)pList->FindCreateObj("MParameterD", "TriggerPos");
-        if (!fTrigger)
-            return kFALSE;
-    }
+    fEvt = (MPhotonEvent*)pList->FindCreateObj("MPhotonEvent");
+    if (!fEvt)
+        return kFALSE;
+
+    fTrigger = (MParameterD*)pList->FindCreateObj("MParameterD", "TriggerPos");
+    if (!fTrigger)
+        return kFALSE;
 
     fStat = (MPhotonStatistics*)pList->FindCreateObj("MPhotonStatistics");
@@ -155,14 +146,11 @@
 // ReInit the task-list if this is the first "event from this fake file"
 //
-Bool_t MSimCalibrationSignal::ReInit(MParList *plist)
-{
-    if (plist)
+Bool_t MSimCalibrationSignal::CallReInit()
+{
+    if (GetNumExecutions()>0)
         return kTRUE;
 
-    if (GetNumExecutions()==0)
-        return kTRUE;
-
-    MTask *fTaskList = (MTask*)fParList->FindObject("MTaskList");
-    if (!fTaskList)
+    MTask *tlist = (MTask*)fParList->FindObject("MTaskList");
+    if (!tlist)
     {
         *fLog << err << dbginf << "MTaskList not found... abort." << endl;
@@ -170,8 +158,5 @@
     }
 
-    if (!fTaskList->ReInit(fParList))
-        return kFALSE;
-
-    return kTRUE;
+    return tlist->ReInit(fParList);
 }
 
@@ -182,8 +167,8 @@
 Int_t MSimCalibrationSignal::Process()
 {
-    if (GetNumExecutions()==fNumEntries)
-        return kFALSE;
-
-    if (!ReInit())
+    if (GetNumExecutions()>fNumEntries)
+        return kFALSE;
+
+    if (!CallReInit())
         return kERROR;
 
@@ -194,5 +179,5 @@
         {
             // FIXME: Where to get this number from?
-            for (int i=0; i<50; i++)
+            for (int i=0; i<5; i++)
             {
                 MPhotonData &ph = fEvt->Add(cnt++);
@@ -200,4 +185,5 @@
                 const Float_t tm = gRandom->Gaus(0, 1);
 
+                ph.SetPrimary(MMcEvtBasic::kArtificial);
                 ph.SetTag(idx);
                 ph.SetWeight();
Index: trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.h
===================================================================
--- trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.h	(revision 9271)
+++ trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.h	(revision 9272)
@@ -34,5 +34,7 @@
     Int_t  PreProcess(MParList *pList);
     Int_t  Process();
-    Bool_t ReInit(MParList *plist=0);
+
+    // MSimCalibrationSignal
+    Bool_t CallReInit();
 
     //Int_t ReadRouting(const char *fname, TObjArray &arr);
Index: trunk/MagicSoft/Mars/msimcamera/MSimRandomPhotons.cc
===================================================================
--- trunk/MagicSoft/Mars/msimcamera/MSimRandomPhotons.cc	(revision 9271)
+++ trunk/MagicSoft/Mars/msimcamera/MSimRandomPhotons.cc	(revision 9272)
@@ -179,4 +179,5 @@
             // Set source to NightSky, time to t and tag to pixel index
             ph.SetPrimary(MMcEvtBasic::kNightSky);
+            ph.SetWeight();
             ph.SetTime(t);
             ph.SetTag(idx);
Index: trunk/MagicSoft/Mars/msimcamera/MSimReadout.cc
===================================================================
--- trunk/MagicSoft/Mars/msimcamera/MSimReadout.cc	(revision 9271)
+++ trunk/MagicSoft/Mars/msimcamera/MSimReadout.cc	(revision 9272)
@@ -131,4 +131,6 @@
 
     fRunHeader->InitPixels(cam->GetNumPixels());
+    fRunHeader->SetValidMagicNumber();
+    fRunHeader->SetSourceInfo("MonteCarlo");  // "Muon" from first event??
 
     fData->InitRead(fRunHeader);
@@ -237,4 +239,6 @@
     fData->SetReadyToSave();
 
+    fRunHeader->SetNumEvents(fRunHeader->GetNumEvents()+1);
+
     return kTRUE;
 }
