Index: trunk/Mars/mfileio/MFitsArray.h
===================================================================
--- trunk/Mars/mfileio/MFitsArray.h	(revision 14870)
+++ trunk/Mars/mfileio/MFitsArray.h	(revision 14935)
@@ -4,10 +4,14 @@
 //#include "astroroot.h"
 //#include "fitsio.h"
-#include "../mcore/fits.h"
-#include "../mcore/ofits.h"
+#ifndef MARS_fits
+#include "fits.h"
+#endif
+
+#ifndef MARS_ofits
+#include "ofits.h"
+#endif
 
 class TClonesArray;
 class MLog;
-
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -18,5 +22,5 @@
 
    // the FITS table to which the data are written                      
-   std::ofits*     fFitsTable;
+   ofits*     fFitsTable;
    
    // number of elements in fClonesArray / MArrayX / TArrayX  during 
@@ -26,5 +30,5 @@
 
 public:
-   std::ofits* GetFitsTable()     {return fFitsTable;}
+   ofits* GetFitsTable()     {return fFitsTable;}
    UInt_t *      GetArraySizePtr()  {return &fArraySize;}
 
Index: trunk/Mars/mfileio/MTopFitsGroup.cc
===================================================================
--- trunk/Mars/mfileio/MTopFitsGroup.cc	(revision 14870)
+++ trunk/Mars/mfileio/MTopFitsGroup.cc	(revision 14935)
@@ -8,5 +8,5 @@
 // Note: This FITS group as well as the table must be open, before calling     
 //       this method!                                                          
-void MTopFitsGroup::Attach(std::ofits* table)
+void MTopFitsGroup::Attach(ofits* table)
 {
 //   fTopGroup.SetChild(table);
@@ -19,5 +19,5 @@
 // If table is an already open FITS table, then that table we be closed,       
 // before the new child is assigned to "table"                                 
-Bool_t MTopFitsGroup::GetNextChild(std::ofits* table)
+Bool_t MTopFitsGroup::GetNextChild(ofits* table)
 {
 //   fTopGroup.SetChild(table);
Index: trunk/Mars/mfileio/MTopFitsGroup.h
===================================================================
--- trunk/Mars/mfileio/MTopFitsGroup.h	(revision 14870)
+++ trunk/Mars/mfileio/MTopFitsGroup.h	(revision 14935)
@@ -1,15 +1,19 @@
 #ifndef MARS_MTopFitsGroup
 #define MARS_MTopFitsGroup
-
 
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "TString.h"
+#ifndef ROOT_TString
+#include <TString.h>
+#endif
 
-//#include "astroroot.h"
-//#include "fitsio.h"
-#include "../mcore/fits.h"
-#include "../mcore/ofits.h"
+#ifndef MARS_fits
+#include "fits.h"
+#endif
+
+#ifndef MARS_ofits
+#include "ofits.h"
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -40,5 +44,5 @@
 
    // the top level group as AstroROOT-2 data structure                   
-   std::ofits*    fTopGroup;
+   ofits*    fTopGroup;
 
    // number of usage of this group by different MWriteFitsFile instances 
@@ -46,5 +50,5 @@
 
 public:
-   MTopFitsGroup(const char * fileName, std::ofits* file) : fFileName(fileName),
+   MTopFitsGroup(const char * fileName, ofits* file) : fFileName(fileName),
                                           fTopGroup(file),
                                           fNumOpen(1)
@@ -55,9 +59,9 @@
    Int_t  GetNumUsage()                 {return fNumOpen;}
 
-   void   Attach(std::ofits* table);
-   Bool_t GetNextChild(std::ofits* table);
+   void   Attach(ofits* table);
+   Bool_t GetNextChild(ofits* table);
 
-   std::ofits*  GetGroup()        {return fTopGroup;}
-   TString        &  GetFileName()     {return fFileName;}
+   ofits*  GetGroup()        {return fTopGroup;}
+   const TString &GetFileName() const {return fFileName;}
 
 };
Index: trunk/Mars/mfileio/MWriteFitsFile.cc
===================================================================
--- trunk/Mars/mfileio/MWriteFitsFile.cc	(revision 14870)
+++ trunk/Mars/mfileio/MWriteFitsFile.cc	(revision 14935)
@@ -20,10 +20,6 @@
 
 ClassImp(MWriteFitsFile);
-//ClassImp(MArrayHelper);
-//ClassImp(MTopFitsGroup);
 
 using namespace std;
-//ClassImp(std::ofits);
-
 
 map<MUniqueFileId, MTopFitsGroup> MWriteFitsFile::fTopFitsGroups;
@@ -98,5 +94,5 @@
 MWriteFitsFile::~MWriteFitsFile()
 {
-    for (std::map<TString, std::ofits*>::iterator it=fFitsTables.begin(); it!= fFitsTables.end();it++)
+    for (std::map<TString, ofits*>::iterator it=fFitsTables.begin(); it!= fFitsTables.end();it++)
     {
         if (it->second != NULL)
@@ -332,5 +328,5 @@
 Int_t MWriteFitsFile::PostProcess()
 {
-    for (std::map<TString, std::ofits*>::iterator it=fFitsTables.begin(); it!= fFitsTables.end();it++)
+    for (std::map<TString, ofits*>::iterator it=fFitsTables.begin(); it!= fFitsTables.end();it++)
     {
         it->second->close();
@@ -479,5 +475,5 @@
                               const char* unit,
                               const char* comment,
-                              std::ofits* outFile)
+                              ofits* outFile)
 {
     if (outFile == NULL)
@@ -1089,5 +1085,5 @@
    // close the current files
    CloseTopLevelGroup();
-   for (std::map<TString,std::ofits*>::iterator it=fFitsTables.begin(); it!=fFitsTables.end(); it++)
+   for (std::map<TString,ofits*>::iterator it=fFitsTables.begin(); it!=fFitsTables.end(); it++)
    {
        (it->second)->close();
Index: trunk/Mars/mfileio/MWriteFitsFile.h
===================================================================
--- trunk/Mars/mfileio/MWriteFitsFile.h	(revision 14870)
+++ trunk/Mars/mfileio/MWriteFitsFile.h	(revision 14935)
@@ -12,7 +12,11 @@
 #endif
 
+#ifndef MARS_MTopFitsGroup
 #include "MTopFitsGroup.h"
+#endif
+
+#ifndef MARS_MFitsArray
 #include "MFitsArray.h"
-
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -73,5 +77,5 @@
    // TClonesArray are not in this map.
    //ETIENNE ofits objects cannot be copied. So store pointers instead
-   std::map<TString, std::ofits*>                       fFitsTables;
+   std::map<TString, ofits*>                       fFitsTables;
 
    // all information needed to write data of TClonesArray to their      
@@ -106,5 +110,5 @@
    Bool_t InitColumns(const TString & tableName,
                       const TString & parentVarName,
-                      std::ofits* fitsTable,
+                      ofits* fitsTable,
                       void * baseAdr,
                       TClass * classDef);
@@ -122,5 +126,5 @@
                  const char* unit=NULL,
                  const char* comment=NULL,
-                 std::ofits* outFile=NULL);
+                 ofits* outFile=NULL);
 
    // MWrite
