Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1107)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1108)
@@ -8,4 +8,48 @@
    * mbase/MGList.cc:
      - changed cast in IsExisting to ?:
+
+   * NEWS:
+     - changed
+
+   * manalysis/MCerPhotCalc.cc, mfilter/MTriggerLvl1.cc,
+     mmontecarlo/MMcCollectionAreaCalc.cc,
+     mmontacarlo/MMcThresholdCalc.cc,
+     MMcTriggerRateCalc.cc:
+     - added Masterbranch name to AddToBranchList
+
+   * manalysis/MMcPedestalCopy.cc:
+     - added Masterbranch name to AddToBranchList
+     - fixed a bug in the branch name
+
+   * mbase/MGList.[h,cc]:
+     - added a better output if a picture wasn't found
+
+   * mbase/MReadTree.[h,cc]:
+     - added support for branches with master branch names to auto scheme
+       (first the complete branch name is tried and if this isn't found
+        only the subbranch name is used to enable the branch)
+
+   * mbase/MWriteRootFile.cc:
+     - appended a '.' to all newly create branches
+
+   * mmain/MBrowser.cc, mmain/MMars.cc:
+     - add the gui elements only if the corresponding picture was found
+
+   * mmain/MMars.[h,cc]:
+     - removed fPic1
+     - removed fPic2
+     - changed TList to MGList
+
+   * mraw/MRawFileWrite.cc:
+     - added a '.' to all branch names
+
+   * mbase/MTask.[h,cc]:
+     - added Prototype for ReInit-function
+
+   * mbase/MTaskList.[h,cc]:
+     - implemented ReInit for a task list
+
+   * mhist/MHFadcCam.h:
+     - added '->' to fArray
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 1107)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 1108)
@@ -11,4 +11,11 @@
    - Fixed several bugs in MFTriggerLvl1 which caused to filter not to
      work correctly (thanks to Abelardo)
+
+   - Introduced correct treatment of the diffuse Night Sky Background 
+     and NSB (MMcPedestalNSB)
+
+   - Corrected treatment of the electronic noise (MMcPedestalCopy)
+
+   - Introduced MMcRunHeaders which contains monte carlo run informations
 
 
Index: /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 1108)
@@ -63,8 +63,8 @@
     fTitle = title ? title : "Task to calculate Cerenkov photons from raw data";
 
-    AddToBranchList("fHiGainPixId");
-    AddToBranchList("fLoGainPixId");
-    AddToBranchList("fHiGainFadcSamples");
-    AddToBranchList("fLoGainFadcSamples");
+    AddToBranchList("MRawEvtData.fHiGainPixId");
+    AddToBranchList("MRawEvtData.fLoGainPixId");
+    AddToBranchList("MRawEvtData.fHiGainFadcSamples");
+    AddToBranchList("MRawEvtData.fLoGainFadcSamples");
 
 }
Index: /trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 1108)
@@ -53,6 +53,6 @@
     fTitle = title ? title : "Task to copy monte carlo pedestals into MPedestal Container";
 
-    AddToBranchList("fPedestalMean");
-    AddToBranchList("fElecNoise");
+    AddToBranchList("MMcFadcHeader.fPedesMean");
+    AddToBranchList("MMcFadcHeader.fElecNoise");
 }
 
Index: /trunk/MagicSoft/Mars/mbase/MGList.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 1108)
@@ -167,5 +167,5 @@
 //   - The picture is freed as often as it was retrieved from gClient
 //
-void MGList::AddPicture(const TGPicture *pic)
+void MGList::AddPicture(const TGPicture *pic, const char *name)
 {
     //
@@ -174,5 +174,8 @@
     if (!pic)
     {
-        cout << "Warning: Requested picture not found... ignored." << endl;
+        cout << "Warning: Requested picture '" << name << "' not found... ignored." << endl;
+        cout << "    Please copy " << name << " to $HOME or $HOME/icons or add" << endl;
+        cout << "      Unix.*.Gui.IconPath: ~/Path/To/The/Picture" << endl;
+        cout << "    to [$HOME/].rootrc."  << endl;
         return;
     }
@@ -199,5 +202,5 @@
 {
     const TGPicture *pic = gClient->GetPicture(name);
-    AddPicture(pic);
+    AddPicture(pic, name);
     return pic;
 }
@@ -218,5 +221,5 @@
 {
     const TGPicture *pic = gClient->GetPicture(name, width, height);
-    AddPicture(pic);
+    AddPicture(pic, name);
     return pic;
 }
Index: /trunk/MagicSoft/Mars/mbase/MGList.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MGList.h	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MGList.h	(revision 1108)
@@ -15,5 +15,5 @@
     Bool_t    IsExisting(TObject *obj) const;
 
-    void      AddPicture(const TGPicture *pic);
+    void      AddPicture(const TGPicture *pic, const char *name);
 
 public:
Index: /trunk/MagicSoft/Mars/mbase/MReadTree.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 1108)
@@ -149,5 +149,11 @@
 Bool_t MReadTree::Notify()
 {
-    fNotify->ForEach(TObject, Notify)();
+    //
+    // FIXME: This is correct!
+    //
+    //   fNotify->ForEach(TObject, Notify)();
+
+    fTaskList->ReInit();
+
     return kTRUE;
 }
@@ -209,4 +215,16 @@
 // --------------------------------------------------------------------------
 //
+// Set branch status of branch name
+//
+void MReadTree::SetBranchStatus(const char *name, Bool_t status)
+{
+    fChain->SetBranchStatus(name, status);
+
+    *fLog << inf << (status ? "Enabled" : "Disabled");
+    *fLog << " subbranch '" << name << "'." << endl;
+}
+
+// --------------------------------------------------------------------------
+//
 // Checks whether a branch with the given name exists in the chain
 // and sets the branch status of this branch corresponding to status.
@@ -222,13 +240,18 @@
     // Check whether this branch really exists
     //
-    if (!fChain->GetBranch(name))
+    if (fChain->GetBranch(name))
+        SetBranchStatus(name, status);
+
+    //
+    // Remove trailing '.' if one and try to enable the subbranch without
+    // the master barnch name. This is to be compatible with older mars
+    // and camera files.
+    //
+    const char *dot = strrchr(name, '.');
+    if (!dot)
         return;
 
-    //
-    // Set the branch status
-    //
-    fChain->SetBranchStatus(name, status);
-    *fLog << inf << (status ? "Enabled" : "Disabled");
-    *fLog << " subbranch '" << name << "'." << endl;
+    if (fChain->GetBranch(dot+1))
+        SetBranchStatus(dot+1, kTRUE);
 }
 
@@ -265,5 +288,5 @@
     // check whether branch choosing must be switched on
     //
-    EnableBranchChoosing();
+    //EnableBranchChoosing();
 
     //
@@ -324,4 +347,6 @@
 Bool_t MReadTree::PreProcess(MParList *pList)
 {
+    fTaskList = (MTaskList*)pList->FindObject("MTaskList");
+
     //
     // get number of events in this tree
Index: /trunk/MagicSoft/Mars/mbase/MReadTree.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MReadTree.h	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MReadTree.h	(revision 1108)
@@ -8,4 +8,5 @@
 class TChain;
 class TBranch;
+class MTaskList;
 class TGProgressBar;
 
@@ -24,8 +25,10 @@
     TList  *fNotify;           // List of TObjects to notify when switching files
 
+    MTaskList      *fTaskList; //! Tasklist for reinitialization
     TGProgressBar  *fProgress; //! Possible display of status
 
     void SetBranchStatus(const TList *list, Bool_t status);
     void SetBranchStatus(TObject *branch, Bool_t status);
+    void SetBranchStatus(const char *name, Bool_t status);
 
     void DisableSubBranches(TBranch *b);
Index: /trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 1108)
@@ -100,4 +100,5 @@
 // recommended method is to call this function for exactly all
 // branches you want to have, eg:
+//  AddToBranchList("MMcTrig.fNumFirstLevel");
 //  AddToBranchList("MMcTrig;1.fNumFirstLevel");
 //  AddToBranchList("MMcTrig;2.fNumFirstLevel");
@@ -181,4 +182,21 @@
 // --------------------------------------------------------------------------
 //
+// This is reinit function
+//
+// This function is called asynchronously if the tasks in the tasklist need
+// reinitialization. This for example happens when the eventloop switches
+// from one group of events to another one (eg. switching between events
+// of different runs means reading a new run header and a new run header
+// may mean that some value must be reinitialized)
+//
+// the virtual implementation returns kTRUE
+//
+Bool_t MTask::ReInit(MParList *pList)
+{
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // This is processed before the eventloop starts
 //
Index: /trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTask.h	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MTask.h	(revision 1108)
@@ -74,4 +74,6 @@
     UInt_t GetNumExecutions() { return fNumExecutions; }
 
+    virtual Bool_t ReInit(MParList *pList);
+
     virtual Bool_t CallPreProcess(MParList *plist);
     virtual Bool_t CallProcess();
Index: /trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 1108)
@@ -214,4 +214,35 @@
 // --------------------------------------------------------------------------
 //
+//  do reinit of all tasks in the task-list
+//
+Bool_t MTaskList::ReInit(MParList *pList)
+{ 
+    *fLog << all << "Reinit... " << flush;
+
+    //
+    //  create the Iterator over the tasklist
+    //
+    TIter Next(fTasks);
+
+    MTask *task=NULL;
+
+    //
+    // loop over all tasks for preproccesing
+    //
+    while ((task=(MTask*)Next()))
+    {
+        *fLog << all << task->GetName() << "... " << flush;
+
+        if (!task->ReInit(pList?fParList:pList))
+            return kFALSE;
+    }
+
+    *fLog << all << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 //  do pre processing (before eventloop) of all tasks in the task-list
 //
Index: /trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1108)
@@ -42,4 +42,6 @@
     TObject *FindObject(const TObject *obj) const;
 
+    Bool_t ReInit(MParList *pList=NULL);
+
     Bool_t PreProcess(MParList *pList);
     Bool_t Process();
Index: /trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc	(revision 1108)
@@ -286,5 +286,7 @@
         // The containers should be written in Splitlevel=1
         //
-        branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress());
+        TString branchname(cname);
+        branchname.Append(".");
+        branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress());
 
         *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;
Index: /trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc	(revision 1108)
@@ -66,5 +66,5 @@
     fValue = val;
 
-    AddToBranchList("fNumFirstLevel");
+    AddToBranchList("MMcTrig.fNumFirstLevel");
 }
 
Index: /trunk/MagicSoft/Mars/mhist/MHFadcCam.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 1107)
+++ /trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 1108)
@@ -20,5 +20,5 @@
 {
 private:
-    TObjArray *fArray;	// List of Lo/Hi gain Histograms
+    TObjArray *fArray;	//-> List of Lo/Hi gain Histograms
 
     void FillHi(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillHi(data); }
Index: /trunk/MagicSoft/Mars/mmain/MBrowser.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1108)
@@ -113,53 +113,4 @@
 {
     //
-    // Create Dir-Listbox and buttons in first frame
-    //
-    TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory);
-    dir->SetHeight(fEntry->GetHeight());
-
-    //
-    // Get the three picturs from the system (must be deleted by FreePicture)
-    //
-    const TGPicture *pic1 = fList->GetPicture("tb_uplevel.xpm");
-    const TGPicture *pic2 = fList->GetPicture("tb_list.xpm");
-    const TGPicture *pic3 = fList->GetPicture("tb_details.xpm");
-
-    //
-    // Create the corresponding picture buttons
-    //
-    TGPictureButton *cdup   = new TGPictureButton(frame, pic1, kButDirUp);
-    TGPictureButton *list   = new TGPictureButton(frame, pic2, kButListMode);
-    TGPictureButton *detail = new TGPictureButton(frame, pic3, kButDetailMode);
-
-    //
-    // setup the buttons
-    //
-    cdup  ->SetToolTipText("One Level up!");
-    list  ->SetToolTipText("List Mode");
-    detail->SetToolTipText("Details Mode");
-
-    list  ->SetState(kButtonUp);
-    detail->SetState(kButtonEngaged);
-
-    list  ->AllowStayDown(kTRUE);
-    detail->AllowStayDown(kTRUE);
-
-    //
-    // send messages to 'this' object
-    //
-    dir   ->Associate(this);
-    cdup  ->Associate(this);
-    detail->Associate(this);
-    list  ->Associate(this);
-
-    //
-    // Add to list for 'automatic' deletion
-    //
-    fList->Add(dir);
-    fList->Add(cdup);
-    fList->Add(list);
-    fList->Add(detail);
-
-    //
     // Layout Dir-Listbox and buttons in one row (frame)
     //
@@ -169,13 +120,54 @@
     //
     TGLayoutHints *laydir = new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsCenterY); //, 5, 5, 5, 5);
+    TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5);
+
     fList->Add(laydir);
-
-    TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5);
     fList->Add(layout);
 
-    frame->AddFrame(dir,    laydir);
-    frame->AddFrame(list,   layout);
-    frame->AddFrame(detail, layout);
-    frame->AddFrame(cdup,   layout);
+    //
+    // Create Dir-Listbox and buttons in first frame
+    //
+    TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory);
+    dir->SetHeight(fEntry->GetHeight());
+    dir->Associate(this);
+    fList->Add(dir);
+    frame->AddFrame(dir, laydir);
+
+    //
+    // Get the three picturs from the system (must be deleted by FreePicture)
+    //
+    const TGPicture *pic1 = fList->GetPicture("tb_list.xpm");
+    if (pic1)
+    {
+        TGPictureButton *list = new TGPictureButton(frame, pic1, kButListMode);
+        list->SetToolTipText("List Mode");
+        list->SetState(kButtonUp);
+        list->AllowStayDown(kTRUE);
+        list->Associate(this);
+        fList->Add(list);
+        frame->AddFrame(list, layout);
+    }
+
+    const TGPicture *pic2 = fList->GetPicture("tb_details.xpm");
+    if (pic2)
+    {
+        TGPictureButton *detail = new TGPictureButton(frame, pic2, kButDetailMode);
+        detail->SetToolTipText("Details Mode");
+        detail->SetState(kButtonEngaged);
+        detail->AllowStayDown(kTRUE);
+        detail->Associate(this);
+        fList->Add(detail);
+        frame->AddFrame(detail, layout);
+    }
+
+    const TGPicture *pic3 = fList->GetPicture("tb_uplevel.xpm");
+    if (pic3)
+    {
+        TGPictureButton *cdup = new TGPictureButton(frame, pic3, kButDirUp);
+        cdup->SetToolTipText("One Level up!");
+        cdup->Associate(this);
+        fList->Add(cdup);
+        frame->AddFrame(cdup, layout);
+    }
 }
 
Index: /trunk/MagicSoft/Mars/mmain/MMars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 1108)
@@ -26,4 +26,6 @@
 #include "MMars.h"
 
+#include <iostream.h>
+
 #include <TApplication.h>  // gROOT->GetApplication()->...
 
@@ -35,4 +37,5 @@
 #include <TG3DLine.h>      // TGHorizontal3DLine
 
+#include "MGList.h"
 #include "MEvtDisp.h"
 #include "MAnalysis.h"
@@ -85,24 +88,25 @@
 void MMars::CreateTopFrame(TGHorizontalFrame *top)
 {
-    fPic1 = gClient->GetPicture("magiclogo.xpm");
-    fPic2 = gClient->GetPicture("marslogo.xpm");
-
-    TGPictureButton *magic = new TGPictureButton(top, fPic1, kPicMagic);
-    TGPictureButton *mars  = new TGPictureButton(top, fPic2, kPicMars);
-
-    fList->Add(magic);
-    fList->Add(mars);
-
-    magic->Associate(this);
-    mars->Associate(this);
-
-    TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
-    TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
-
-    fList->Add(lay1);
-    fList->Add(lay2);
-
-    top->AddFrame(magic, lay1);
-    top->AddFrame(mars,  lay2);
+    const TGPicture *pic1 = fList->GetPicture("magiclogo.xpm");
+    if (pic1)
+    {
+        TGPictureButton *magic = new TGPictureButton(top, pic1, kPicMagic);
+        fList->Add(magic);
+        magic->Associate(this);
+        TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
+        fList->Add(lay1);
+        top->AddFrame(magic, lay1);
+    }
+
+    const TGPicture *pic2 = fList->GetPicture("marslogo.xpm");
+    if (pic2)
+    {
+        TGPictureButton *mars  = new TGPictureButton(top, pic2, kPicMars);
+        fList->Add(mars);
+        mars->Associate(this);
+        TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
+        fList->Add(lay2);
+        top->AddFrame(mars,  lay2);
+    }
 }
 
@@ -176,5 +180,5 @@
     // Create the deletion list
     //
-    fList = new TList;
+    fList = new MGList;
     fList->SetOwner();
 
@@ -230,7 +234,4 @@
 MMars::~MMars()
 {
-    gClient->FreePicture(fPic1);
-    gClient->FreePicture(fPic2);
-
     delete fList;
 }  
Index: /trunk/MagicSoft/Mars/mmain/MMars.h
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MMars.h	(revision 1107)
+++ /trunk/MagicSoft/Mars/mmain/MMars.h	(revision 1108)
@@ -10,5 +10,5 @@
 #endif
 
-class TList;
+class MGList;
 class TGVerticalFrame;
 class TGLayoutHints;
@@ -18,8 +18,5 @@
 private:
 
-    TList *fList;
-
-    const TGPicture *fPic1;
-    const TGPicture *fPic2;
+    MGList *fList;
 
     void CreateTextButton(TGVerticalFrame *tab, const char *text,
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 1108)
@@ -44,17 +44,9 @@
     fTitle = title ? title : "Task to calculate the collection area";
 
-    if (input)
-    {
-        fObjName = input;
-        AddToBranchList(Form("%s.fNumFirstLevel", input));
-    }
-    else
-    {
-        fObjName = "MMcTrig";
-        AddToBranchList("fNumFirstLevel");
-    }
+    fObjName = input ? input : "MMcTrig";
+    AddToBranchList(Form("%s.fNumFirstLevel", input));
 
-    AddToBranchList("fEnergy");
-    AddToBranchList("fImpact");
+    AddToBranchList("MMcEvt.fEnergy");
+    AddToBranchList("MMcEvt.fImpact");
 } 
 
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 1108)
@@ -77,5 +77,5 @@
     fNum = fLast-fFirst+1;
 
-    AddToBranchList("fEnergy");
+    AddToBranchList("MMcEvt.fEnergy");
     AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast);
 }
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1108)
@@ -61,9 +61,9 @@
     fNum = fLast-fFirst+1;
 
-    AddToBranchList("fImpact");
-    AddToBranchList("fEnergy");
-    AddToBranchList("fPhi");
-    AddToBranchList("fTheta");
-    AddToBranchList("fPhotElfromShower");
+    AddToBranchList("MMcEvt.fImpact");
+    AddToBranchList("MMcEvt.fEnergy");
+    AddToBranchList("MMcEvt.fPhi");
+    AddToBranchList("MMcEvt.fTheta");
+    AddToBranchList("MMcEvt.fPhotElfromShower");
     AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast);
 }
Index: /trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 1107)
+++ /trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 1108)
@@ -207,17 +207,17 @@
     // FIXME: Can we calculate a good buffer size out of the event size?
     //        using splitlevel=0 sppeds up writing by a factor of 5-10%
-    fTData       ->Branch("MTime",          "MTime",          &fRawEvtTime,    32000);
-    fTPedestal   ->Branch("MTime",          "MTime",          &fRawEvtTime,    32000);
-    fTCalibration->Branch("MTime",          "MTime",          &fRawEvtTime,    32000);
-    fTData       ->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
-    fTPedestal   ->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
-    fTCalibration->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
-    fTData       ->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    320000);
-    fTPedestal   ->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    320000);
-    fTCalibration->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    320000);
+    fTData       ->Branch("MTime.",          "MTime",          &fRawEvtTime,    32000);
+    fTPedestal   ->Branch("MTime.",          "MTime",          &fRawEvtTime,    32000);
+    fTCalibration->Branch("MTime.",          "MTime",          &fRawEvtTime,    32000);
+    fTData       ->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
+    fTPedestal   ->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
+    fTCalibration->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
+    fTData       ->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
+    fTPedestal   ->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
+    fTCalibration->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
     //fTree->Branch("MRawCrateArray",  fRawCrateArray->GetArray(),      32000, 1);
-    fTData       ->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000);
-    fTPedestal   ->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000);
-    fTCalibration->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000);
+    fTData       ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
+    fTPedestal   ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
+    fTCalibration->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
 
     return kTRUE;
