]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
make iterattion to next cluster structure better suited for decoding
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Oct 2011 12:17:32 +0000 (12:17 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Oct 2011 12:17:32 +0000 (12:17 +0000)
HLT/TPCLib/comp/AliHLTTPCDataCompressionDecoder.h
HLT/TPCLib/comp/AliHLTTPCDataCompressionMonitorComponent.h

index f54cf462243dbcdeb4b7fa3549edd86654889646..d98e0904df894fba61049998f1ee6dcdf2488444 100644 (file)
@@ -89,16 +89,20 @@ int AliHLTTPCDataCompressionDecoder::ReadRemainingClustersCompressed(T& c, AliHL
   // the compressed format stores the difference of the local row number in
   // the partition to the row of the last cluster
   // add the first row in the partition to get global row number
   // the compressed format stores the difference of the local row number in
   // the partition to the row of the last cluster
   // add the first row in the partition to get global row number
-  // offline uses row number in physical sector, inner sector consists of
-  // partitions 0 and 1, outer sector of partition 2-5
-  int rowOffset=AliHLTTPCTransform::GetFirstRow(partition);//-(partition<2?0:AliHLTTPCTransform::GetFirstRow(2));
+  int rowOffset=AliHLTTPCTransform::GetFirstRow(partition);
 
   int parameterId=0;
   int outClusterCnt=0;
   AliHLTUInt64_t value=0;
   AliHLTUInt32_t length=0;
   AliHLTUInt32_t lastPadRow=0;
 
   int parameterId=0;
   int outClusterCnt=0;
   AliHLTUInt64_t value=0;
   AliHLTUInt32_t length=0;
   AliHLTUInt32_t lastPadRow=0;
+  bool bNextCluster=true;
   while (outClusterCnt<nofClusters && pInflater->NextValue(value, length)) {
   while (outClusterCnt<nofClusters && pInflater->NextValue(value, length)) {
+    if (bNextCluster) {
+      // switch to next cluster
+      c.Next(slice, partition);
+      bNextCluster=false;
+    }
     const AliHLTTPCDefinitions::AliClusterParameter& parameter
       =AliHLTTPCDefinitions::fgkClusterParameterDefinitions[parameterId];
 
     const AliHLTTPCDefinitions::AliClusterParameter& parameter
       =AliHLTTPCDefinitions::fgkClusterParameterDefinitions[parameterId];
 
@@ -125,8 +129,7 @@ int AliHLTTPCDataCompressionDecoder::ReadRemainingClustersCompressed(T& c, AliHL
       {c.SetQMax(value); break;}
     }
     if (parameterId>=AliHLTTPCDefinitions::kLast) {
       {c.SetQMax(value); break;}
     }
     if (parameterId>=AliHLTTPCDefinitions::kLast) {
-      // switch to next cluster
-      c.Next(slice, partition);
+      bNextCluster=true;
       outClusterCnt++;
       parameterId=-1;
     }
       outClusterCnt++;
       parameterId=-1;
     }
@@ -280,7 +283,13 @@ int AliHLTTPCDataCompressionDecoder::ReadTrackClustersCompressed(T& c, AliHLTDat
     int inClusterCnt=0;
     AliHLTUInt64_t value=0;
     AliHLTUInt32_t length=0;
     int inClusterCnt=0;
     AliHLTUInt64_t value=0;
     AliHLTUInt32_t length=0;
+    bool bNextCluster=true;
     while (bReadSuccess && inClusterCnt<nofClusters && pInflater->NextValue(value, length)) {
     while (bReadSuccess && inClusterCnt<nofClusters && pInflater->NextValue(value, length)) {
+      if (bNextCluster) {
+       // switch to next cluster
+       c.Next(slice, partition);
+       bNextCluster=false;
+      }
       const AliHLTTPCDefinitions::AliClusterParameter& parameter
        =AliHLTTPCDefinitions::fgkClusterParameterDefinitions[kParameterIdMapping[parameterId]];
 
       const AliHLTTPCDefinitions::AliClusterParameter& parameter
        =AliHLTTPCDefinitions::fgkClusterParameterDefinitions[kParameterIdMapping[parameterId]];
 
@@ -338,7 +347,7 @@ int AliHLTTPCDataCompressionDecoder::ReadTrackClustersCompressed(T& c, AliHLTDat
        //      << "  charge " << setfill(' ') << setw(5) << fixed << right << setprecision (0) << c.GetQ()
        //      << "  qmax "   << setfill(' ') << setw(4) << fixed << right << setprecision (0) << c.GetMax()
        //      << endl;
        //      << "  charge " << setfill(' ') << setw(5) << fixed << right << setprecision (0) << c.GetQ()
        //      << "  qmax "   << setfill(' ') << setw(4) << fixed << right << setprecision (0) << c.GetMax()
        //      << endl;
-       c.Next(slice, partition);
+       bNextCluster=true;
        inClusterCnt++;
        parameterId=-1;
       }
        inClusterCnt++;
        parameterId=-1;
       }
index 87e67d17ed7f9517cca62d40fdca5451f3922dbd..5b87dfd6987ff33eaee9b19ebb95c41a9cc6468a 100644 (file)
@@ -128,8 +128,8 @@ public:
 
     class iterator {
     public:
 
     class iterator {
     public:
-      iterator() : fClusterNo(0), fData(NULL), fClusterId(kAliHLTVoidDataSpec) {}
-      iterator(AliDataContainer* pData) : fClusterNo(0), fData(pData), fClusterId(fData?fData->GetClusterId(fClusterNo):kAliHLTVoidDataSpec) {}
+      iterator() : fClusterNo(-1), fData(NULL), fClusterId(kAliHLTVoidDataSpec) {}
+      iterator(AliDataContainer* pData) : fClusterNo(-1), fData(pData), fClusterId(fData?fData->GetClusterId(fClusterNo):kAliHLTVoidDataSpec) {}
       iterator(const iterator& other) : fClusterNo(other.fClusterNo), fData(other.fData), fClusterId(other.fClusterId) {}
       iterator& operator=(const iterator& other) {
        fClusterNo=other.fClusterNo; fData=other.fData; fClusterId=other.fClusterId; return *this;
       iterator(const iterator& other) : fClusterNo(other.fClusterNo), fData(other.fData), fClusterId(other.fClusterId) {}
       iterator& operator=(const iterator& other) {
        fClusterNo=other.fClusterNo; fData=other.fData; fClusterId=other.fClusterId; return *this;