]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/MUON/utils/dHLTdumpraw.cxx
Disable retireval of DCS data points from AliShuttle for SDD
[u/mrichter/AliRoot.git] / HLT / MUON / utils / dHLTdumpraw.cxx
index 89fcb687a5c6601edd8060737b56994a15db9afd..0936ff7e8dfff376b48726e95798ce283528cd71 100644 (file)
@@ -13,7 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
+// $Id$
 
 /**
  * @file   dHLTdumpraw.cxx
@@ -914,7 +914,7 @@ namespace
                cout << "   ";
                PrintBitPattern(GetLocalY3(localStruct), 16);
                cout << endl;
-               cout << "   12     ";
+               cout << "   14     ";
                PrintBitPattern(GetLocalX4(localStruct), 16);
                cout << "   ";
                PrintBitPattern(GetLocalY4(localStruct), 16);
@@ -1049,6 +1049,8 @@ int DumpRawDataHeader(
                bool continueParse
        )
 {
+       // Dumps the common DDL raw data block header.
+       
        cout << "*************************** Common DDL data header *******************************" << endl;
        char fillChar = cout.fill();  // remember fill char to set back to original later.
        int result = CheckHeaderField(header->fSize, buffer, bufferSize, continueParse);
@@ -1105,7 +1107,7 @@ int DumpRawDataHeader(
        cout << "          Status & error bits : 0x" << noshowbase << hex
                << setfill('0') << setw(4) << statusBits << setw(0) << setfill(fillChar)
                << dec << endl;
-       cout << "          [                        Reserved : " << ((statusBits >> 15) & 0x1) << " ]" << endl;
+       cout << "          [               Original data bit : " << ((statusBits >> 15) & 0x1) << " ]" << endl;
        cout << "          [        Multi-event buffer error : " << ((statusBits >> 14) & 0x1) << " ]" << endl;
        cout << "          [        Trigger L1 missing error : " << ((statusBits >> 13) & 0x1) << " ]" << endl;
        cout << "          [           Trigger error (other) : " << ((statusBits >> 12) & 0x1) << " ]" << endl;
@@ -1166,12 +1168,13 @@ int DumpRawDataHeader(
 
 
 int DumpTrackerDDLRawStream(
-               const char* buffer, unsigned long bufferSize,
-               bool continueParse
+               char* buffer, unsigned long bufferSize,
+               bool continueParse, bool tryrecover
        )
 {
-       const AliRawDataHeader* header =
-               reinterpret_cast<const AliRawDataHeader*>(buffer);
+       // Dumps a tracker DDL raw stream data.
+       
+       AliRawDataHeader* header = reinterpret_cast<AliRawDataHeader*>(buffer);
        int result = DumpRawDataHeader(buffer, bufferSize, header, continueParse);
        if (result != EXIT_SUCCESS) return result;
 
@@ -1179,10 +1182,10 @@ int DumpTrackerDDLRawStream(
        AliMUONTrackerDDLDecoder<AliTrackerDecoderHandler> decoder;
        decoder.ExitOnError(not continueParse);
        decoder.SendDataOnParityError(true);
-       decoder.TryRecover(false);
+       decoder.TryRecover(tryrecover);
        decoder.AutoDetectTrailer(true);
        decoder.CheckForTrailer(true);
-       const char* payload = buffer + sizeof(AliRawDataHeader);
+       char* payload = buffer + sizeof(AliRawDataHeader);
        UInt_t payloadSize = bufferSize - sizeof(AliRawDataHeader);
        if (decoder.Decode(payload, payloadSize))
        {
@@ -1197,9 +1200,11 @@ int DumpTrackerDDLRawStream(
 
 int DumpTriggerDDLRawStream(
                const char* buffer, unsigned long bufferSize,
-               bool continueParse
+               bool continueParse, bool tryrecover
        )
 {
+       // Dumps a trigger DDL raw stream data.
+       
        const AliRawDataHeader* header =
                reinterpret_cast<const AliRawDataHeader*>(buffer);
        int result = DumpRawDataHeader(buffer, bufferSize, header, continueParse);
@@ -1208,7 +1213,7 @@ int DumpTriggerDDLRawStream(
        
        AliMUONTriggerDDLDecoder<AliTriggerDecoderHandler> decoder;
        decoder.ExitOnError(not continueParse);
-       decoder.TryRecover(false);
+       decoder.TryRecover(tryrecover);
        decoder.AutoDetectScalars(false);
        const char* payload = buffer + sizeof(AliRawDataHeader);
        UInt_t payloadSize = bufferSize - sizeof(AliRawDataHeader);
@@ -1271,6 +1276,8 @@ int DumpRecHitsBlock(
                bool continueParse
        )
 {
+       // Dumps a reconstructed hits data block.
+       
        int result = EXIT_SUCCESS;
        AliHLTMUONRecHitsBlockReader block(buffer, bufferSize);
        
@@ -1309,7 +1316,9 @@ int DumpTriggerRecordStruct(
        
        result = CheckField(record->fFlags, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
        cout << "Flags: " << showbase << hex << record->fFlags << dec;
+       cout.flags(oldflags);
                
        // Print the individual trigger bits.
        AliHLTMUONParticleSign sign;
@@ -1359,6 +1368,8 @@ int DumpTriggerRecordsBlock(
                bool continueParse
        )
 {
+       // Dumps a trigger records data block.
+       
        AliHLTMUONTriggerRecordsBlockReader block(buffer, bufferSize);
        
        int result = CheckCommonHeader(block, buffer, bufferSize, continueParse);
@@ -1380,6 +1391,76 @@ int DumpTriggerRecordsBlock(
 }
 
 
+int DumpLocalStruct(
+               const char* buffer, unsigned long bufferSize,
+               const AliMUONLocalInfoStruct* localStruct,
+               bool continueParse,
+               const char* title = ""
+       )
+{
+       // Prints the fields of a L0 local structure as found in the buffer.
+       
+       typedef AliMUONTriggerDDLDecoderEventHandler AliH;
+       
+       cout << "L0 strip patterns" << title << ":" << endl;
+       cout << "Chamber |        X         |         Y        " << endl;
+       cout << "----------------------------------------------" << endl;
+       int result = CheckField(localStruct->fX2X1, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "   11     ";
+       PrintBitPattern(AliH::GetLocalX1(localStruct), 16);
+       result = CheckField(localStruct->fY2Y1, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "   ";
+       PrintBitPattern(AliH::GetLocalY1(localStruct), 16);
+       cout << endl;
+       cout << "   12     ";
+       PrintBitPattern(AliH::GetLocalX2(localStruct), 16);
+       cout << "   ";
+       PrintBitPattern(AliH::GetLocalY2(localStruct), 16);
+       cout << endl;
+       
+       result = CheckField(localStruct->fX4X3, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "   13     ";
+       PrintBitPattern(AliH::GetLocalX3(localStruct), 16);
+       result = CheckField(localStruct->fY4Y3, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "   ";
+       PrintBitPattern(AliH::GetLocalY3(localStruct), 16);
+       cout << endl;
+       cout << "   12     ";
+       PrintBitPattern(AliH::GetLocalX4(localStruct), 16);
+       cout << "   ";
+       PrintBitPattern(AliH::GetLocalY4(localStruct), 16);
+       cout << endl;
+       
+       cout << "L0 trigger bits" << title << ": (word = ";
+       result = CheckField(localStruct->fTriggerBits, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << showbase << hex << localStruct->fTriggerBits
+               << noshowbase << dec << ")" << endl;
+       cout << "  ID |  Dec | TrigY | YPos | Sign XDev | XDev |  XPos " << endl;
+       cout << "------------------------------------------------------" << endl;
+       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalId(localStruct)), 4);
+       cout << "   ";
+       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalDec(localStruct)), 4);
+       cout << "     ";
+       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalTrigY(localStruct)), 1);
+       cout << "     ";
+       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalYPos(localStruct)), 4);
+       cout << "       ";
+       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalSXDev(localStruct)), 1);
+       cout << "       ";
+       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalXDev(localStruct)), 4);
+       cout << "   ";
+       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalXPos(localStruct)), 5);
+       cout << endl;
+       
+       return result;
+}
+
+
 int DumpTrigRecInfoStruct(
                const char* buffer, unsigned long bufferSize,
                const AliHLTMUONTrigRecInfoStruct* debuginfo,
@@ -1402,7 +1483,9 @@ int DumpTrigRecInfoStruct(
        {
                result = CheckField(debuginfo->fDetElemId[i], buffer, bufferSize, continueParse);
                if (result != EXIT_SUCCESS) return result;
+               ios::fmtflags oldflags = cout.flags();
                cout << setw(12) << right << debuginfo->fDetElemId[i] << setw(0);
+               cout.flags(oldflags);
                if (i != 3) cout << " | ";
        }
        cout << endl;
@@ -1418,62 +1501,12 @@ int DumpTrigRecInfoStruct(
        if (result != EXIT_SUCCESS) return result;
        cout << setw(31) << right << debuginfo->fBl << setw(0) << endl;
        
-       typedef AliMUONTriggerDDLDecoderEventHandler AliH;
-       
-       cout << "L0 strip patterns:" << endl;
-       cout << "Chamber |        X         |         Y        " << endl;
-       cout << "----------------------------------------------" << endl;
-       result = CheckField(debuginfo->fL0Struct.fX2X1, buffer, bufferSize, continueParse);
+       result = DumpLocalStruct(buffer, bufferSize, &debuginfo->fL0Struct, continueParse, " for central local structure");
        if (result != EXIT_SUCCESS) return result;
-       cout << "   11     ";
-       PrintBitPattern(AliH::GetLocalX1(&debuginfo->fL0Struct), 16);
-       result = CheckField(debuginfo->fL0Struct.fY2Y1, buffer, bufferSize, continueParse);
+       result = DumpLocalStruct(buffer, bufferSize, &debuginfo->fL0StructPrev, continueParse, " for previous local structure");
        if (result != EXIT_SUCCESS) return result;
-       cout << "   ";
-       PrintBitPattern(AliH::GetLocalY1(&debuginfo->fL0Struct), 16);
-       cout << endl;
-       cout << "   12     ";
-       PrintBitPattern(AliH::GetLocalX2(&debuginfo->fL0Struct), 16);
-       cout << "   ";
-       PrintBitPattern(AliH::GetLocalY2(&debuginfo->fL0Struct), 16);
-       cout << endl;
-       
-       result = CheckField(debuginfo->fL0Struct.fX4X3, buffer, bufferSize, continueParse);
+       result = DumpLocalStruct(buffer, bufferSize, &debuginfo->fL0StructNext, continueParse, " for next local structure");
        if (result != EXIT_SUCCESS) return result;
-       cout << "   13     ";
-       PrintBitPattern(AliH::GetLocalX3(&debuginfo->fL0Struct), 16);
-       result = CheckField(debuginfo->fL0Struct.fY4Y3, buffer, bufferSize, continueParse);
-       if (result != EXIT_SUCCESS) return result;
-       cout << "   ";
-       PrintBitPattern(AliH::GetLocalY3(&debuginfo->fL0Struct), 16);
-       cout << endl;
-       cout << "   12     ";
-       PrintBitPattern(AliH::GetLocalX4(&debuginfo->fL0Struct), 16);
-       cout << "   ";
-       PrintBitPattern(AliH::GetLocalY4(&debuginfo->fL0Struct), 16);
-       cout << endl;
-       
-       cout << "L0 trigger bits: (word = ";
-       result = CheckField(debuginfo->fL0Struct.fTriggerBits, buffer, bufferSize, continueParse);
-       if (result != EXIT_SUCCESS) return result;
-       cout << showbase << hex << debuginfo->fL0Struct.fTriggerBits
-               << noshowbase << dec << ")" << endl;
-       cout << "  ID |  Dec | TrigY | YPos | Sign XDev | XDev |  XPos " << endl;
-       cout << "------------------------------------------------------" << endl;
-       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalId(&debuginfo->fL0Struct)), 4);
-       cout << "   ";
-       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalDec(&debuginfo->fL0Struct)), 4);
-       cout << "     ";
-       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalTrigY(&debuginfo->fL0Struct)), 1);
-       cout << "     ";
-       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalYPos(&debuginfo->fL0Struct)), 4);
-       cout << "       ";
-       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalSXDev(&debuginfo->fL0Struct)), 1);
-       cout << "       ";
-       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalXDev(&debuginfo->fL0Struct)), 4);
-       cout << "   ";
-       PrintBitPattern(AliHLTUInt32_t(AliH::GetLocalXPos(&debuginfo->fL0Struct)), 5);
-       cout << endl;
        
        return result;
 }
@@ -1484,6 +1517,8 @@ int DumpTrigRecsDebugBlock(
                bool continueParse
        )
 {
+       // Dumps the debugging information for trigger records.
+       
        AliHLTMUONTrigRecsDebugBlockReader block(buffer, bufferSize);
        
        int result = CheckCommonHeader(block, buffer, bufferSize, continueParse);
@@ -1495,8 +1530,8 @@ int DumpTrigRecsDebugBlock(
        const AliHLTMUONTrigRecInfoStruct* entry = block.GetArray();
        for(AliHLTUInt32_t i = 0; i < nentries; i++)
        {
-               cout << "============================== Trigger Record debug data " << i+1
-                       << " of " << nentries << " ==============================" << endl;
+               cout << "======================= Trigger Record debug data " << i+1
+                       << " of " << nentries << " =======================" << endl;
                int subResult = DumpTrigRecInfoStruct(buffer, bufferSize, entry++, continueParse);
                if (subResult != EXIT_SUCCESS) return subResult;
        }
@@ -1517,15 +1552,27 @@ int DumpClusterStruct(
        // bytes assumed to be corrupted rubbish.
        int result = CheckField(cluster->fId, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
-       cout << "         Cluster ID: " << cluster->fId << endl;
+       cout << "                             Cluster ID: " << cluster->fId << endl;
 
        result = CheckField(cluster->fDetElemId, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
-       cout << "Detector Element ID: " << cluster->fDetElemId << endl;
+       cout << "                    Detector Element ID: " << cluster->fDetElemId << endl;
 
-       result = CheckField(cluster->fNchannels, buffer, bufferSize, continueParse);
-       if(result != EXIT_SUCCESS) return result;
-       cout << " Number of channels: " << cluster->fNchannels << endl;
+       result = CheckField(cluster->fNchannelsB, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "    Number of channels in bending plane: " << cluster->fNchannelsB << endl;
+
+       result = CheckField(cluster->fNchannelsNB, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "Number of channels in non-bending plane: " << cluster->fNchannelsNB << endl;
+       
+       result = CheckField(cluster->fChargeB, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "                Charge on bending plane: " << cluster->fChargeB << endl;
+
+       result = CheckField(cluster->fChargeNB, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "            Charge on non bending plane: " << cluster->fChargeNB << endl;
 
        cout << "Corresponding Hit: "<< endl;
        cout << "Chamber | DetElemID | X (cm)     | Y (cm)     | Z (cm)" << endl;
@@ -1541,6 +1588,8 @@ int DumpClustersBlock(
                bool continueParse
        )
 {
+       // Dumps a clusters block structure.
+       
         int result = EXIT_SUCCESS;
        AliHLTMUONClustersBlockReader block(buffer, bufferSize);
        
@@ -1553,8 +1602,8 @@ int DumpClustersBlock(
        const AliHLTMUONClusterStruct* entry = block.GetArray();
        for(AliHLTUInt32_t i = 0; i < nentries; i++)
        {
-               cout << " ===================================================== Cluster Number "
-                       << i+1 << "==================================================" << endl; 
+               cout << "======================= Cluster Number "
+                       << i+1 << " =======================" << endl;
                int subResult = DumpClusterStruct(buffer, bufferSize, entry++, continueParse);
                if (subResult != EXIT_SUCCESS) return subResult;
        }       
@@ -1575,27 +1624,39 @@ int DumpChannelStruct(
        // bytes assumed to be corrupted rubbish.
        int result = CheckField(channel->fClusterId, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
        cout << setw(16) << left << channel->fClusterId << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(channel->fBusPatch, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(16) << left << channel->fBusPatch << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(channel->fManu, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(16) << left << channel->fManu << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(channel->fChannelAddress, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(16) << left << channel->fChannelAddress << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(channel->fSignal, buffer, bufferSize, continueParse);
        if(result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(16) << left << channel->fSignal << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(channel->fRawDataWord, buffer, bufferSize, continueParse);
        if(result != EXIT_SUCCESS) return result;
-       cout << showbase << hex << channel->fRawDataWord << dec << setw(0) <<endl;
+       oldflags = cout.flags();
+       cout << showbase << hex << channel->fRawDataWord << dec << setw(0) << endl;
+       cout.flags(oldflags);
 
        return result;
 }
@@ -1606,6 +1667,8 @@ int DumpChannelsBlock(
                bool continueParse
        )
 {
+       // Dumps a channels block structure.
+       
         int result = EXIT_SUCCESS;
        AliHLTMUONChannelsBlockReader block(buffer, bufferSize);
        
@@ -1647,7 +1710,9 @@ int DumpMansoTrackStruct(
        
        result = CheckField(track->fFlags, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
        cout << "Flags: " << showbase << hex << track->fFlags << dec;
+       cout.flags(oldflags);
        
        // Print the individual trigger bits.
        AliHLTMUONParticleSign sign;
@@ -1700,6 +1765,8 @@ int DumpMansoTracksBlock(
                bool continueParse
        )
 {
+       // Dumps the Manso tracks block structure.
+       
        int result = EXIT_SUCCESS;
        AliHLTMUONMansoTracksBlockReader block(buffer, bufferSize);
        
@@ -1734,19 +1801,27 @@ int DumpMansoRoIStruct(
        // bytes assumed to be corrupted rubbish.
        int result = CheckField(roi->fX, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
        cout << setw(13) << left << roi->fX << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(roi->fY, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(13) << left << roi->fY << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(roi->fZ, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(13) << left << roi->fZ << setw(0);
+       cout.flags(oldflags);
 
        result = CheckField(roi->fRadius, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << roi->fRadius << setw(0) << endl;
+       cout.flags(oldflags);
 
        return result;
 }
@@ -1758,6 +1833,8 @@ int DumpMansoCandidateStruct(
                bool continueParse
        )
 {
+       // Dumps the manso candidate structure.
+       
        int result = DumpMansoTrackStruct(buffer, bufferSize, &candidate->fTrack, continueParse);
        if (result != EXIT_SUCCESS) return result;
        
@@ -1777,11 +1854,15 @@ int DumpMansoCandidateStruct(
        cout << "      Value : ";
        result = CheckField(candidate->fZmiddle, buffer, bufferSize, continueParse);
        if(result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
        cout << setw(24) << right << candidate->fZmiddle << setw(0) << " | ";
+       cout.flags(oldflags);
        
        result = CheckField(candidate->fBl, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(31) << right << candidate->fBl << setw(0) << endl;
+       cout.flags(oldflags);
        
        return result;
 }
@@ -1792,6 +1873,8 @@ int DumpMansoCandidatesBlock(
                bool continueParse
        )
 {
+       // Dumps the manso candidates block structure.
+       
        int result = EXIT_SUCCESS;
        AliHLTMUONMansoCandidatesBlockReader block(buffer, bufferSize);
        
@@ -1814,6 +1897,129 @@ int DumpMansoCandidatesBlock(
 }
 
 
+int DumpTrackStruct(
+               const char* buffer, unsigned long bufferSize,
+               const AliHLTMUONTrackStruct* track,
+               bool continueParse
+       )
+{
+       // Step through the fields trying to print them.
+       // At each step check if we have not overflowed the buffer. If we have
+       // not, then we can print the field, otherwise we print the left over
+       // bytes assumed to be corrupted rubbish.
+       int result = CheckField(track->fId, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "Track ID: " << track->fId << "\t";
+
+       result = CheckField(track->fTrigRec, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "Trigger Record ID: " << track->fTrigRec << endl;
+       
+       result = CheckField(track->fFlags, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
+       cout << "Flags: " << showbase << hex << track->fFlags << dec;
+       cout.flags(oldflags);
+       
+       // Print the individual trigger bits.
+       AliHLTMUONParticleSign sign;
+       bool hitset[16];
+       AliHLTMUONUtils::UnpackTrackFlags(track->fFlags, sign, hitset);
+       cout << " [Sign: " << sign << ", Hits set: ";
+       bool first = true;
+       for (AliHLTUInt32_t i = 0; i < 16; i++)
+       {
+               if (hitset[i])
+               {
+                       cout << (first ? "" : ", ") << i;
+                       first = false;
+               }
+       }
+       cout << (first ? "none]" : "]") << endl;
+
+       result = CheckField(track->fPx, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "Momentum: (px = " << track->fPx << ", ";
+
+       result = CheckField(track->fPy, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "py = " << track->fPy << ", ";
+
+       result = CheckField(track->fPz, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "pz = " << track->fPz << ") GeV/c" << endl;
+       
+       result = CheckField(track->fInverseBendingMomentum, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "Inverse bending momentum: " << track->fInverseBendingMomentum << " c/GeV" << endl;
+       
+       result = CheckField(track->fThetaX, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "Slope: (non-bending plane = " << track->fThetaX << ", ";
+       
+       result = CheckField(track->fThetaY, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "bending plane = " << track->fThetaY << ")" << endl;
+
+       result = CheckField(track->fX, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "DCA vertex: (x = " << track->fX << ", ";
+
+       result = CheckField(track->fY, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "y = " << track->fY << ", ";
+
+       result = CheckField(track->fZ, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "z = " << track->fZ << ") cm" << endl;
+
+       result = CheckField(track->fChi2, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS) return result;
+       cout << "Chi squared fit: " << track->fChi2 << endl;
+       
+       cout << "Track hits:" << endl;
+       cout << "Chamber | DetElemID | X (cm)     | Y (cm)     | Z (cm)" << endl;
+       cout << "-----------------------------------------------------------" << endl;
+       const AliHLTMUONRecHitStruct* hit = &track->fHit[0];
+       for(AliHLTUInt32_t ch = 0; ch < 16; ch++)
+       {
+               result = DumpRecHitStruct(buffer, bufferSize, hit++, continueParse);
+               if (result != EXIT_SUCCESS) return result;
+       }
+
+       return result;
+}
+
+
+int DumpTracksBlock(
+               const char* buffer, unsigned long bufferSize,
+               bool continueParse
+       )
+{
+       // Dumps the full tracks block structure.
+       
+       int result = EXIT_SUCCESS;
+       AliHLTMUONTracksBlockReader block(buffer, bufferSize);
+       
+       result = CheckCommonHeader(block, buffer, bufferSize, continueParse);
+       if (result != EXIT_SUCCESS and not continueParse) return result;
+       
+       AliHLTUInt32_t nentries = CalculateNEntries(block, bufferSize);
+       
+       // Print the data block record entries.
+       const AliHLTMUONTrackStruct* entry = block.GetArray();
+       for(AliHLTUInt32_t i = 0; i < nentries; i++)
+       {
+               cout << "================================ track number " << i+1
+                       << " of " << nentries << " ================================" << endl;
+               int subResult = DumpTrackStruct(buffer, bufferSize, entry++, continueParse);
+               if (subResult != EXIT_SUCCESS) return subResult;
+       }
+       
+       return result;
+}
+
+
 int DumpSinglesDecisionBlockHeader(
                const char* buffer, unsigned long bufferSize,
                const AliHLTMUONSinglesDecisionBlockStruct* header,
@@ -1848,10 +2054,13 @@ int DumpTrackDecisionStruct(
        // bytes assumed to be corrupted rubbish.
        int result = CheckField(decision->fTrackId, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
        cout << setw(13) << left << decision->fTrackId << setw(0);
+       cout.flags(oldflags);
        
        result = CheckField(decision->fTriggerBits, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(12) << left << showbase << hex << decision->fTriggerBits
                << setw(0) << dec;
                
@@ -1860,6 +2069,7 @@ int DumpTrackDecisionStruct(
        AliHLTMUONUtils::UnpackTrackDecisionBits(decision->fTriggerBits, highPt, lowPt);
        cout << setw(7) << left << (highPt ? "yes" : "no");
        cout << setw(8) << left << (lowPt ? "yes" : "no");
+       cout.flags(oldflags);
        
        result = CheckField(decision->fPt, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
@@ -1964,16 +2174,22 @@ int DumpPairDecisionStruct(
        // bytes assumed to be corrupted rubbish.
        int result = CheckField(decision->fTrackAId, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       ios::fmtflags oldflags = cout.flags();
        cout << setw(13) << left << decision->fTrackAId << setw(0);
+       cout.flags(oldflags);
        
        result = CheckField(decision->fTrackBId, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(13) << left << decision->fTrackBId << setw(0);
+       cout.flags(oldflags);
        
        result = CheckField(decision->fTriggerBits, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
+       oldflags = cout.flags();
        cout << setw(12) << left << showbase << hex << decision->fTriggerBits
                << setw(0) << dec;
+       cout.flags(oldflags);
                
        // Print the individual trigger bits.
        bool highMass, lowMass, unlike;
@@ -1982,12 +2198,14 @@ int DumpPairDecisionStruct(
                        decision->fTriggerBits,
                        highMass, lowMass, unlike, highPtCount, lowPtCount
                );
+       oldflags = cout.flags();
        cout << setw(7) << left << (highMass ? "yes" : "no");
        cout << setw(7) << left << (lowMass ? "yes" : "no");
        cout << setw(7) << left << (unlike ? "yes" : "no");
        cout << setw(6) << left << AliHLTUInt16_t(highPtCount);
        cout << setw(8) << left << AliHLTUInt16_t(lowPtCount);
        cout << setw(0);
+       cout.flags(oldflags);
        
        result = CheckField(decision->fInvMass, buffer, bufferSize, continueParse);
        if (result != EXIT_SUCCESS) return result;
@@ -2169,11 +2387,13 @@ int CheckIfDDLStream(const char* buffer, unsigned long bufferSize)
 
 /**
  * Parses the buffer and prints the contents to screen.
- * [in] \param buffer  The pointer to the buffer to parse.
- * [in] \param bufferSize  The size of the buffer in bytes.
- * [in] \param continueParse  If specified then the we try to continue parsing the
+ * \param [in] buffer  The pointer to the buffer to parse.
+ * \param [in] bufferSize  The size of the buffer in bytes.
+ * \param [in] continueParse  If specified then the we try to continue parsing the
  *           buffer as much as possible.
- * [in/out] \param type  Initialy this should indicate the type of the data block
+ * \param [in] tryrecover Indicates if the DDL decoders should have special
+ *           recovery logic enabled.
+ * \param [in,out] type  Initialy this should indicate the type of the data block
  *           or kUnknownDataBlock if not known. On exit it will be filled with
  *           the type of the data block as discovered by this routine if type
  *           initially contained kUnknownDataBlock.
@@ -2181,8 +2401,8 @@ int CheckIfDDLStream(const char* buffer, unsigned long bufferSize)
  *           on success.
  */
 int ParseBuffer(
-               const char* buffer, unsigned long bufferSize,
-               bool continueParse, int& type
+               char* buffer, unsigned long bufferSize,
+               bool continueParse, bool tryrecover, int& type
        )
 {
        assert( buffer != NULL );
@@ -2258,11 +2478,11 @@ int ParseBuffer(
        switch (type)
        {
        case kTrackerDDLRawData:
-               subResult = DumpTrackerDDLRawStream(buffer, bufferSize, continueParse);
+               subResult = DumpTrackerDDLRawStream(buffer, bufferSize, continueParse, tryrecover);
                if (subResult != EXIT_SUCCESS) result = subResult;
                break;
        case kTriggerDDLRawData:
-               subResult = DumpTriggerDDLRawStream(buffer, bufferSize, continueParse);
+               subResult = DumpTriggerDDLRawStream(buffer, bufferSize, continueParse, tryrecover);
                if (subResult != EXIT_SUCCESS) result = subResult;
                break;
        case kTriggerRecordsDataBlock:
@@ -2282,7 +2502,7 @@ int ParseBuffer(
                if (subResult != EXIT_SUCCESS) result = subResult;
                break;
        case kChannelsDataBlock:
-               return DumpChannelsBlock(buffer, bufferSize, continueParse);
+               subResult = DumpChannelsBlock(buffer, bufferSize, continueParse);
                if (subResult != EXIT_SUCCESS) result = subResult;
                break;
        case kMansoTracksDataBlock:
@@ -2293,17 +2513,21 @@ int ParseBuffer(
                subResult = DumpMansoCandidatesBlock(buffer, bufferSize, continueParse);
                if (subResult != EXIT_SUCCESS) result = subResult;
                break;
+       case kTracksDataBlock:
+               subResult = DumpTracksBlock(buffer, bufferSize, continueParse);
+               if (subResult != EXIT_SUCCESS) result = subResult;
+               break;
        case kSinglesDecisionDataBlock:
                subResult = DumpSinglesDecisionBlock(buffer, bufferSize, continueParse);
                if (subResult != EXIT_SUCCESS) result = subResult;
                break;
        case kPairsDecisionDataBlock:
-               return DumpPairsDecisionBlock(buffer, bufferSize, continueParse);
+               subResult = DumpPairsDecisionBlock(buffer, bufferSize, continueParse);
                if (subResult != EXIT_SUCCESS) result = subResult;
                break;
        default :
                cout << "ERROR: Unknown data block type. Found a type number of "
-                       << showbase << hex << int(type) << dec
+                       << showbase << hex << int(type) << noshowbase << dec
                        << " (" << int(type) << ")." << endl;
                result = PARSE_ERROR;
        }
@@ -2376,14 +2600,21 @@ const char* TryDecodeDataSpec(const char* filename)
        return NULL;
 }
 
+namespace
+{
+       // CDB path and run number to use.
+       const char* gCDBPath = "local://$ALICE_ROOT/OCDB";
+       Int_t gRunNumber = 0;
+}
+
 /**
  * Performs basic data integrity checks of the data block using the
  * AliHLTMUONDataCheckerComponent.
- * [in] \param sys  The HLT system framework.
- * [in] \param filename  The name of the file containing the data block to check.
- * [in] \param type  Must indicate the type of the data block.
- * [in] \param dataspec The data specification of the data block. NULL if none.
- * [in] \param maxLogging  If set to true then full logging is turned on for AliHLTSystem.
+ * \param [in] sys  The HLT system framework.
+ * \param [in] filename  The name of the file containing the data block to check.
+ * \param [in] type  Must indicate the type of the data block.
+ * \param [in] dataspec The data specification of the data block. NULL if none.
+ * \param [in] maxLogging  If set to true then full logging is turned on for AliHLTSystem.
  * \returns  The error code indicating the problem. EXIT_SUCCESS is returned
  *           on success.
  */
@@ -2404,18 +2635,14 @@ int CheckDataIntegrity(
                sys.SetGlobalLoggingLevel(AliHLTComponentLogSeverity(level));
        }
        
-       // Check if required libraries are there and load them if not.
-       if (gClassTable->GetID("AliHLTAgentUtil") < 0)
-       {
-               sys.LoadComponentLibraries("libAliHLTUtil.so");
-       }
-       if (gClassTable->GetID("AliHLTMUONAgent") < 0)
-       {
-               sys.LoadComponentLibraries("libAliHLTMUON.so");
-       }
+       sys.LoadComponentLibraries("libAliHLTUtil.so");
+       sys.LoadComponentLibraries("libAliHLTMUON.so");
        
        // Setup the component parameter lists and then the components.
-       TString dcparams = "-return_error -warn_on_unexpected_block -no_global_check";
+       TString dcparams = "-return_error -warn_on_unexpected_block -no_global_check -cdbpath ";
+       dcparams += gCDBPath;
+       dcparams += " -run ";
+       dcparams += gRunNumber;
        TString fpparams = "-datatype '";
        fpparams += TypeToString(type);
        fpparams += "' 'MUON'";
@@ -2549,7 +2776,8 @@ void PrintUsage(bool asError = true)
 {
        std::ostream& os = asError ? cerr : cout;
        os << "Usage: dHLTdumpraw [-help|-h] [-continue|-c] [-type|-t <typename>] [-check|-k]" << endl;
-       os << "         [-debug|-d] [-dataspec|-s <number>] <filename> [<filename> ...]" << endl;
+       os << "         [-debug|-d] [-dataspec|-s <number>] [-cdbpath|-p <url>] [-run|-r <number>]" << endl;
+       os << "         <filename> [<filename> ...]" << endl;
        os << "Where <filename> is the name of a file containing a raw data block." << endl;
        os << "Options:" << endl;
        os << " -help | -h" << endl;
@@ -2557,6 +2785,9 @@ void PrintUsage(bool asError = true)
        os << " -continue | -c" << endl;
        os << "       If specified, the program will try to continue parsing the data block" << endl;
        os << "       as much as possible rather than stopping at the first error." << endl;
+       os << " -recover | -e" << endl;
+       os << "       If specified, special DDL decoder recovery logic is enabled to handle" << endl;
+       os << "       corrupt DDL data." << endl;
        os << " -type | -t <typename>" << endl;
        os << "       Forces the contents of the subsequent files specified on the command" << endl;
        os << "       line to be interpreted as a specific type of data block." << endl;
@@ -2570,6 +2801,7 @@ void PrintUsage(bool asError = true)
        os << "         clusters - cluster debugging information from hit reconstruction." << endl;
        os << "         mansotracks - partial tracks from Manso algorithm." << endl;
        os << "         mansocandidates - track candidates considered in the Manso algorithm." << endl;
+       os << "         tracks - tracks from full tracker component." << endl;
        os << "         singlesdecision - trigger decisions for single tracks." << endl;
        os << "         pairsdecision - trigger decisions for track pairs." << endl;
        os << "         autodetect - the type of the data block will be automatically" << endl;
@@ -2584,6 +2816,10 @@ void PrintUsage(bool asError = true)
        os << " -dataspec | -s <number>" << endl;
        os << "       When specified, then <number> is used as the data specification for the" << endl;
        os << "       data file that follows. This option is only useful with the -check|-k option." << endl;
+       os << " -cdbpath | -p <url>" << endl;
+       os << "       The path to the CDB to use when running with the -check | -k option." << endl;
+       os << " -run | -r <number>" << endl;
+       os << "       The run number to use when running with the -check | -k option." << endl;
 }
 
 /**
@@ -2598,6 +2834,7 @@ void PrintUsage(bool asError = true)
  *                    and added to 'filenames'.
  * @param continueParse  Set to true if the user requested to continue to parse
  *                      after errors.
+ * @param tryrecover Set to true if the user wants DDL decoder recovery logic enabled.
  * @param checkData  Set to true if data integrity checking was requested.
  * @param maxLogging  Set to true if maximal logging was requested.
  * @return  A status flag suitable for returning from main(), containing either
@@ -2605,22 +2842,26 @@ void PrintUsage(bool asError = true)
  */
 int ParseCommandLine(
                int argc,
-               const char** argv,
+               char** argv,
                const char** filenames,
                int* filetypes,
                const char** dataspecs,
                int& numOfFiles,
                bool& continueParse,
+               bool& tryrecover,
                bool& checkData,
                bool& maxLogging
        )
 {
        numOfFiles = 0;
        continueParse = false;
+       tryrecover = false;
        maxLogging = false;
        checkData = false;
        int currentType = kUnknownDataBlock;
        const char* currentDataSpec = NULL;
+       bool pathSet = false;
+       bool runSet = false;
 
        // Parse the command line.
        for (int i = 1; i < argc; i++)
@@ -2634,6 +2875,10 @@ int ParseCommandLine(
                {
                        continueParse = true;
                }
+               else if (strcmp(argv[i], "-recover") == 0 or strcmp(argv[i], "-e") == 0)
+               {
+                       tryrecover = true;
+               }
                else if (strcmp(argv[i], "-type") == 0 or strcmp(argv[i], "-t") == 0)
                {
                        if (++i >= argc)
@@ -2701,6 +2946,50 @@ int ParseCommandLine(
                        }
                        currentDataSpec = argv[i];
                }
+               else if (strcmp(argv[i], "-cdbpath") == 0 or strcmp(argv[i], "-p") == 0)
+               {
+                       if (pathSet)
+                       {
+                               cerr << "WARNING: Already used -cdbpath|-p with '" << gCDBPath
+                                       << "' before. Will override it with the last value specified with -cdbpath|-p."
+                                       << endl;
+                       }
+                       if (++i >= argc)
+                       {
+                               cerr << "ERROR: Missing the URL for the CDB path." << endl << endl;
+                               PrintUsage();
+                               return CMDLINE_ERROR;
+                       }
+                       gCDBPath = argv[i];
+                       pathSet = true;
+               }
+               else if (strcmp(argv[i], "-run") == 0 or strcmp(argv[i], "-r") == 0)
+               {
+                       if (runSet)
+                       {
+                               cerr << "WARNING: Already used -run|-r with " << gRunNumber
+                                       << " before. Will override it with the last value specified with -run|-r."
+                                       << endl;
+                       }
+                       if (++i >= argc)
+                       {
+                               cerr << "ERROR: Missing the run number." << endl << endl;
+                               PrintUsage();
+                               return CMDLINE_ERROR;
+                       }
+                       
+                       char* cpErr = NULL;
+                       Int_t run = Int_t( strtol(argv[i], &cpErr, 0) );
+                       if (cpErr == NULL or *cpErr != '\0' or run < 0)
+                       {
+                               cerr << "ERROR: Cannot convert '" << argv[i] << "' to a valid run number."
+                                       " Expected a positive integer value." << endl;
+                               return CMDLINE_ERROR;
+                       }
+
+                       gRunNumber = run;
+                       runSet = true;
+               }
                else
                {
                        assert( numOfFiles < argc );
@@ -2725,7 +3014,7 @@ int ParseCommandLine(
 }
 
 
-int main(int argc, const char** argv)
+int main(int argc, char** argv)
 {
        // Test endianess of this machine during runtime and print warning if it is not
        // little endian.
@@ -2753,6 +3042,7 @@ int main(int argc, const char** argv)
 
        int numOfFiles = 0;
        bool continueParse = false;
+       bool tryrecover = false;
        bool checkData = false;
        bool maxLogging = false;
        int returnCode = EXIT_SUCCESS;
@@ -2775,7 +3065,7 @@ int main(int argc, const char** argv)
                
                returnCode = ParseCommandLine(
                                argc, argv, filename, filetype, dataspec, numOfFiles,
-                               continueParse, checkData, maxLogging
+                               continueParse, tryrecover, checkData, maxLogging
                        );
 
                if (returnCode == EXIT_SUCCESS)
@@ -2790,7 +3080,7 @@ int main(int argc, const char** argv)
                                        cout << "########## Start of dump for file: "
                                                << filename[i] << " ##########" << endl;
                                }
-                               int result = ParseBuffer(buffer, bufferSize, continueParse, filetype[i]);
+                               int result = ParseBuffer(buffer, bufferSize, continueParse, tryrecover, filetype[i]);
                                if (buffer != NULL) delete [] buffer;
                                if (result != EXIT_SUCCESS)
                                {