Index: /trunk/MagicSoft/Mars/mraw/MRawCrateData.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawCrateData.cc	(revision 8343)
+++ /trunk/MagicSoft/Mars/mraw/MRawCrateData.cc	(revision 8344)
@@ -56,9 +56,45 @@
 void MRawCrateData::ReadEvt(istream& fin, UShort_t ver)
 {
-    fin.read((char*)&fDAQCrateNumber, 2);
-    fin.read((char*)&fFADCEvtNumber,  4);
-    fin.read((char*)&fFADCClockTick,  4);
-    if (ver>1)
-       fin.read((char*)&fABFlags, 1);
+    if (ver<7)
+    {
+        fin.read((char*)&fDAQCrateNumber, 2);
+        fin.read((char*)&fFADCEvtNumber,  4);
+        fin.read((char*)&fFADCClockTick,  4);
+        if (ver>1)
+            fin.read((char*)&fABFlags, 1);
+    }
+    else
+    {
+        //  U8  CrateNumber;    // 0-4
+        //  U8  BoardNumber;    // 0-1
+        //  U8  ChannelNumber;  // 0-3
+        fDAQCrateNumber = 0;
+        fin.read((char*)&fDAQCrateNumber, 1); // U8: CrateNumber 0-4
+
+        Byte_t dummyb;
+        fin.read((char*)&dummyb, 1); // U8 Board   number 0-1
+        fin.read((char*)&dummyb, 1); // U8 Channel number 0-3
+
+        fin.read((char*)&fFADCEvtNumber, 4); // U32 CrateEvtNumber
+
+        // Clock count. The Clock is synchronized with the 10 MHz external clock,
+        //  which is feed to for all FADC channels.
+        // The units are [psec], which is obviously much smaller than the real accuracy.
+        // The ClockTick should be identical for all channels of the same board.
+        //  Still keep it for debugging purposes.
+        // Like in the 300MHz system this number is extremely useful to check the
+        //  integrity of the data.
+        UInt_t dummyi;
+        fin.read((char*)&dummyi, 4); //  U32 FadcClockTickHi;  // high significant bits
+        fin.read((char*)&dummyi, 4); //  U32 FadcClockTickLo;  // low significant bits
+
+        // Trigger Time Interpolation in [psec] (originally it is a double
+        // in Acqiris software). Again this number should be identical for
+        // all channels in the same board. It is not clear at the moment
+        // if this number will be useful in the end, but I propose to keep
+        // it. The data volume is increase by <0.1%
+        UInt_t dummys;
+        fin.read((char*)&dummys, 2); //   U16 TrigTimeInterpol;
+    }
 }
 
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 8343)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 8344)
@@ -202,6 +202,6 @@
     *fLog << "NumLvl2=" << fNumTrigLvl2 << " ";
     *fLog << "Pattern=" << hex << setfill('0');
-    *fLog << setw(2) << fTrigPattern[0];
-    *fLog << setw(2) << fTrigPattern[1] << " " << dec;
+    *fLog << setw(8) << fTrigPattern[0];
+    *fLog << setw(8) << fTrigPattern[1] << " " << dec;
 
     *fLog << "Type=";
@@ -358,14 +358,23 @@
     fin.read((char*)fTrigPattern,   8);  // Total=28
     fin.read((char*)&fTrigType,     2);  // Total=30
-    fin.read((char*)dummy,          2);  // Total=32, was fAllLoGainOn
-    fin.read((char*)fPixLoGainOn->GetArray(), fPixLoGainOn->GetSize());
-
-    fNumLoGainOn = 0;
-    for (unsigned int i=0; i<fPixLoGainOn->GetSize(); i++)
-        for (int j=0; j<8; j++)
-            if ((*fPixLoGainOn)[i] & (1<<j))
-                fNumLoGainOn++;
-
-    fin.read((char*)&dummy, 4);
+    if (ver<=6)
+    {
+        fin.read((char*)dummy,          2);  // Total=32, was fAllLoGainOn
+        fin.read((char*)fPixLoGainOn->GetArray(), fPixLoGainOn->GetSize());
+
+        fNumLoGainOn = 0;
+        for (unsigned int i=0; i<fPixLoGainOn->GetSize(); i++)
+            for (int j=0; j<8; j++)
+                if ((*fPixLoGainOn)[i] & (1<<j))
+                    fNumLoGainOn++;
+
+        fin.read((char*)&dummy, 4);
+    }
+    else
+    {
+        // No LoGains for version 7 data
+        fPixLoGainOn->Reset();
+        fNumLoGainOn = 0;
+    }
 
     return fin.eof() ? kFALSE : rc;
Index: /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 8343)
+++ /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 8344)
@@ -33,4 +33,15 @@
 //  =======================
 //
+//  Format Version 8:
+//  -----------------
+//   + fNumBytesPerSample;
+//   + fFreqSampling;
+//   + fNumSignificantBits;
+//   * changes in MRawCrateHeader
+//
+//  Format Version 7:
+//  -----------------
+//   - unused
+//
 //  Format Version 6:
 //  -----------------
@@ -62,4 +73,10 @@
 //  MRawRunHeader CLASS VERSION
 //  ===========================
+//
+//  Format Version 6:
+//  -----------------
+//   - added fNumBytesPerSample;
+//   - added fFreqSampling;
+//   - added fNumSignificantBits;
 //
 //  Class Version 5:
@@ -107,5 +124,5 @@
 
 const UShort_t MRawRunHeader::kMagicNumber      = 0xc0c0;
-const Byte_t   MRawRunHeader::kMaxFormatVersion =      6;
+const Byte_t   MRawRunHeader::kMaxFormatVersion =      8;
 
 // --------------------------------------------------------------------------
@@ -125,4 +142,5 @@
     fTelescopeNumber=0;
     fCameraVersion=0;
+    fFadcType = 0;
     fRunType=kRTNone;  // use 0xffff for invalidation, 0 means: Data run
     fRunNumber=0;
@@ -363,8 +381,21 @@
     }
 
+    if (fFormatVersion==7)
+    {
+        *fLog << err << "ERROR - File format V7 was for testing only and is not correctly implemented!" << endl;
+        return kFALSE;
+    }
+
     // ----- DAQ software format version -----
     fin.read((char*)&fSoftVersion, 2);     // Total=6
 
+
+    fFadcType = 0;
+    if (fFormatVersion>7)
+        fin.read((char*)&fFadcType, 2);
+
     // ----- Camera geometry and telescope number -----
+    fCameraVersion   = 1;
+    fTelescopeNumber = 1;
     if (fFormatVersion>5)
     {
@@ -372,9 +403,8 @@
         fin.read((char*)&fTelescopeNumber, 2); // (+2)
     }
-    // Maybe we should set fCameraVersion and fTelescopeNumber to 1
-    // in case of fFormatVersion<6
 
     // ----- Run information -----
     fin.read((char*)&fRunType,     2); // Total=8
+
     fin.read((char*)&fRunNumber,   4); // Total=12
     fin.read((char*)&fProjectName, fFormatVersion>5?100:22); // Total=34  (+78)
@@ -411,11 +441,29 @@
 
     // ----- Data Geometry -----
-    fin.read((char*)&fNumCrates,        2);     // Total=60
-    fin.read((char*)&fNumPixInCrate,    2);     // Total=62
-    fin.read((char*)&fNumSamplesLoGain, 2);     // Total=64
-    fin.read((char*)&fNumSamplesHiGain, 2);     // Total=66
+
+    fin.read((char*)&fNumCrates,        2); // MUX: number of channels
+    fin.read((char*)&fNumPixInCrate,    2); // MUX: number of pix in channel
+    fin.read((char*)&fNumSamplesLoGain, 2); // MUX: dummy (must be 0 for MUX data)
+    fin.read((char*)&fNumSamplesHiGain, 2); // MUX: Number of samples per pixel
 
     // ----- Number of events -----
-    fin.read((char*)&fNumEvents,        4);     // Total=70
+    fin.read((char*)&fNumEvents, 4);     // Total=70
+
+    // New in general features: (should they be included in new MAGIC1 formats, too?)
+    fNumBytesPerSample  = 1;      // 2 for MUX DATA
+    fFreqSampling       = 300;
+    fNumSignificantBits = 8;
+    if (fFormatVersion>7)
+    {
+        fin.read((char*)&fNumBytesPerSample,  2);
+        fin.read((char*)&fFreqSampling,       2); // [MHz], 2000 for MuxFadc
+        fin.read((char*)&fNumSignificantBits, 1); // nominal resolution [# Bits], 10 for MuxFadc
+
+        if (fNumBytesPerSample!=2)
+        {
+            *fLog << err << "ERROR - " << fNumBytesPerSample << " bytes per sample are not supported!" << endl;
+            return kFALSE;
+        }
+    }
 
     // ----- Start/Stop time -----
@@ -429,10 +477,12 @@
     // calculate size of array, create it and fill it
     //
-    Int_t nPixel = fNumCrates*fNumPixInCrate;
+    const Int_t nPixel = fNumCrates*fNumPixInCrate;
     fPixAssignment->Set(nPixel);
 
     // ----- Pixel Assignement -----
     fin.read((char*)fPixAssignment->GetArray(), nPixel*2);
-    fin.read((char*)&dummy, 16);
+
+    if (fFormatVersion<7)
+        fin.read((char*)&dummy, 16);
 
     return FixAssignment();
@@ -488,4 +538,6 @@
     if (fFormatVersion>5)
         *fLog << "Telescope:    " << fTelescopeNumber << endl;
+    if (fFormatVersion>7)
+        *fLog << "FadcType:     " << fFadcType << endl;
     *fLog << "RunNumber:    " << fRunNumber << " (Type=" << GetRunTypeStr() << ")" << endl;
     *fLog << "ProjectName: '" << fProjectName << "'" << endl;
@@ -498,5 +550,7 @@
     *fLog << "Crates:       " << fNumCrates << " x " << fNumPixInCrate << " Pixel/Crate = " << fNumCrates*fNumPixInCrate << " Pixel/Evt" << endl;
     *fLog << "Num Pixels:   " << GetNumNormalPixels() << " (normal) + " << GetNumSpecialPixels() << " (special) = " << GetNumConnectedPixels() << " (total)" << endl;
-    *fLog << "Samples:      " << fNumSamplesHiGain << "/" << fNumSamplesLoGain << " (hi/lo) = " << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate /1024 << "kiB/Evt" << endl;
+    if (fFormatVersion>6)
+        *fLog << "Sampling:     " << fFreqSampling << "MHz with " << (int)fNumSignificantBits << " significant bits" << endl;
+    *fLog << "Samples:      " << fNumSamplesHiGain << "/" << fNumSamplesLoGain << " (hi/lo) * " << fNumBytesPerSample << "B/sample = " << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate * fNumBytesPerSample/1000 << "kB/Evt" << endl;
     *fLog << "Evt Counter:  " << fNumEvents << endl;
 
@@ -640,4 +694,6 @@
     case 6:
         return 84+fNumCrates*fNumPixInCrate*2+16 +4+78+58+60+8;
+    case 7:
+        return 84+fNumCrates*fNumPixInCrate*2+16 +4+78+58+60+8 +3-16;
     }
     return 0;
Index: /trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 8343)
+++ /trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 8344)
@@ -41,4 +41,5 @@
     UShort_t  fFormatVersion;
     UShort_t  fSoftVersion;
+    UShort_t  fFadcType;
     UShort_t  fCameraVersion;
     UShort_t  fTelescopeNumber;
@@ -54,5 +55,8 @@
     UShort_t  fNumSamplesLoGain;
     UShort_t  fNumSamplesHiGain;
+    UShort_t  fNumBytesPerSample;
     UInt_t    fNumEvents;
+    UShort_t  fFreqSampling;
+    Byte_t    fNumSignificantBits;
     MTime     fRunStart;
     MTime     fRunStop;
@@ -125,5 +129,5 @@
     Bool_t ReadEvt(istream& fin);
 
-    ClassDef(MRawRunHeader, 5)	// storage container for general info
+    ClassDef(MRawRunHeader, 6)	// storage container for general info
 };
 #endif
