Index: trunk/Mars/mcorsika/MCorsikaRead.cc
===================================================================
--- trunk/Mars/mcorsika/MCorsikaRead.cc	(revision 19848)
+++ trunk/Mars/mcorsika/MCorsikaRead.cc	(revision 19850)
@@ -290,8 +290,13 @@
     fNumTotalEvents = 0;
 
-    MCorsikaRunHeader runheader;
+    bool allocated = false;
+    MCorsikaRunHeader *runheader = fRunHeader;
+    if (!runheader)
+    {
+        runheader = new MCorsikaRunHeader;
+        allocated = true;
+    }
 
     Bool_t rc = kTRUE;
-
     while (1)
     {
@@ -314,5 +319,5 @@
                {
                if (blockType == 1200)
-                  status = runheader.ReadEvt(fInFormat, blockLength / sizeof(Float_t));
+                  status = runheader->ReadEvt(fInFormat, blockLength / sizeof(Float_t));
 
                else if(blockType == 1201)
@@ -323,5 +328,5 @@
                   vector<Float_t> buffer(blockLength / sizeof(Float_t));
                   status = fInFormat->Read(buffer.data(), blockLength);
-                  status = runheader.ReadEventHeader(buffer.data());
+                  status = runheader->ReadEventHeader(buffer.data());
                   break;
                   }
@@ -335,17 +340,21 @@
             if (!fInFormat->SeekEvtEnd())
             {
-               *fLog << (fForceMode?warn:err) << "ERROR - RUNE section not found in file." << endl;
+                *fLog << (fForceMode?warn:err) << "ERROR - RUNE section not found in file." << endl;
+               if (allocated)
+                   delete runheader;
                if (!fForceMode)
                   return fForceMode ? kTRUE : kFALSE;
             }
 
-            if (!runheader.ReadEvtEnd(fInFormat, kTRUE))
+            if (!runheader->ReadEvtEnd(fInFormat, kTRUE))
             {
                *fLog << (fForceMode?warn:err) << "ERROR - Reading RUNE section failed." << endl;
+               if (allocated)
+                   delete runheader;
                if (!fForceMode)
                   return kFALSE;
             }
 
-            fNumTotalEvents += runheader.GetNumEvents()*runheader.GetNumReuse()*
+            fNumTotalEvents += runheader->GetNumEvents()*runheader->GetNumReuse()*
                 (fTelescopeIdx<0 && fNumTelescope==0 ? fNumTelescopes : 1);
             continue;
@@ -354,4 +363,6 @@
     }
 
+    if (allocated)
+        delete runheader;
     return rc;
 }
