Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5566)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5567)
@@ -21,4 +21,15 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2004/12/08: Thomas Bretz
+
+  * mraw/MRawRunHeader.cc:
+    - changed maximum allowed format version from 4 to 5
+
+  * mraw/MRawEvtHeader.[h,cc]:
+    - added correct decoding of the 200ns information as proposed by
+      Florian to DecodeTime
+
+
+
  2004/12/06: Abelardo Moralejo
 
@@ -29,4 +40,5 @@
   * mtemp/mpadova/macros/resize.C
     - Added containers MConcentration and MPointingPos to output.
+
 
 
Index: trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 5566)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 5567)
@@ -270,5 +270,5 @@
 // source code.
 //
-Bool_t MRawEvtHeader::DecodeTime(UInt_t abstime[2]) const
+Bool_t MRawEvtHeader::DecodeTime(UInt_t abstime[2], UShort_t ver) const
 {
     //
@@ -292,10 +292,16 @@
     // ----------
     //
+    // The last 8 bits must be flipped.
+    //
+    abstime[1] ^= 0x000000ff;
+
+    //
     // Due to a problem with one Digital Module, three of the less significant
     // eight bits of the subsecond are corrupted. So, until new DM's arrive to
     // La Palma, we won't use the eight first bits of the subsecond. 
-    // This reduces the precision from 200 ns to of 51.2 us.
-    //
-    abstime[1] &= 0xffffff00;
+    // This reduces the precision from 200 ns to of 51.2 us. (ver<5)
+    //
+    if (ver<5)
+        abstime[1] &= 0xffffff00;
 
     //
@@ -346,5 +352,5 @@
 
     if (ver>2)
-        if (!DecodeTime(abstime))
+        if (!DecodeTime(abstime, ver))
             rc = kCONTINUE;
 
Index: trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 5566)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 5567)
@@ -53,5 +53,5 @@
     MArrayB *fPixLoGainOn;     //! Array which tell you which pixels have lo gain on
 
-    Bool_t DecodeTime(UInt_t abstime[2]) const;
+    Bool_t DecodeTime(UInt_t abstime[2], UShort_t ver) const;
 
     Int_t GetNumBytes() const;
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 5566)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 5567)
@@ -29,4 +29,13 @@
 // Root storage container for the RUN HEADER information
 //
+//
+//  RAW DATA FORMAT VERSION
+//  =======================
+//
+//  Format Version 5:
+//  -----------------
+//   - now the sub millisecond information of the time is valid and decoded
+//     which enhances the precision from 51.2us to 200ns
+//
 //  Format Version 4:
 //  -----------------
@@ -42,4 +51,8 @@
 //   - added start time
 //   - added stop  time
+//
+//
+//  MRawRunHeader CLASS VERSION
+//  ===========================
 //
 //  Class Version 2:
@@ -70,5 +83,5 @@
 
 const UShort_t MRawRunHeader::kMagicNumber      = 0xc0c0;
-const Byte_t   MRawRunHeader::kMaxFormatVersion =      4;
+const Byte_t   MRawRunHeader::kMaxFormatVersion =      5;
 
 // --------------------------------------------------------------------------
