Index: trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 4358)
+++ trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 4370)
@@ -174,12 +174,6 @@
     // - Branches are automatically deleted by the tree destructor
     //
-
-    //
-    // Write the run header information to the file
-    //
-    TTree *rh = new TTree("RunHeaders", "Run headers of all runs in this file");
-    rh->Branch("MRawRunHeader.", "MRawRunHeader", &fRawRunHeader, 32000);
-    rh->Fill();
-    //rh->Write();
+    fTRunHeader = new TTree("RunHeaders", "Run headers of all runs in this file");
+    fTRunHeader->Branch("MRawRunHeader.", "MRawRunHeader", &fRawRunHeader, 32000);
 
     //
@@ -229,5 +223,15 @@
     return kTRUE;
 }
-    
+
+// --------------------------------------------------------------------------
+//
+// Write the run header information to the file
+//
+Bool_t MRawFileWrite::ReInit(MParList *pList)
+{
+    fTRunHeader->Fill();
+    return kTRUE;
+}
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mraw/MRawFileWrite.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileWrite.h	(revision 4358)
+++ trunk/MagicSoft/Mars/mraw/MRawFileWrite.h	(revision 4370)
@@ -31,5 +31,11 @@
     TTree *fTCalibration;           //!
 
+    TTree *fTRunHeader;             //!
+
     TFile *fOut;                    //!
+
+    Int_t  PreProcess(MParList *pList);
+    Bool_t ReInit(MParList *pList);
+    Int_t  Process();
 
 public:
@@ -41,7 +47,4 @@
     ~MRawFileWrite();
 
-    Int_t PreProcess(MParList *pList);
-    Int_t Process();
-
     ClassDef(MRawFileWrite, 0)	// Task to write the raw data containers to a root file
 };
