enable deflater statistics if histogram file available
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Feb 2012 06:14:50 +0000 (06:14 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Feb 2012 06:14:50 +0000 (06:14 +0000)
HLT/TPCLib/comp/AliHLTTPCDataCompressionComponent.cxx

index 3c98fc1..eeed6e8 100644 (file)
@@ -878,12 +878,25 @@ int AliHLTTPCDataCompressionComponent::InitDeflater(int mode)
       if (iResult<0) return iResult;
     }
     
+    if (!fHistogramFile.IsNull())
+      deflater->EnableStatistics();
+
     unsigned nofParameters=AliHLTTPCDefinitions::GetNumberOfClusterParameterDefinitions();
     unsigned p=0;
     for (; p<nofParameters; p++) {
       const AliHLTTPCDefinitions::AliClusterParameter& parameter=AliHLTTPCDefinitions::fgkClusterParameterDefinitions[p];
+      // use the pad/time length as reference for the calculation of ratio for residuals
+      unsigned refLength=0;
+      unsigned refLengthPad=0;
+      unsigned refLengthTime=0;
+      if (parameter.fId==AliHLTTPCDefinitions::kPad)               refLengthPad=parameter.fBitLength;
+      else if (parameter.fId==AliHLTTPCDefinitions::kTime)         refLengthTime=parameter.fBitLength;
+      else if (parameter.fId==AliHLTTPCDefinitions::kResidualPad)  refLength=refLengthPad;
+      else if (parameter.fId==AliHLTTPCDefinitions::kResidualTime) refLength=refLengthTime;
+
       if (deflater->AddParameterDefinition(parameter.fName,
-                                          parameter.fBitLength)!=(int)parameter.fId) {
+                                          parameter.fBitLength,
+                                          refLength)!=(int)parameter.fId) {
        // for performance reason the parameter id is simply used as index in the array of
        // definitions, the position must match the id
        HLTFatal("mismatch between parameter id and position in array for parameter %s, rearrange definitions!", parameter.fName);
@@ -897,6 +910,9 @@ int AliHLTTPCDataCompressionComponent::InitDeflater(int mode)
     std::auto_ptr<AliHLTDataDeflaterSimple> deflater(new AliHLTDataDeflaterSimple);
     if (!deflater.get()) return -ENOMEM;
 
+    if (!fHistogramFile.IsNull())
+      deflater->EnableStatistics();
+
     unsigned nofParameters=AliHLTTPCDefinitions::GetNumberOfClusterParameterDefinitions();
     unsigned p=0;
     for (; p<nofParameters; p++) {