Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7803)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7804)
@@ -33,4 +33,60 @@
    * mbase/MContinue.h:
      - some reformatting
+
+   * manalysis/MEventRateCalc.[h,cc], manalysis/MGeomApply.[h,cc],
+     manalysis/MMultiDimDistCalc.[h,cc], mbadpixels/MBadPixelsTreat.[h,cc],
+     mbase/MEvtLoop.[h,cc], mbase/MParContainer.[h,cc], mbase/MParList.[h,cc],
+     mbase/MTask.[h,cc], mbase/MTaskList.[h,cc], mcalib/MCalibrateData.[h,cc],
+     mdata/MDataArray.[h,cc], mfbase/MF.[h,cc], mfbase/MFDataChain.[h,cc],
+     mfbase/MFDataChain.[h,cc], mfbase/MFDataMember.[h,cc],
+     mfbase/MFilterList.[h,cc], mfileio/MReadTree.[h,cc], 
+     mfileio/MWriteRootFile.[h,cc], mfilter/MFParticleId.[h,cc],
+     mfilter/MFTriggerLvl1.[h,cc], mfilter/MFTriggerLvl2.[h,cc],
+     mhbase/MBinning.[h,cc], mhbase/MFillH.[h,cc], mhbase/MH3.[h,cc],
+     mhbase/MHMatrix.[h,cc], mimage/MHillasCalc.[h,cc],
+     mimage/MImgCleanStd.[h,cc], mimage/MImgCleanTGB.[h,cc],
+     mpointing/MSrcPosCam.[h,cc], msignal/MExtractFixedWindow.[h,cc],
+     msignal/MExtractSignal.[h,cc], msignal/MExtractSignalABcorr.[h,cc],
+     msignal/MExtractor.[h,cc], mtools/MChisqEval.[h,cc]
+     - replaced StreamPrimitive(ofstream&) by StreamPrimitive(ostream&)
+     - replaced SavePrimitive(ofstream&) by SsavePrimitive(ostream&)
+     - if necessary let SavePrimitive(ofstream&) call 
+       SavePrimitive(ostream&)
+
+   * mbadpixels/MBadPixelsCam.cc, mbadpixels/MBadPixelsIntensityCam.cc,
+     mbase/MEvtLoop.cc, mbase/MLog.cc, mbase/MParList.cc, mbase/MTaskList.cc,
+     mcalib/MCalibConstCam.cc, mcalib/MCalibrationBlindCam.cc,
+     mcalib/MCalibrationCam.cc, mcalib/MCalibrationIntensityCam.cc,
+     mcalib/MCalibrationIntensityConstCam.cc, mdata/MDataArray.cc,
+     mdata/MDataFormula.cc, mdata/MDataList.cc, mfbase/MFilterList.cc,
+     mgeom/MGeomCam.cc, mhcalib/MHCalibrationCam.cc, mmain/MMonteCarlo.cc,
+     mpedestal/MPedPhotCam.cc, mpedestal/MPedestalCam.cc,
+     mreport/MReportFileRead.cc, msignal/MArrivalTimeCam.cc,
+     msignal/MExtractedSignalCam.cc, msignal/MSignalCam.cc:
+     - replaced ForEach by R__FOR_EACH
+
+   * mbase/MAGIC.h:
+     - define R__FOR_EACH macro if not yet defined
+
+   * mbase/MEvtLoop.cc:
+     - removed usage of copy-constructor of TEnv
+
+   * mbase/MString.h:
+     - exclude some of the member function from CINT (gives problem
+       with CINT)
+
+   * mfbase/MFEventSelector.[h,cc]:
+     - removed StreamPrimitive (it was empty anyhow)
+
+   * mranforest/MRanTree.cc:
+     - moved includes for TVector and TMatrix to header
+     - replaced TMatrixRow by TMatrixFRow_const in TreeHad
+
+   * msignal/Makefile, msignal/SignalLinkDef.h:
+     - removed MExtractSignal
+     - removed MExtractSignal2
+     - removed MExtractSignal3
+     - removed MExtractSignalABcorr
+
 
 
Index: trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 7804)
@@ -212,5 +212,5 @@
 // gui elements to a macro-file.
 //
-void MEventRateCalc::StreamPrimitive(ofstream &out) const
+void MEventRateCalc::StreamPrimitive(ostream &out) const
 {
     out << "   MEventRateCalc " << GetUniqueName() << "(";
Index: trunk/MagicSoft/Mars/manalysis/MEventRateCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEventRateCalc.h	(revision 7803)
+++ trunk/MagicSoft/Mars/manalysis/MEventRateCalc.h	(revision 7804)
@@ -45,5 +45,5 @@
     Int_t  Process();
 
-    void  StreamPrimitive(ofstream &out) const;
+    void  StreamPrimitive(ostream &out) const;
     Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
 
Index: trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 7804)
@@ -222,5 +222,5 @@
 // gui elements to a macro-file.
 //
-void MGeomApply::StreamPrimitive(ofstream &out) const
+void MGeomApply::StreamPrimitive(ostream &out) const
 {
     out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/manalysis/MGeomApply.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MGeomApply.h	(revision 7803)
+++ trunk/MagicSoft/Mars/manalysis/MGeomApply.h	(revision 7804)
@@ -22,5 +22,5 @@
     Int_t  PreProcess(MParList *plist);
     Bool_t ReInit(MParList *pList);
-    void   StreamPrimitive(ofstream &out) const;
+    void   StreamPrimitive(ostream &out) const;
 
 public:
Index: trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 7804)
@@ -199,5 +199,5 @@
 }
 
-void MMultiDimDistCalc::StreamPrimitive(ofstream &out) const
+void MMultiDimDistCalc::StreamPrimitive(ostream &out) const
 {
     out << "   MMultiDimDist " << GetUniqueName();
@@ -218,2 +218,3 @@
         out << "   " << GetUniqueName() << ".SetUseKernelMethod();" << endl;
 }
+
Index: trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h	(revision 7803)
+++ trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h	(revision 7804)
@@ -26,5 +26,6 @@
     MDataArray  *fData;       //! Used to store the MDataChains to get the event values
 
-    void  StreamPrimitive(ofstream &out) const;
+    void  StreamPrimitive(ostream &out) const;
+
     Int_t PreProcess(MParList *plist);
     Int_t Process();
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc	(revision 7804)
@@ -166,5 +166,5 @@
 void MBadPixelsCam::Clear(Option_t *o)
 {
-    fArray->ForEach(TObject, Clear)();
+    fArray->R__FOR_EACH(TObject, Clear)();
 }
 
@@ -175,5 +175,5 @@
 void MBadPixelsCam::Reset()
 {
-    fArray->ForEach(MParContainer, Reset)();
+    fArray->R__FOR_EACH(MParContainer, Reset)();
 }
 
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.cc	(revision 7804)
@@ -125,5 +125,5 @@
 {
 
-  fCams->ForEach(MBadPixelsCam, Clear)(); 
+  fCams->R__FOR_EACH(MBadPixelsCam, Clear)();
 
   return;
@@ -136,5 +136,5 @@
 void MBadPixelsIntensityCam::Print(Option_t *o) const
 {
-  fCams->ForEach(MBadPixelsCam, Print)(o); 
+  fCams->R__FOR_EACH(MBadPixelsCam, Print)(o);
 }
 
@@ -184,5 +184,5 @@
     InitSize(1);
 
-  fCams->ForEach(MBadPixelsCam,Init)(geom);
+  fCams->R__FOR_EACH(MBadPixelsCam,Init)(geom);
 }
 
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 7804)
@@ -563,5 +563,5 @@
 }
 
-void MBadPixelsTreat::StreamPrimitive(ofstream &out) const
+void MBadPixelsTreat::StreamPrimitive(ostream &out) const
 {
     out << "   MBadPixelsTreat " << GetUniqueName();
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 7804)
@@ -54,5 +54,6 @@
     Int_t  Process();
     Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print);
-    void   StreamPrimitive(ofstream &out) const;
+
+    void   StreamPrimitive(ostream &out) const;
 
 public:
Index: trunk/MagicSoft/Mars/mbase/MAGIC.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 7804)
@@ -21,4 +21,9 @@
 #endif
 
+#ifndef R__FOR_EACH
+#define R__FOR_EACH ForEach
+#endif
+
+
 //
 // Values for the eventloop control
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 7804)
@@ -736,5 +736,5 @@
 // gui elements to a macro-file.
 //
-void MEvtLoop::StreamPrimitive(ofstream &out) const
+void MEvtLoop::StreamPrimitive(ostream &out) const
 {
     out << "   MEvtLoop " << GetUniqueName();
@@ -747,5 +747,5 @@
 //
 //
-void MEvtLoop::SavePrimitive(ofstream &out, Option_t *opt)
+void MEvtLoop::SavePrimitive(ostream &out, Option_t *opt)
 {
     TString options = opt;
@@ -767,5 +767,5 @@
         {
             *fLog << err << "MEvtLoop::SavePrimitive - Error: old file not closed." << endl;
-            gListOfPrimitives->ForEach(TObject, ResetBit)(BIT(15));
+            gListOfPrimitives->R__FOR_EACH(TObject, ResetBit)(BIT(15));
             delete gListOfPrimitives;
         }
@@ -788,7 +788,12 @@
         return;
 
-    gListOfPrimitives->ForEach(TObject, ResetBit)(BIT(15));
+    gListOfPrimitives->R__FOR_EACH(TObject, ResetBit)(BIT(15));
     delete gListOfPrimitives;
     gListOfPrimitives = 0;
+}
+
+void MEvtLoop::SavePrimitive(ofstream &out, Option_t *o)
+{
+    SavePrimitive(static_cast<ostream&>(out), o);
 }
 
@@ -1041,5 +1046,6 @@
     }
 
-    return ReadEnv(TEnv(config), "", print);
+    const TEnv env(config);
+    return ReadEnv(env, "", print);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 7804)
@@ -37,5 +37,5 @@
     Bool_t HasDuplicateNames(TObjArray &arr, const TString txt) const;
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Bool_t ProcessGuiEvents(Int_t num);
@@ -78,4 +78,5 @@
     void MakeMacro(const char *filename="evtloop.C");
 
+    void SavePrimitive(ostream &out, Option_t *o="");
     void SavePrimitive(ofstream &out, Option_t *o="");
 
Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 7804)
@@ -264,5 +264,5 @@
     SetBit(kIsUnderlined);
 
-    fPlugins->ForEach(MLogPlugin, Underline)();
+    fPlugins->R__FOR_EACH(MLogPlugin, Underline)();
 
     if (TestBit(eNoColors))
@@ -353,6 +353,6 @@
         fOut->write(fBase, len);
 
-    fPlugins->ForEach(MLogPlugin, SetColor)(fOutputLevel);
-    fPlugins->ForEach(MLogPlugin, WriteBuffer)(fBase, len);
+    fPlugins->R__FOR_EACH(MLogPlugin, SetColor)(fOutputLevel);
+    fPlugins->R__FOR_EACH(MLogPlugin, WriteBuffer)(fBase, len);
 
     if (fDevice&eGui && fGui)
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 7804)
@@ -682,5 +682,5 @@
 // gui elements to a macro-file.
 //
-void MParContainer::SavePrimitive(ofstream &out, Option_t *o)
+void MParContainer::SavePrimitive(ostream &out, Option_t *o)
 {
     static UInt_t uid = 0;
@@ -698,9 +698,14 @@
 }
 
+void MParContainer::SavePrimitive(ofstream &out, Option_t *o)
+{
+    SavePrimitive(static_cast<ostream&>(out));
+}
+
 // --------------------------------------------------------------------------
 //
 // Creates the string written by SavePrimitive and returns it.
 //
-void MParContainer::StreamPrimitive(ofstream &out) const
+void MParContainer::StreamPrimitive(ostream &out) const
 {
     out << "   // Using MParContainer::StreamPrimitive" << endl;
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 7804)
@@ -94,4 +94,5 @@
     virtual void   Print(Option_t *option="") const;
     virtual Int_t  Sizeof() const;
+    virtual void   SavePrimitive(ostream &out, Option_t *o="");
     virtual void   SavePrimitive(ofstream &out, Option_t *o="");
 
@@ -108,8 +109,5 @@
     virtual void SetDisplay(MStatusDisplay *d) { fDisplay = d; }
 
-    // FIXME: Change to ostream! Seems to be difficult, because
-    //        MTaskListStreamPrimitive calls SavePrimitive(ofstream&).
-    //        Maybe with a cast?
-    virtual void StreamPrimitive(ofstream &out) const;
+    virtual void StreamPrimitive(ostream &out) const;
 
     TMethodCall *GetterMethod(const char *name) const;
Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 7804)
@@ -160,5 +160,5 @@
 void MParList::SetLogStream(MLog *log)
 {
-    fContainer->ForEach(MParContainer, SetLogStream)(log);
+    fContainer->R__FOR_EACH(MParContainer, SetLogStream)(log);
     MParContainer::SetLogStream(log);
 }
@@ -166,5 +166,5 @@
 void MParList::SetDisplay(MStatusDisplay *d)
 {
-    fContainer->ForEach(MParContainer, SetDisplay)(d);
+    fContainer->R__FOR_EACH(MParContainer, SetDisplay)(d);
     MParContainer::SetDisplay(d);
 }
@@ -659,5 +659,5 @@
 void MParList::SetReadyToSave(Bool_t flag)
 {
-    fContainer->ForEach(MParContainer, SetReadyToSave)(flag);
+    fContainer->R__FOR_EACH(MParContainer, SetReadyToSave)(flag);
     MParContainer::SetReadyToSave(flag);
 }
@@ -669,5 +669,5 @@
 void MParList::Reset()
 {
-    fContainer->ForEach(MParContainer, Reset)();
+    fContainer->R__FOR_EACH(MParContainer, Reset)();
 }
 
@@ -841,5 +841,5 @@
 }
 
-void MParList::SavePrimitive(ofstream &out, Option_t *o)
+void MParList::SavePrimitive(ostream &out, Option_t *o)
 {
     Bool_t saved = IsSavedAsPrimitive();
@@ -867,4 +867,9 @@
 }
 
+void MParList::SavePrimitive(ofstream &out, Option_t *o)
+{
+    SavePrimitive(static_cast<ostream&>(out), o);
+}
+
 // --------------------------------------------------------------------------
 //
@@ -873,5 +878,5 @@
 // gui elements to a macro-file.
 //
-void MParList::StreamPrimitive(ofstream &out) const
+void MParList::StreamPrimitive(ostream &out) const
 {
     out << "   MParList " << GetUniqueName();
@@ -894,5 +899,5 @@
 {
     MParContainer::GetNames(arr);
-    fContainer->ForEach(MParContainer, GetNames)(arr);
+    fContainer->R__FOR_EACH(MParContainer, GetNames)(arr);
 }
 
@@ -905,5 +910,5 @@
 {
     MParContainer::SetNames(arr);
-    fContainer->ForEach(MParContainer, SetNames)(arr);
+    fContainer->R__FOR_EACH(MParContainer, SetNames)(arr);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MParList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MParList.h	(revision 7804)
@@ -35,5 +35,5 @@
     enum { kIsOwner = BIT(14) };
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     void Init(const char *name, const char *title);
@@ -97,4 +97,5 @@
     void SetNames(TObjArray &arr);
 
+    void SavePrimitive(ostream &out, Option_t *o="");
     void SavePrimitive(ofstream &out, Option_t *o="");
 
Index: trunk/MagicSoft/Mars/mbase/MString.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MString.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MString.h	(revision 7804)
@@ -13,9 +13,12 @@
 public:
     MString(const char *txt=0)  : TString(txt) { }
-    MString(const TString &txt) : TString(txt) { }
+    MString(const MString &txt) : TString(txt) { }
 
     MString &Print(const char *fmt, va_list &ap);
     MString &Print(const char *fmt, ...);
+
+#ifndef __CINT__
     static MString Form(const char *fmt, ...);
+#endif
 
     ClassDef(MString, 1) // Tool to make Form() thread safe against other TStrings
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 7804)
@@ -455,5 +455,5 @@
 // and afterwards set the filter for this task.
 //
-void MTask::SavePrimitive(ofstream &out, Option_t *o)
+void MTask::SavePrimitive(ostream &out, Option_t *o)
 {
     MParContainer::SavePrimitive(out);
@@ -471,4 +471,9 @@
     if (fSerialNumber>0)
         out << "   " << GetUniqueName() << ".SetSerialNumber(" << fSerialNumber <<");" << endl;
+}
+
+void MTask::SavePrimitive(ofstream &out, Option_t *o)
+{
+    SavePrimitive(static_cast<ostream&>(out), o);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MTask.h	(revision 7804)
@@ -120,4 +120,5 @@
     virtual Int_t CallPostProcess();
 
+    void SavePrimitive(ostream &out, Option_t *o="");
     void SavePrimitive(ofstream &out, Option_t *o="");
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 7804)
@@ -144,5 +144,5 @@
 void MTaskList::SetLogStream(MLog *log)
 {
-    fTasks->ForEach(MTask, SetLogStream)(log);
+    fTasks->R__FOR_EACH(MTask, SetLogStream)(log);
     MTask::SetLogStream(log);
 }
@@ -154,5 +154,5 @@
 void MTaskList::SetDisplay(MStatusDisplay *d)
 {
-    fTasks->ForEach(MTask, SetDisplay)(d);
+    fTasks->R__FOR_EACH(MTask, SetDisplay)(d);
     MTask::SetDisplay(d);
 }
@@ -160,5 +160,5 @@
 void MTaskList::SetAccelerator(Byte_t acc)
 {
-    fTasks->ForEach(MTask, SetAccelerator)(acc);
+    fTasks->R__FOR_EACH(MTask, SetAccelerator)(acc);
     MTask::SetAccelerator(acc);
 }
@@ -171,5 +171,5 @@
 void MTaskList::SetSerialNumber(Byte_t num)
 {
-    fTasks->ForEach(MTask, SetSerialNumber)(num);
+    fTasks->R__FOR_EACH(MTask, SetSerialNumber)(num);
     MTask::SetSerialNumber(num);
 }
@@ -802,5 +802,5 @@
     //  create the Iterator for the TaskList
     //
-    fTasks->ForEach(MTask, PrintStatistics)(lvl+1, title, GetCpuTime());
+    fTasks->R__FOR_EACH(MTask, PrintStatistics)(lvl+1, title, GetCpuTime());
 
     if (lvl==0)
@@ -827,5 +827,5 @@
 // gui elements to a macro-file.
 //
-void MTaskList::StreamPrimitive(ofstream &out) const
+void MTaskList::StreamPrimitive(ostream &out) const
 {
     out << "   MTaskList " << GetUniqueName();
@@ -853,5 +853,5 @@
 {
     MParContainer::GetNames(arr);
-    fTasks->ForEach(MParContainer, GetNames)(arr);
+    fTasks->R__FOR_EACH(MParContainer, GetNames)(arr);
 }
 
@@ -859,5 +859,5 @@
 {
     MParContainer::SetNames(arr);
-    fTasks->ForEach(MParContainer, SetNames)(arr);
+    fTasks->R__FOR_EACH(MParContainer, SetNames)(arr);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 7804)
@@ -31,5 +31,5 @@
 
     void   Remove(MTask *task);
-    void   StreamPrimitive(ofstream &out) const;
+    void   StreamPrimitive(ostream &out) const;
     Bool_t CheckAddToList(MTask *task, const char *tType, const MTask *where=NULL) const;
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibConstCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibConstCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mcalib/MCalibConstCam.cc	(revision 7804)
@@ -227,7 +227,7 @@
 void MCalibConstCam::Clear(Option_t *o)
 {
-    { fArray->ForEach(TObject, Clear)(); }
-    { fAverageAreas->ForEach(TObject, Clear)(); }
-    { fAverageSectors->ForEach(TObject, Clear)(); }
+    { fArray->R__FOR_EACH(TObject, Clear)(); }
+    { fAverageAreas->R__FOR_EACH(TObject, Clear)(); }
+    { fAverageSectors->R__FOR_EACH(TObject, Clear)(); }
   
 }
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 7804)
@@ -845,5 +845,5 @@
 // gui elements to a macro-file.
 //
-void MCalibrateData::StreamPrimitive(ofstream &out) const
+void MCalibrateData::StreamPrimitive(ostream &out) const
 {
     out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.h	(revision 7804)
@@ -97,5 +97,5 @@
   Int_t  Process();
   Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print);
-  void   StreamPrimitive(ofstream &out) const;
+  void   StreamPrimitive(ostream &out) const;
   
 public:
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc	(revision 7804)
@@ -171,5 +171,5 @@
 
   fPulserColor = col;
-  fPixels->ForEach(MCalibrationBlindPix, SetColor)(col);
+  fPixels->R__FOR_EACH(MCalibrationBlindPix, SetColor)(col);
 
 }
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 7804)
@@ -170,10 +170,7 @@
 void MCalibrationCam::Clear(Option_t *o)
 {
-
-  {  fPixels        ->ForEach(TObject, Clear)();  }
-  {  fAverageAreas  ->ForEach(TObject, Clear)();  }
-  {  fAverageSectors->ForEach(TObject, Clear)();  }
-  
-  return;
+    { fPixels        ->R__FOR_EACH(TObject, Clear)();  }
+    { fAverageAreas  ->R__FOR_EACH(TObject, Clear)();  }
+    { fAverageSectors->R__FOR_EACH(TObject, Clear)();  }
 }
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc	(revision 7804)
@@ -187,6 +187,6 @@
 void MCalibrationIntensityCam::Clear(Option_t *o)
 {
-    fCams->ForEach(MCalibrationCam, Clear)();
-    fHists->ForEach(MHCalibrationCam, Clear)();
+    fCams->R__FOR_EACH(MCalibrationCam, Clear)();
+    fHists->R__FOR_EACH(MHCalibrationCam, Clear)();
 }
 
@@ -197,6 +197,6 @@
 void MCalibrationIntensityCam::Print(Option_t *o) const
 {
-    fCams->ForEach(MCalibrationCam, Print)(o);
-    fHists->ForEach(MHCalibrationCam, Print)(o);
+    fCams->R__FOR_EACH(MCalibrationCam, Print)(o);
+    fHists->R__FOR_EACH(MHCalibrationCam, Print)(o);
 }
 
@@ -244,5 +244,5 @@
     InitSize(1);
 
-  fCams->ForEach(MCalibrationCam,Init)(geom);
+  fCams->R__FOR_EACH(MCalibrationCam,Init)(geom);
 }
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityConstCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityConstCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityConstCam.cc	(revision 7804)
@@ -113,7 +113,5 @@
 void MCalibrationIntensityConstCam::Clear(Option_t *o)
 {
-
-  fCams->ForEach(MCalibConstCam, Clear)(); 
-  return;
+  fCams->R__FOR_EACH(MCalibConstCam, Clear)();
 }
 
@@ -124,5 +122,5 @@
 void MCalibrationIntensityConstCam::Print(Option_t *o) const
 {
-  fCams->ForEach(MCalibConstCam, Print)(o); 
+  fCams->R__FOR_EACH(MCalibConstCam, Print)(o);
 }
 
@@ -160,5 +158,5 @@
     InitSize(1);
 
-  fCams->ForEach(MCalibConstCam,Init)(geom);
+  fCams->R__FOR_EACH(MCalibConstCam,Init)(geom);
 }
 
Index: trunk/MagicSoft/Mars/mdata/MDataArray.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataArray.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mdata/MDataArray.cc	(revision 7804)
@@ -187,5 +187,5 @@
 Bool_t MDataArray::AsciiWrite(ostream &out) const
 {
-    ((TObjArray)fList).ForEach(MParContainer, AsciiWrite)(out);
+    ((TObjArray)fList).R__FOR_EACH(MParContainer, AsciiWrite)(out);
     return kTRUE;
 }
@@ -197,5 +197,5 @@
 // gui elements to a macro-file.
 //
-void MDataArray::StreamPrimitive(ofstream &out) const
+void MDataArray::StreamPrimitive(ostream &out) const
 {
     out << "   MDataArray " << GetUniqueName();
@@ -255,4 +255,4 @@
 void MDataArray::SetVariables(const TArrayD &arr)
 {
-    fList.ForEach(MData, SetVariables)(arr);
-}
+    fList.R__FOR_EACH(MData, SetVariables)(arr);
+}
Index: trunk/MagicSoft/Mars/mdata/MDataArray.h
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataArray.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mdata/MDataArray.h	(revision 7804)
@@ -26,5 +26,5 @@
     TObjArray fList;
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
 public:
Index: trunk/MagicSoft/Mars/mdata/MDataFormula.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataFormula.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mdata/MDataFormula.cc	(revision 7804)
@@ -317,5 +317,5 @@
 void MDataFormula::SetVariables(const TArrayD &arr)
 {
-    fMembers.ForEach(MData, SetVariables)(arr);
-}
-
+    fMembers.R__FOR_EACH(MData, SetVariables)(arr);
+}
+
Index: trunk/MagicSoft/Mars/mdata/MDataList.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataList.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mdata/MDataList.cc	(revision 7804)
@@ -398,4 +398,4 @@
 void MDataList::SetVariables(const TArrayD &arr)
 {
-    fMembers.ForEach(MData, SetVariables)(arr);
-}
+    fMembers.R__FOR_EACH(MData, SetVariables)(arr);
+}
Index: trunk/MagicSoft/Mars/mfbase/MF.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 7804)
@@ -414,5 +414,5 @@
 }
 
-void MF::StreamPrimitive(ofstream &out) const
+void MF::StreamPrimitive(ostream &out) const
 {
     out << "   MF " << GetUniqueName();
Index: trunk/MagicSoft/Mars/mfbase/MF.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MF.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MF.h	(revision 7804)
@@ -31,5 +31,5 @@
     MFilter *ParseString(TString txt, Int_t level);
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
 public:
Index: trunk/MagicSoft/Mars/mfbase/MFDataChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataChain.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFDataChain.cc	(revision 7804)
@@ -146,5 +146,5 @@
 //  Crahses if default constructor called.
 //
-void MFDataChain::StreamPrimitive(ofstream &out) const
+void MFDataChain::StreamPrimitive(ostream &out) const
 {
     out << "   MFDataChain " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/mfbase/MFDataChain.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataChain.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFDataChain.h	(revision 7804)
@@ -28,5 +28,5 @@
     Bool_t  fResult;           //!
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Int_t PreProcess(MParList *pList);
Index: trunk/MagicSoft/Mars/mfbase/MFDataMember.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataMember.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFDataMember.cc	(revision 7804)
@@ -139,5 +139,5 @@
 }
 
-void MFDataMember::StreamPrimitive(ofstream &out) const
+void MFDataMember::StreamPrimitive(ostream &out) const
 {
     out << "   MFDataMember " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/mfbase/MFDataMember.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataMember.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFDataMember.h	(revision 7804)
@@ -22,5 +22,5 @@
     Double_t fValue;
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Int_t PreProcess(MParList *pList);
Index: trunk/MagicSoft/Mars/mfbase/MFEventSelector.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFEventSelector.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFEventSelector.cc	(revision 7804)
@@ -208,24 +208,2 @@
     return kTRUE;
 }
-
-void MFEventSelector::StreamPrimitive(ofstream &out) const
-{
-    /*
-    out << "   MF " << GetUniqueName();
-
-    if (!fFilter)
-    {
-        out << ";" << endl;
-        return;
-    }
-
-    out << "(\"" << fFilter->GetRule() << "\"";
-        if (fName!=gsDefName || fTitle!=gsDefTitle)
-    {
-        out << "(\"" << fName << "\"";
-        if (fTitle!=gsDefTitle)
-            out << ", \"" << fTitle << "\"";
-    }
-    out << ");" << endl;
-    */
-}
Index: trunk/MagicSoft/Mars/mfbase/MFEventSelector.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFEventSelector.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFEventSelector.h	(revision 7804)
@@ -19,6 +19,4 @@
     Bool_t  fResult;          //! Reseult of a single selection
 
-    void StreamPrimitive(ofstream &out) const;
-
     Int_t PreProcess(MParList *pList);
     Int_t Process();
Index: trunk/MagicSoft/Mars/mfbase/MFilterList.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFilterList.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFilterList.cc	(revision 7804)
@@ -264,5 +264,5 @@
 void MFilterList::SetAccelerator(Byte_t acc)
 {
-    fFilters.ForEach(MTask, SetAccelerator)(acc);
+    fFilters.R__FOR_EACH(MTask, SetAccelerator)(acc);
     MFilter::SetAccelerator(acc);
 }
@@ -377,5 +377,5 @@
 // gui elements to a macro-file.
 //
-void MFilterList::StreamPrimitive(ofstream &out) const
+void MFilterList::StreamPrimitive(ostream &out) const
 {
     out << "   MFilterList " << ToLower(fName) << "(\"";
@@ -506,4 +506,4 @@
 void MFilterList::SetVariables(const TArrayD &arr)
 {
-    fFilters.ForEach(MFilter, SetVariables)(arr);
-}
+    fFilters.R__FOR_EACH(MFilter, SetVariables)(arr);
+}
Index: trunk/MagicSoft/Mars/mfbase/MFilterList.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFilterList.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfbase/MFilterList.h	(revision 7804)
@@ -29,5 +29,5 @@
     enum { kIsOwner = BIT(14) };
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     void Init(const char *name, const char *title);
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 7804)
@@ -1198,5 +1198,5 @@
 // gui elements to a macro-file.
 //
-void MReadTree::StreamPrimitive(ofstream &out) const
+void MReadTree::StreamPrimitive(ostream &out) const
 {
     out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.h	(revision 7804)
@@ -46,5 +46,5 @@
 
     virtual void SetReadyToSave(Bool_t flag=kTRUE);
-    virtual void StreamPrimitive(ofstream &out) const;
+    virtual void StreamPrimitive(ostream &out) const;
 
     enum { kIsOwner = BIT(14) };
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 7804)
@@ -1068,5 +1068,5 @@
 // gui elements to a macro-file.
 //
-void MWriteRootFile::StreamPrimitive(ofstream &out) const
+void MWriteRootFile::StreamPrimitive(ostream &out) const
 {
     out << "   MWriteRootFile " << GetUniqueName();
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 7804)
@@ -108,5 +108,5 @@
     // MTask
     Bool_t ReInit(MParList *pList);
-    void   StreamPrimitive(ofstream &out) const;
+    void   StreamPrimitive(ostream &out) const;
 
     // Constructor
Index: trunk/MagicSoft/Mars/mfilter/MFParticleId.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFParticleId.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfilter/MFParticleId.cc	(revision 7804)
@@ -124,5 +124,5 @@
 }
 
-void MFParticleId::StreamPrimitive(ofstream &out) const
+void MFParticleId::StreamPrimitive(ostream &out) const
 {
     if (fMcEvt)
Index: trunk/MagicSoft/Mars/mfilter/MFParticleId.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFParticleId.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfilter/MFParticleId.h	(revision 7804)
@@ -30,5 +30,5 @@
               const char *name, const char *title);
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Int_t PreProcess(MParList *pList);
Index: trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc	(revision 7804)
@@ -119,5 +119,5 @@
 }
 
-void MFTriggerLvl1::StreamPrimitive(ofstream &out) const
+void MFTriggerLvl1::StreamPrimitive(ostream &out) const
 {
     if (fMcTrig)
Index: trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.h	(revision 7804)
@@ -30,5 +30,5 @@
               const char *name, const char *title);
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Int_t PreProcess(MParList *pList);
Index: trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.cc	(revision 7804)
@@ -127,5 +127,5 @@
 }
 
-void MFTriggerLvl2::StreamPrimitive(ofstream &out) const
+void MFTriggerLvl2::StreamPrimitive(ostream &out) const
 {
    if (fcell)
Index: trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.h	(revision 7804)
@@ -36,5 +36,5 @@
               const char *name, const char *title);
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Int_t PreProcess(MParList *pList);
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7804)
@@ -16,9 +16,9 @@
 !
 !
-!   Author(s): Thomas Bretz     12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!              Harald Kornmayer 01/2001
-!              Markus Gaug      03/2004 <mailto:markus@ifae.es>
+!   Author(s): Thomas Bretz     12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Harald Kornmayer 01/2001
+!   Author(s): Markus Gaug      03/2004 <mailto:markus@ifae.es>
 !
-!   Copyright: MAGIC Software Development, 2000-2004
+!   Copyright: MAGIC Software Development, 2000-2005
 !
 \* ======================================================================== */
@@ -135,5 +135,5 @@
 void MGeomCam::InitOuterRing()
 {
-    fPixels.ForEach(MGeomPix, CheckOuterRing)(*this);
+    fPixels.R__FOR_EACH(MGeomPix, CheckOuterRing)(*this);
 }
 
Index: trunk/MagicSoft/Mars/mhbase/MBinning.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MBinning.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MBinning.cc	(revision 7804)
@@ -556,5 +556,5 @@
 // gui elements to a macro-file.
 //
-void MBinning::StreamPrimitive(ofstream &out) const
+void MBinning::StreamPrimitive(ostream &out) const
 {
     out << "   MBinning " << GetUniqueName();
Index: trunk/MagicSoft/Mars/mhbase/MBinning.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MBinning.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MBinning.h	(revision 7804)
@@ -27,5 +27,5 @@
     Byte_t  fType;
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     enum {
Index: trunk/MagicSoft/Mars/mhbase/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 7804)
@@ -609,5 +609,5 @@
 // gui elements to a macro-file.
 //
-void MFillH::StreamPrimitive(ofstream &out) const
+void MFillH::StreamPrimitive(ostream &out) const
 {
     if (fH)
Index: trunk/MagicSoft/Mars/mhbase/MFillH.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MFillH.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MFillH.h	(revision 7804)
@@ -45,5 +45,5 @@
     void Init(const char *name, const char *title);
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Bool_t DrawToDisplay();
Index: trunk/MagicSoft/Mars/mhbase/MH3.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH3.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MH3.cc	(revision 7804)
@@ -630,5 +630,5 @@
 // gui elements to a macro-file.
 //
-void MH3::StreamPrimitive(ofstream &out) const
+void MH3::StreamPrimitive(ostream &out) const
 {
     TString name = GetUniqueName();
Index: trunk/MagicSoft/Mars/mhbase/MH3.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH3.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MH3.h	(revision 7804)
@@ -26,5 +26,5 @@
     Double_t    fScale[3];       // Scale for the three axis (eg unit)
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     enum {
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 7804)
@@ -586,5 +586,5 @@
 // gui elements to a macro-file.
 //
-void MHMatrix::StreamPrimitive(ofstream &out) const
+void MHMatrix::StreamPrimitive(ostream &out) const
 {
     Bool_t data = fData && !TestBit(kIsOwner);
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 7804)
@@ -61,5 +61,5 @@
     void GetRandomArrayI(TArrayI &ind) const;
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
 public:
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc	(revision 7804)
@@ -396,12 +396,12 @@
 
   if (fHiGainArray)
-    { fHiGainArray->ForEach(MHCalibrationPix,Reset)();  }
+    { fHiGainArray->R__FOR_EACH(MHCalibrationPix,Reset)();  }
 
   if (IsAverageing())
     {
       if (fAverageHiGainAreas)
-        { fAverageHiGainAreas->ForEach(MHCalibrationPix,Reset)();  }
+        { fAverageHiGainAreas->R__FOR_EACH(MHCalibrationPix,Reset)();  }
       if (fAverageHiGainSectors)
-        { fAverageHiGainSectors->ForEach(MHCalibrationPix,Reset)();  }
+        { fAverageHiGainSectors->R__FOR_EACH(MHCalibrationPix,Reset)();  }
     }
 
@@ -410,11 +410,11 @@
 
   if (fLoGainArray)
-    { fLoGainArray->ForEach(MHCalibrationPix,Reset)();  }
+    { fLoGainArray->R__FOR_EACH(MHCalibrationPix,Reset)();  }
   if (IsAverageing())
     {
       if (fAverageLoGainAreas)
-        { fAverageLoGainAreas->ForEach(MHCalibrationPix,Reset)();  }
+        { fAverageLoGainAreas->R__FOR_EACH(MHCalibrationPix,Reset)();  }
       if (fAverageLoGainSectors)
-        { fAverageLoGainSectors->ForEach(MHCalibrationPix,Reset)();  }
+        { fAverageLoGainSectors->R__FOR_EACH(MHCalibrationPix,Reset)();  }
     }
 }
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 7804)
@@ -418,5 +418,5 @@
 // gui elements to a macro-file.
 //
-void MHillasCalc::StreamPrimitive(ofstream &out) const
+void MHillasCalc::StreamPrimitive(ostream &out) const
 {
     out << "   MHillasCalc " << GetUniqueName() << "(";
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.h	(revision 7804)
@@ -68,5 +68,6 @@
 
     // MParContainer
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
+
     Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
 
Index: trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 7804)
@@ -808,5 +808,5 @@
 // gui elements to a macro-file.
 //
-void MImgCleanStd::StreamPrimitive(ofstream &out) const
+void MImgCleanStd::StreamPrimitive(ostream &out) const
 {
     out << "   MImgCleanStd " << GetUniqueName() << "(";
Index: trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanStd.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanStd.h	(revision 7804)
@@ -58,6 +58,7 @@
     // MGTask, MTask, MParContainer
     void    CreateGuiElements(MGGroupFrame *f);
-    void    StreamPrimitive(ofstream &out) const;
     Int_t   ReadEnv(const TEnv &env, TString prefix, Bool_t print);
+
+    void    StreamPrimitive(ostream &out) const;
 
     Int_t PreProcess(MParList *pList);
Index: trunk/MagicSoft/Mars/mimage/MImgCleanTGB.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanTGB.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanTGB.cc	(revision 7804)
@@ -432,5 +432,5 @@
 // gui elements to a macro-file.
 //
-void MImgCleanTGB::StreamPrimitive(ofstream &out) const
+void MImgCleanTGB::StreamPrimitive(ostream &out) const
 {
     out << "   MImgCleanTGB " << GetUniqueName() << "(";
Index: trunk/MagicSoft/Mars/mimage/MImgCleanTGB.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanTGB.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanTGB.h	(revision 7804)
@@ -38,5 +38,5 @@
 
     void CreateGuiElements(MGGroupFrame *f);
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     Int_t CleanStep3b(MCerPhotPix &pix);
Index: trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 7804)
@@ -462,5 +462,5 @@
     // Now you can display the results
     //
-    hists.ForEach(TObject, DrawClone)();
+    hists.R__FOR_EACH(TObject, DrawClone)();
 }
 
Index: trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc	(revision 7804)
@@ -17,5 +17,5 @@
 !
 !   Author(s): Thomas Bretz, 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
-!              Hendrik Bartko, 07/2003 <mailto:hbartko@mppmu.mpg.de>
+!   Author(s): Hendrik Bartko, 07/2003 <mailto:hbartko@mppmu.mpg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2004
@@ -244,7 +244,7 @@
 void MPedPhotCam::Clear(Option_t *o)
 {
-    { fArray->ForEach(TObject, Clear)(); }
-    { fAreas->ForEach(TObject, Clear)(); }
-    { fSectors->ForEach(TObject, Clear)(); }
+    { fArray->R__FOR_EACH(TObject, Clear)(); }
+    { fAreas->R__FOR_EACH(TObject, Clear)(); }
+    { fSectors->R__FOR_EACH(TObject, Clear)(); }
 }
 
Index: trunk/MagicSoft/Mars/mpedestal/MPedestalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedestalCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mpedestal/MPedestalCam.cc	(revision 7804)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz   12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!              Markus Gaug    02/2004 <mailto:markus@ifae.es>
-!              Florian Goebel 06/2004 <mailto:fgoebel@mppmu.mpg.de>
+!   Author(s): Thomas Bretz   12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Markus Gaug    02/2004 <mailto:markus@ifae.es>
+!   Author(s): Florian Goebel 06/2004 <mailto:fgoebel@mppmu.mpg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2004
@@ -269,7 +269,7 @@
 void MPedestalCam::Clear(Option_t *o)
 {
-    { fArray->ForEach(TObject, Clear)(); }
-    { fAverageAreas->ForEach(TObject, Clear)(); }
-    { fAverageSectors->ForEach(TObject, Clear)(); }
+    { fArray->R__FOR_EACH(TObject, Clear)(); }
+    { fAverageAreas->R__FOR_EACH(TObject, Clear)(); }
+    { fAverageSectors->R__FOR_EACH(TObject, Clear)(); }
   
     fTotalEntries = 0;
Index: trunk/MagicSoft/Mars/mpointing/MSrcPosCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MSrcPosCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mpointing/MSrcPosCam.cc	(revision 7804)
@@ -136,5 +136,5 @@
 // gui elements to a macro-file.
 //
-void MSrcPosCam::StreamPrimitive(ofstream &out) const
+void MSrcPosCam::StreamPrimitive(ostream &out) const
 {
     out << "   MSrcPosCam " << GetUniqueName();
@@ -148,3 +148,4 @@
     out << ";" << endl;
 
-    out << "   " << GetUniqueName() << ".SetXY(" << fX << ", " << fY << ");" << endl;}
+    out << "   " << GetUniqueName() << ".SetXY(" << fX << ", " << fY << ");" << endl;
+}
Index: trunk/MagicSoft/Mars/mpointing/MSrcPosCam.h
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MSrcPosCam.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mpointing/MSrcPosCam.h	(revision 7804)
@@ -31,7 +31,7 @@
     TVector2 GetXY() const;
 
+    void Print(Option_t *opt=NULL) const;
 
-    void Print(Option_t *opt=NULL) const;
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     //void AsciiRead(ifstream &fin);
Index: trunk/MagicSoft/Mars/mranforest/MRanTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 7804)
@@ -34,6 +34,4 @@
 #include <iostream>
 
-#include <TVector.h>
-#include <TMatrix.h>
 #include <TRandom.h>
 
@@ -691,5 +689,5 @@
 }
 
-Double_t MRanTree::TreeHad(const TMatrixRow &event)
+Double_t MRanTree::TreeHad(const TMatrixFRow_const &event)
 {
     return TreeHad(event.GetPtr());
Index: trunk/MagicSoft/Mars/mranforest/MRanTree.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanTree.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mranforest/MRanTree.h	(revision 7804)
@@ -14,7 +14,13 @@
 #endif
 
-class TMatrix;
+#ifndef ROOT_TVector
+#include <TVector.h>
+#endif
+
+#ifndef ROOT_TMatrix
+#include <TMatrix.h>
+#endif
+
 class TMatrixRow;
-class TVector;
 class TRandom;
 
@@ -103,5 +109,5 @@
 
     Double_t TreeHad(const TVector &event);
-    Double_t TreeHad(const TMatrixRow &event);
+    Double_t TreeHad(const TMatrixFRow_const &event);
     Double_t TreeHad(const TMatrix &m, Int_t ievt);
 
Index: trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 7804)
@@ -154,5 +154,5 @@
             return kFALSE;
 
-    fList->ForEach(MReportHelp, AddToList)(*pList);
+    fList->R__FOR_EACH(MReportHelp, AddToList)(*pList);
 
     //
Index: trunk/MagicSoft/Mars/msignal/MArrivalTimeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MArrivalTimeCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MArrivalTimeCam.cc	(revision 7804)
@@ -72,5 +72,5 @@
 void MArrivalTimeCam::SetLogStream(MLog *lg)
 {
-    fArray->ForEach(MParContainer, SetLogStream)(lg);
+    fArray->R__FOR_EACH(MParContainer, SetLogStream)(lg);
     MParContainer::SetLogStream(lg);
 }
@@ -114,5 +114,5 @@
 void MArrivalTimeCam::Clear(Option_t *o)
 {
-    fArray->ForEach(TObject, Clear)();
+    fArray->R__FOR_EACH(TObject, Clear)();
 }
 
Index: trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 7804)
@@ -290,5 +290,5 @@
 // gui elements to a macro-file.
 //
-void MExtractFixedWindow::StreamPrimitive(ofstream &out) const
+void MExtractFixedWindow::StreamPrimitive(ostream &out) const
 {
 
Index: trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h	(revision 7804)
@@ -24,6 +24,7 @@
   void   FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Float_t &sum, Byte_t &sat) const;
   void   FindSignalLoGain(Byte_t *ptr, Float_t &sum, Byte_t &sat) const;
-  void   StreamPrimitive(ofstream &out) const;
-  
+
+  void   StreamPrimitive(ostream &out) const;
+
   Bool_t ReInit(MParList *pList);
   
Index: trunk/MagicSoft/Mars/msignal/MExtractSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractSignal.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractSignal.cc	(revision 7804)
@@ -194,5 +194,5 @@
 // gui elements to a macro-file.
 //
-void MExtractSignal::StreamPrimitive(ofstream &out) const
+void MExtractSignal::StreamPrimitive(ostream &out) const
 {
     out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/msignal/MExtractSignal.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractSignal.h	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractSignal.h	(revision 7804)
@@ -49,5 +49,6 @@
     Int_t  PreProcess(MParList *pList);
     Int_t  Process();
-    void   StreamPrimitive(ofstream &out) const;
+
+    void   StreamPrimitive(ostream &out) const;
 
 public:
Index: trunk/MagicSoft/Mars/msignal/MExtractSignalABcorr.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractSignalABcorr.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractSignalABcorr.cc	(revision 7804)
@@ -214,5 +214,5 @@
 // gui elements to a macro-file.
 //
-void MExtractSignalABcorr::StreamPrimitive(ofstream &out) const
+void MExtractSignalABcorr::StreamPrimitive(ostream &out) const
 {
     out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/msignal/MExtractSignalABcorr.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractSignalABcorr.h	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractSignalABcorr.h	(revision 7804)
@@ -49,5 +49,6 @@
     Int_t  PreProcess(MParList *pList);
     Int_t  Process();
-    void   StreamPrimitive(ofstream &out) const;
+
+    void   StreamPrimitive(ostream &out) const;
 
 public:
Index: trunk/MagicSoft/Mars/msignal/MExtractedSignalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractedSignalCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractedSignalCam.cc	(revision 7804)
@@ -74,5 +74,5 @@
 void MExtractedSignalCam::SetLogStream(MLog *lg)
 {
-    fArray->ForEach(MParContainer, SetLogStream)(lg);
+    fArray->R__FOR_EACH(MParContainer, SetLogStream)(lg);
     MParContainer::SetLogStream(lg);
 }
@@ -116,5 +116,4 @@
 Float_t MExtractedSignalCam::GetProb( const Int_t pixidx )   const
 { 
-
   if (pixidx > GetSize()-1)
     return -1.;
@@ -125,5 +124,5 @@
 void MExtractedSignalCam::Clear(Option_t *o)
 {
-    fArray->ForEach(TObject, Clear)();
+    fArray->R__FOR_EACH(TObject, Clear)();
 }
 
Index: trunk/MagicSoft/Mars/msignal/MExtractor.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractor.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractor.cc	(revision 7804)
@@ -341,5 +341,5 @@
 // gui elements to a macro-file.
 //
-void MExtractor::StreamPrimitive(ofstream &out) const
+void MExtractor::StreamPrimitive(ostream &out) const
 {
   out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
Index: trunk/MagicSoft/Mars/msignal/MExtractor.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractor.h	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MExtractor.h	(revision 7804)
@@ -74,5 +74,5 @@
   Bool_t  ReInit    ( MParList *pList );
   Int_t   Process   ();
-  void    StreamPrimitive(ofstream &out) const;
+  void    StreamPrimitive(ostream &out) const;
   Int_t   ReadEnv(const TEnv &env, TString prefix, Bool_t print);
 
Index: trunk/MagicSoft/Mars/msignal/MSignalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7804)
@@ -104,5 +104,5 @@
     fNumPixelsSaturatedLoGain = -1;
 
-    fPixels->ForEach(TObject, Clear)();
+    fPixels->R__FOR_EACH(TObject, Clear)();
 }
 /*
Index: trunk/MagicSoft/Mars/msignal/Makefile
===================================================================
--- trunk/MagicSoft/Mars/msignal/Makefile	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/Makefile	(revision 7804)
@@ -39,8 +39,4 @@
            MExtractFixedWindowSpline.cc \
            MExtractAmplitudeSpline.cc \
-           MExtractSignal.cc \
-           MExtractSignal2.cc \
-           MExtractSignal3.cc \
-           MExtractSignalABcorr.cc \
 	   MExtractPINDiode.cc \
 	   MExtractBlindPixel.cc \
@@ -60,4 +56,9 @@
 	   MArrivalTimePix.cc
 
+#           MExtractSignal.cc \
+#           MExtractSignal2.cc \
+#           MExtractSignal3.cc \
+#           MExtractSignalABcorr.cc \
+
 ############################################################
 
Index: trunk/MagicSoft/Mars/msignal/SignalLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/SignalLinkDef.h	(revision 7803)
+++ trunk/MagicSoft/Mars/msignal/SignalLinkDef.h	(revision 7804)
@@ -10,8 +10,8 @@
 #pragma link C++ class MExtractedSignalBlindPixel+;
 
-#pragma link C++ class MExtractSignal+;
-#pragma link C++ class MExtractSignal2+;
-#pragma link C++ class MExtractSignal3+;
-#pragma link C++ class MExtractSignalABcorr+;
+//#pragma link C++ class MExtractSignal+;
+//#pragma link C++ class MExtractSignal2+;
+//#pragma link C++ class MExtractSignal3+;
+//#pragma link C++ class MExtractSignalABcorr+;
 
 #pragma link C++ class MExtractor+;
Index: trunk/MagicSoft/Mars/mtools/MChisqEval.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 7803)
+++ trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 7804)
@@ -154,5 +154,5 @@
 }
 
-void MChisqEval::StreamPrimitive(ofstream &out) const
+void MChisqEval::StreamPrimitive(ostream &out) const
 {
     out << "   MChisqEval " << GetUniqueName() << ";";
Index: trunk/MagicSoft/Mars/mtools/MChisqEval.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MChisqEval.h	(revision 7803)
+++ trunk/MagicSoft/Mars/mtools/MChisqEval.h	(revision 7804)
@@ -23,5 +23,5 @@
     TString fNameResult;
 
-    void StreamPrimitive(ofstream &out) const;
+    void StreamPrimitive(ostream &out) const;
 
     enum { kIsOwner = BIT(14) };
