]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTDataDeflaterSimple.cxx
Add printout of S/B in the mass plot (ChiaraB)
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataDeflaterSimple.cxx
index 11877f64ed94c0c4a4033ce31babedad0c134ec8..febca278e619c5b8aea09880d72fc86502b6d604 100644 (file)
@@ -46,6 +46,18 @@ AliHLTDataDeflaterSimple::~AliHLTDataDeflaterSimple()
 {
   // destructor
   Clear();
+
+}
+
+int AliHLTDataDeflaterSimple::AddParameterDefinition(const char* name, int bitLength, int reducedBitLength)
+{
+  /// add a parameter definition to the configuration, return reference id
+  fParameterDefinitions.push_back(AliHLTDataDeflaterParameter(name, bitLength, reducedBitLength));
+  int memberId=fParameterDefinitions.size()-1;
+  if (DoStatistics()) {
+    AddHistogram(memberId, name, bitLength);
+  }
+  return memberId;
 }
 
 bool AliHLTDataDeflaterSimple::OutputParameterBits( int memberId, AliHLTUInt64_t const & value )
@@ -58,6 +70,9 @@ bool AliHLTDataDeflaterSimple::OutputParameterBits( int memberId, AliHLTUInt64_t
   AliHLTUInt32_t length=fParameterDefinitions[memberId].ValueLength(value);
   fParameterDefinitions[memberId].IncrementBitCount(value);
 
+  if (DoStatistics())
+    FillStatistics(memberId, length, value);
+
   if (!OutputBit(switchBit)) return false;
   return OutputBits(v, length);
 }
@@ -65,8 +80,9 @@ bool AliHLTDataDeflaterSimple::OutputParameterBits( int memberId, AliHLTUInt64_t
 void AliHLTDataDeflaterSimple::Clear(Option_t * option)
 {
   // internal cleanup
+  unsigned i=0;
   for (vector<AliHLTDataDeflaterParameter>::iterator m=fParameterDefinitions.begin();
-       m!=fParameterDefinitions.end(); m++) {
+       m!=fParameterDefinitions.end(); m++, i++) {
     m->ResetBitCount();
   }
   AliHLTDataDeflater::Clear(option);