From 892210c72226161505777ceb72a0ef5c9e00d904 Mon Sep 17 00:00:00 2001 From: richterm Date: Thu, 6 Mar 2008 13:27:04 +0000 Subject: [PATCH] coding conventions and compilation warnings and work on adaptive TPC data compression (Jenny) --- .../AliHLTTPCCompDataCompressorHelper.cxx | 30 +- .../comp/AliHLTTPCCompDataCompressorHelper.h | 22 +- .../comp/AliHLTTPCCompDumpComponent.cxx | 180 +++++++- HLT/TPCLib/comp/AliHLTTPCCompDumpComponent.h | 164 +------- .../comp/AliHLTTPCCompModelAnalysis.cxx | 398 ++++++++++++++++-- HLT/TPCLib/comp/AliHLTTPCCompModelAnalysis.h | 36 +- .../comp/AliHLTTPCCompModelConverter.cxx | 33 +- HLT/TPCLib/comp/AliHLTTPCCompModelConverter.h | 7 +- .../AliHLTTPCCompModelConverterComponent.cxx | 35 +- .../AliHLTTPCCompModelConverterComponent.h | 22 +- .../comp/AliHLTTPCCompModelDeconverter.cxx | 29 +- .../comp/AliHLTTPCCompModelDeconverter.h | 7 +- ...AliHLTTPCCompModelDeconverterComponent.cxx | 39 +- .../AliHLTTPCCompModelDeconverterComponent.h | 18 +- .../comp/AliHLTTPCCompModelDeflater.cxx | 162 ++++++- HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.h | 145 +------ .../AliHLTTPCCompModelDeflaterComponent.cxx | 33 +- .../AliHLTTPCCompModelDeflaterComponent.h | 20 +- .../comp/AliHLTTPCCompModelInflater.cxx | 193 ++++++++- HLT/TPCLib/comp/AliHLTTPCCompModelInflater.h | 168 +------- .../AliHLTTPCCompModelInflaterComponent.cxx | 29 +- .../AliHLTTPCCompModelInflaterComponent.h | 16 +- 22 files changed, 1120 insertions(+), 666 deletions(-) diff --git a/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.cxx b/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.cxx index 3d205eaf558..7ac405ca665 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.cxx @@ -1,19 +1,21 @@ // $Id$ -/************************************************************************** - * TPCCompModelAnalysisright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Anders Vestbo * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Anders Vestbo, maintained by * +//* Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompDataCompressorHelper.cxx @author Anders Vestbo diff --git a/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.h b/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.h index e66add4287e..82ae334c89e 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.h @@ -1,20 +1,9 @@ // XEmacs -*-C++-*- // $Id$ -/************************************************************************** - * TPCCompModelAnalysisright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Anders Vestbo * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompDataCompressorHelper.h @author Anders Vestbo @@ -28,9 +17,8 @@ #include "AliHLTTPCRootTypes.h" /** @class AliHLTTPCCompDataCompressorHelper - @author Anders Vestbo - @date 30-11-2006 - @brief Class to implement compression functions that will be used in Vestbo-compression + @brief Class to implement compression functions that will be used in + Vestbo-compression. */ class AliHLTTPCCompDataCompressorHelper { diff --git a/HLT/TPCLib/comp/AliHLTTPCCompDumpComponent.cxx b/HLT/TPCLib/comp/AliHLTTPCCompDumpComponent.cxx index deb16b5ddb6..3c1da17fe2f 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompDumpComponent.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompDumpComponent.cxx @@ -1,24 +1,28 @@ // $Id$ -/************************************************************************** - * TPCCompDumpright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompDumpComponent.cxx @author Timm Steinbeck @date 10-08-2006 - @brief A copy processing component for the HLT. */ + @brief A copy processing component for the HLT + that writes the results of the Vestbo compression + components to humanly readable files +*/ #if __GNUC__ >= 3 using namespace std; @@ -55,13 +59,13 @@ AliHLTTPCCompDumpComponent::~AliHLTTPCCompDumpComponent() // see header file for class documentation } -const char* AliHLTTPCCompDumpComponent::GetComponentID() +const char* AliHLTTPCCompDumpComponent::GetComponentID() { // see header file for class documentation return "TPCCompDump"; // The ID of this component } -void AliHLTTPCCompDumpComponent::GetInputDataTypes( vector& list) +void AliHLTTPCCompDumpComponent::GetInputDataTypes( vector& list) { // see header file for class documentation list.clear(); // We do not have any requirements for our input data type(s). @@ -78,7 +82,7 @@ AliHLTComponent_DataType AliHLTTPCCompDumpComponent::GetOutputDataType() return AliHLTTPCDefinitions::fgkClusterTracksModelDataType; } -void AliHLTTPCCompDumpComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) +void AliHLTTPCCompDumpComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) { // see header file for class documentation constBase = 0; @@ -94,6 +98,146 @@ AliHLTComponent* AliHLTTPCCompDumpComponent::Spawn() return new AliHLTTPCCompDumpComponent; }; +void AliHLTTPCCompDumpComponent::InitBitDataInput( AliHLTUInt8_t* input, UInt_t inputSize ) + { + // see header file for class documentation + fBitDataCurrentWord = 0; + fBitDataCurrentPosInWord = 7; + fBitDataCurrentInput = fBitDataCurrentInputStart = input; + fBitDataCurrentInputEnd = input+inputSize; + fBitDataCurrentWord = *fBitDataCurrentInput; + }; + + bool AliHLTTPCCompDumpComponent::InputBit( AliHLTUInt8_t & value ) + { + // see header file for class documentation + if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd ) + return false; + value = (fBitDataCurrentWord >> fBitDataCurrentPosInWord) & 1; + if ( fBitDataCurrentPosInWord ) + fBitDataCurrentPosInWord--; + else + { + fBitDataCurrentInput++; + if ( fBitDataCurrentInput8 ) + { + HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); + return false; + } + AliHLTUInt64_t temp; + if ( !InputBits( temp, bitCount ) ) + return false; + value = (AliHLTUInt8_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); + return true; + }; + +bool AliHLTTPCCompDumpComponent::InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount ) + { + // see header file for class documentation + if ( bitCount>16 ) + { + HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); + return false; + } + AliHLTUInt64_t temp; + if ( !InputBits( temp, bitCount ) ) + return false; + value = (AliHLTUInt16_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); + return true; + }; + +bool AliHLTTPCCompDumpComponent::InputBits( Int_t & value, UInt_t const & bitCount ) + { + // see header file for class documentation + if ( bitCount>32 ) + { + HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); + return false; + } + AliHLTUInt64_t temp; + if ( !InputBits( temp, bitCount ) ) + return false; + value = (Int_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); + return true; + }; + +bool AliHLTTPCCompDumpComponent::InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount ) + { + // see header file for class documentation + if ( bitCount>64 ) + { + HLTFatal( "Internal error: Attempt to write more than 64 bits (%u)", (unsigned)bitCount ); + return false; + } + UInt_t bitsToRead=bitCount; + UInt_t curBitCount; + value = 0; + while ( bitsToRead>0 ) + { + if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd ) + return false; + if ( bitsToRead >= fBitDataCurrentPosInWord+1 ) + curBitCount = fBitDataCurrentPosInWord+1; + else + curBitCount = bitsToRead; + value = (value << curBitCount) | ( (fBitDataCurrentWord >> (fBitDataCurrentPosInWord-curBitCount+1)) & ((1 << curBitCount)-1) ); + if ( fBitDataCurrentPosInWord < curBitCount ) + { + fBitDataCurrentInput++; + if ( fBitDataCurrentInputfBitDataCurrentInputEnd ) + return false; + memcpy( data, fBitDataCurrentInput, byteCount ); + fBitDataCurrentInput += byteCount; + if ( fBitDataCurrentInput=fBitDataCurrentInputEnd ) - return false; - value = (fBitDataCurrentWord >> fBitDataCurrentPosInWord) & 1; - if ( fBitDataCurrentPosInWord ) - fBitDataCurrentPosInWord--; - else - { - fBitDataCurrentInput++; - if ( fBitDataCurrentInput8 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (AliHLTUInt8_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( AliHLTUInt8_t & value, UInt_t const & bitCount ); /** function to determine input bits between 8 and 16 bits * @param value AliHLTUInt16_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount ) - { - if ( bitCount>16 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (AliHLTUInt16_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount ); /** function to determine input bits between 16 and 32 bits * @param value AliHLTUInt32_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount ) - { - if ( bitCount>32 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (AliHLTUInt32_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount ); /** function to determine input bits between 16 and 32 bits II * @param value Int_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( Int_t & value, UInt_t const & bitCount ) - { - if ( bitCount>32 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (Int_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( Int_t & value, UInt_t const & bitCount ); /** function to determine input bits between 32 and 64 bits * @param value AliHLTUInt64_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount ) - { - if ( bitCount>64 ) - { - HLTFatal( "Internal error: Attempt to write more than 64 bits (%u)", (unsigned)bitCount ); - return false; - } - UInt_t bitsToRead=bitCount; - UInt_t curBitCount; - value = 0; - while ( bitsToRead>0 ) - { - if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd ) - return false; - if ( bitsToRead >= fBitDataCurrentPosInWord+1 ) - curBitCount = fBitDataCurrentPosInWord+1; - else - curBitCount = bitsToRead; - value = (value << curBitCount) | ( (fBitDataCurrentWord >> (fBitDataCurrentPosInWord-curBitCount+1)) & ((1 << curBitCount)-1) ); - if ( fBitDataCurrentPosInWord < curBitCount ) - { - fBitDataCurrentInput++; - if ( fBitDataCurrentInputfBitDataCurrentInputEnd ) - return false; - memcpy( data, fBitDataCurrentInput, byteCount ); - fBitDataCurrentInput += byteCount; - if ( fBitDataCurrentInput * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: J. Wagner * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelAnalysis.cxx @author J. Wagner jwagner@cern.ch @@ -186,6 +187,32 @@ Int_t AliHLTTPCCompModelAnalysis::SetTracks(AliHLTTPCTrackletData* tracklets, Bo return 0; } +Int_t AliHLTTPCCompModelAnalysis::SetClusters(AliHLTTPCClusterData* clusters, UInt_t slice, UInt_t patch, Bool_t fillingfirstclusters) +{ + // see header file for class documentation + if(fillingfirstclusters == 1) + { + if ( slice>=36 || patch>=6 ) + return EINVAL; + if ( fOriginalClusters[slice][patch] ) + return EBUSY; + fOriginalClusters[slice][patch] = clusters; + + //HLTDebug( "Filling %u clusters in first array", (unsigned)clusters->fSpacePointCnt); + } + else + { + if ( slice>=36 || patch>=6 ) + return EINVAL; + if ( fSecondaryClusters[slice][patch] ) + return EBUSY; + fSecondaryClusters[slice][patch] = clusters; + + //HLTDebug( "Filling %u clusters in second array", (unsigned)clusters->fSpacePointCnt); + } + return 0; +} + Int_t AliHLTTPCCompModelAnalysis::CompareTracks() { // see header file for class documentation @@ -364,6 +391,242 @@ Int_t AliHLTTPCCompModelAnalysis::CompareTracks() return 0; } +Int_t AliHLTTPCCompModelAnalysis::CompareClusters(Bool_t relativedifferences) +{ + + Int_t totaloriginal = 0; + Int_t totalsecondary = 0; + Int_t usedclusters = 0; + Int_t comparedclusters = 0; + Int_t notcomparedclusters = 0; + + // create graphs out of differences and leave loop + TFile* clustergraphrootfile; + if(!fGraphFileName.IsNull()) + { + clustergraphrootfile = new TFile(fGraphFileName, "recreate"); + } + + // specifications of histograms + Double_t clusterdifffxmin, clusterdifffxmax; + Double_t clusterdifffymin, clusterdifffymax; + Double_t clusterdifffzmin, clusterdifffzmax; + Int_t clusterdifffxbins, clusterdifffybins, clusterdifffzbins; + + Double_t clusterdifffsigmay2min, clusterdifffsigmay2max; + Double_t clusterdifffsigmaz2min, clusterdifffsigmaz2max; + Int_t clusterdifffsigmay2bins, clusterdifffsigmaz2bins; + + if (!relativedifferences) // not tested yet! + { + clusterdifffxmin = -1; + clusterdifffxmax = +1; + clusterdifffxbins = (Int_t) ((clusterdifffxmax - clusterdifffxmin)/0.0001); + + clusterdifffymin = -1; + clusterdifffymax = +1; + clusterdifffybins = (Int_t) ((clusterdifffymax - clusterdifffymin)/0.0001); + + clusterdifffzmin = -1; + clusterdifffzmax = +1; + clusterdifffzbins = (Int_t) ((clusterdifffzmax - clusterdifffzmin)/0.0001); + + clusterdifffsigmay2min = -1; + clusterdifffsigmay2max = +1; + clusterdifffsigmay2bins = (Int_t) ((clusterdifffsigmay2max - clusterdifffsigmay2min)/0.0001); + + clusterdifffsigmaz2min = -1; + clusterdifffsigmaz2max = +1; + clusterdifffsigmaz2bins = (Int_t) ((clusterdifffsigmaz2max - clusterdifffsigmaz2min)/0.0001); + } + else + { + clusterdifffxmin = -1; + clusterdifffxmax = +1; + clusterdifffxbins = (Int_t) ((clusterdifffxmax - clusterdifffxmin)/0.0001); + + clusterdifffymin = -1; + clusterdifffymax = +1; + clusterdifffybins = (Int_t) ((clusterdifffymax - clusterdifffymin)/0.0001); + + clusterdifffzmin = -1; + clusterdifffzmax = +1; + clusterdifffzbins = (Int_t) ((clusterdifffzmax - clusterdifffzmin)/0.0001); + + clusterdifffsigmay2min = -1; + clusterdifffsigmay2max = +1; + clusterdifffsigmay2bins = (Int_t) ((clusterdifffsigmay2max - clusterdifffsigmay2min)/0.0001); + + clusterdifffsigmaz2min = -1; + clusterdifffsigmaz2max = +1; + clusterdifffsigmaz2bins = (Int_t) ((clusterdifffsigmaz2max - clusterdifffsigmaz2min)/0.0001); + } + + // intialise histogramms + TH1F* clusterfxhisto = new TH1F("Differences of x (original - secondary) clusters", "Differences of x (original - secondary) clusters", clusterdifffxbins, clusterdifffxmin, clusterdifffxmax); + TH1F* clusterfyhisto = new TH1F("Differences of y (original - secondary) clusters", "Differences of y (original - secondary) clusters", clusterdifffybins, clusterdifffymin, clusterdifffymax); + TH1F* clusterfzhisto = new TH1F("Differences of z (original - secondary) clusters", "Differences of z (original - secondary) clusters", clusterdifffzbins, clusterdifffzmin, clusterdifffzmax); + TH1F* clusterfsigmay2histo = new TH1F("Differences of sigmay2 (original - secondary) clusters", "Differences of sigmay2 (original - secondary) clusters", clusterdifffsigmay2bins, clusterdifffsigmay2min, clusterdifffsigmay2max); + TH1F* clusterfsigmaz2histo = new TH1F("Differences of sigmaz2 (original - secondary) clusters", "Differences of sigmaz2 (original - secondary) clusters", clusterdifffsigmaz2bins, clusterdifffsigmaz2min, clusterdifffsigmaz2max); + + + // see headerfile for class documentation + // compare for each slice and patch the clusters in the original cluster array + // to the ones of the secondary cluster array + for(Int_t slicecntr = 0; slicecntr < 36; slicecntr++) + { + for (Int_t patchcntr = 0; patchcntr < 6; patchcntr++) + { + if(!fOriginalClusters[slicecntr][patchcntr]) + { + // HLTDebug("No original clusters for slice %d patch %d", slicecntr, patchcntr); + continue; + } + + if(!fSecondaryClusters[slicecntr][patchcntr]) + { + //HLTDebug("No secondary clusters for slice %d patch %d", slicecntr, patchcntr); + continue; + } + + for ( unsigned long ii=0; iifSpacePointCnt; ii++ ) + { + ++totaloriginal; + + // search matching secondary cluster by charge and padrow, + // fill histograms if cluster has been used in tracking process + Int_t found = 0; + + for(unsigned long jj=0; jjfSpacePointCnt; jj++) + { + // if fTrackN != -1 -> draw histograms out of used clusters + // if fTrackN == -1 -> draw histograms out of unused clusters + if (fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fTrackN == -1) + { + if((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fCharge == fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fCharge) && (fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fPadRow == fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fPadRow) ) + { + + if (relativedifferences == 1) + { + // check whether first entries in cluster array are zero + if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX == 0) + { + HLTWarning("Warning! x value of original cluster is zero, relative differences cannot be calculated!"); + }; + + if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY == 0) + { + HLTWarning("Warning! y value of original cluster is zero, relative differences cannot be calculated!"); + }; + + if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ == 0) + { + HLTWarning("Warning! z value of original cluster is zero, relative differences cannot be calculated!"); + }; + + if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2 == 0) + { + HLTWarning("Warning! sigmay2 value of original cluster is zero, relative differences cannot be calculated!"); + }; + + if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2 == 0) + { + HLTWarning("Warning! sigmaz2 value of original cluster is zero, relative differences cannot be calculated!"); + }; + + // fill relative differences in histograms + clusterfxhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fX)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX,1); + clusterfyhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fY)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY,1); + clusterfzhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fZ)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ,1); + clusterfsigmay2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaY2)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2,1); + clusterfsigmaz2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaZ2)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2,1); + } + else + { + // fill absolute differences histograms + clusterfxhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fX),1); + clusterfyhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fY),1); + clusterfzhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fZ),1); + clusterfsigmay2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaY2),1); + clusterfsigmaz2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaZ2),1); + } + + found = 1; + ++comparedclusters; + break; + } + } + } + + if(found == 0) + { + ++notcomparedclusters; + } + + } + } + } + + // write graphs to rootfile + if(!fGraphFileName.IsNull()) + { + clustergraphrootfile->WriteObject(clusterfxhisto, "clusterfxhistogram"); + clustergraphrootfile->WriteObject(clusterfyhisto, "clusterfyhistogram"); + clustergraphrootfile->WriteObject(clusterfzhisto, "clusterfzhistogram"); + clustergraphrootfile->WriteObject(clusterfsigmay2histo, "clusterfsigmay2histogram"); + clustergraphrootfile->WriteObject(clusterfsigmaz2histo, "clusterfsigmaz2histogram"); + clustergraphrootfile->Close(); + } + + // count clusters used for tracking + for (Int_t slicecount=0; slicecount<36; slicecount++) + { + for(Int_t patchcount=0; patchcount<6; patchcount++) + { + + if(!fSecondaryClusters[slicecount][patchcount]) + { + //HLTDebug("No secondary clusters for slice %d patch %d", slicecntr, patchcntr); + continue; + } + + for(Int_t count=0; count < fSecondaryClusters[slicecount][patchcount]->fSpacePointCnt; count++) + { + + ++totalsecondary; + + if(fSecondaryClusters[slicecount][patchcount]->fSpacePoints[count].fTrackN != -1) + { + ++usedclusters; + }; + } + } + } + + // Display results of cluster analysis + HLTInfo("Number of original clusters: %d", totaloriginal); + HLTInfo("Number of 2ndary clusters: %d", totalsecondary); + HLTInfo("Number of 2ndary clusters used for tracking: %d", usedclusters); + HLTInfo("Number of compared (tracked) original clusters: %d", comparedclusters); + HLTInfo("Number of uncompared (tracked) original clusters: %d", notcomparedclusters); + + ////////////////////////////////////////////////////// + FILE* clusterfile = fopen("/afsuser/jwagner/TrackerTest_25092007/cosmics/fullanalysis/clusteranalysis.out", "a"); + + fprintf(clusterfile, "%d \t %d \t %d \t %d \t %d \t %d \n", totaloriginal, totalsecondary, usedclusters, comparedclusters, notcomparedclusters, totaloriginal-comparedclusters-notcomparedclusters); + + fclose(clusterfile); + //////////////////////////////////////////////////////// + + // consistency check + if(comparedclusters + notcomparedclusters != totaloriginal) + { + HLTWarning("Possible inconsistency: number of compared clusters %d + number of not compared clusters %d not equal to total number of original clusters %d", comparedclusters, notcomparedclusters, totaloriginal); + } + + return 0; +} + AliHLTTPCTrack AliHLTTPCCompModelAnalysis::GetComparableTrackPythiaInfo(AliHLTTPCTrack comparabletrack) { // see headerfile for class documentation @@ -600,7 +863,7 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) diffclustermax = +50; diffclusterbins = (Int_t) ((diffclustermax - diffclustermin)/1); -#if 0 + //#if 0 diffpterrmin = -1; diffpterrmax = 1; diffpterrbins = (Int_t) ((diffpterrmax - diffpterrmin)/1); @@ -612,7 +875,7 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) difftglerrmin = -1; difftglerrmax = 1; difftglerrbins = (Int_t) ((difftglerrmax - difftglerrmin)/1); -#endif + //#endif } else @@ -657,7 +920,7 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) diffclustermax = +1; diffclusterbins = (Int_t) ((diffclustermax - diffclustermin)/0.0001); -#if 0 + //#if 0 diffpterrmin = -1; diffpterrmax = 1; diffpterrbins = (Int_t) ((diffpterrmax - diffpterrmin)/0.0001); @@ -669,7 +932,7 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) difftglerrmin = -1; difftglerrmax = 1; difftglerrbins = (Int_t) ((difftglerrmax - difftglerrmin)/0.0001); -#endif + //#endif } // intialise histogramms @@ -684,13 +947,19 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) TH1F* tglhisto = new TH1F("Differences of tgl (original - secondary) track", "Differences of tgl (original - secondary) track", difftglbins, difftglmin, difftglmax); TH1F* clusterhisto = new TH1F("Differences of asserted clusters (original - secondary) track", "Differences of asserted clusters (original - secondary) track", diffclusterbins, diffclustermin, diffclustermax); -#if 0 + //#if 0 // commented out since pterr is zero for every track! TH1F* pterrhisto = new TH1F("Differences of pt error (original - secondary) track", "Differences of pt error (original - secondary) track", diffpterrbins, diffpterrmin, diffpterrmax); TH1F* psierrhisto = new TH1F("Differences of psi error (original - secondary) track", "Differences of psi error (original - secondary) track", diffpsierrbins, diffpsierrmin, diffpsierrmax); TH1F* tglerrhisto = new TH1F("Differences of tgl error (original - secondary) track", "Differences of tgl error (original - secondary) track", difftglerrbins, difftglerrmin, difftglerrmax); -#endif + //#endif + + // initialise histograms for tracking efficiency against pt + // relative p_t resolution: 1.2% -> take 0.1GeV * 1.2 % --> binsize 0.001 sufficient to grant correct resolution for low pt + TH1F* firsttracks = new TH1F("pt occurrence original", "Occurrence of pt in original tracks", 10000, 0, 10); + TH1F* matchedtrackeff = new TH1F("matchedtreffeff", "Occurrence of 2ndary tracks with good pt", 10000, 0, 10); + TH1F* trackeff = new TH1F("tracking efficiency vs. pt", "Tracking efficiency vs. pt", 10000, 0, 10); // evaluate quality of fit: TH1I* matchinghisto = new TH1I("Matching indicator (5 - 10)", "Matching indicator (5 - 10)", 11, 0, 11); @@ -703,8 +972,57 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) // matching track trackmatchingpointer = tracklistpointer->matchingtrack; + // fill histograms for trackingefficiency vs. pt + firsttracks->Fill(tracklistpointer->track.GetPt(),1); + + if(abs(tracklistpointer->track.GetPt()-trackmatchingpointer->track.GetPt()) < 0.012*tracklistpointer->track.GetPt()) + { + matchedtrackeff->Fill(tracklistpointer->track.GetPt(),1); + } + + //tracklistpointer = tracklistpointer->next; // only efficiency is considered... + //continue; // only efficiency is considered... + if(relativedifferences == 1) // fill histogram with relative differences { + + // check if first track parameters are not zero! + if (tracklistpointer->track.GetFirstPointX()==0) + { + HLTWarning("Warning! First x of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetFirstPointY()==0) + { + HLTWarning("Warning! First y of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetFirstPointZ()==0) + { + HLTWarning("Warning! First z of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetLastPointX()==0) + { + HLTWarning("Warning! Last x of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetLastPointY()==0) + { + HLTWarning("Warning! Last y of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetLastPointZ()==0) + { + HLTWarning("Warning! Last z of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetPt()==0) + { + HLTWarning("Warning! Pt of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetPsi()==0) + { + HLTWarning("Warning! Psi of original track is zero, relative differences cannot be calculated!"); + }; + if (tracklistpointer->track.GetTgl()==0) + { + HLTWarning("Warning! Tgl of original track is zero, relative differences cannot be calculated!"); + }; firstxhisto->Fill((tracklistpointer->track.GetFirstPointX()-trackmatchingpointer->track.GetFirstPointX())/tracklistpointer->track.GetFirstPointX(),1); firstyhisto->Fill((tracklistpointer->track.GetFirstPointY()-trackmatchingpointer->track.GetFirstPointY())/tracklistpointer->track.GetFirstPointY(),1); firstzhisto->Fill((tracklistpointer->track.GetFirstPointZ()-trackmatchingpointer->track.GetFirstPointZ())/tracklistpointer->track.GetFirstPointZ(),1); @@ -716,15 +1034,15 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) tglhisto->Fill((tracklistpointer->track.GetTgl()-trackmatchingpointer->track.GetTgl())/tracklistpointer->track.GetTgl(),1); clusterhisto->Fill((tracklistpointer->track.GetNHits()-trackmatchingpointer->track.GetNHits())/tracklistpointer->track.GetNHits(),1); -#if 0 + //#if 0 pterrhisto->Fill((tracklistpointer->track.GetPterr()-trackmatchingpointer->track.GetPterr())/tracklistpointer->track.GetPterr(),1); psierrhisto->Fill((tracklistpointer->track.GetPsierr()-trackmatchingpointer->track.GetPsierr())/tracklistpointer->track.GetPsierr(),1); tglerrhisto->Fill((tracklistpointer->track.GetTglerr()-trackmatchingpointer->track.GetTglerr())/tracklistpointer->track.GetTglerr(),1); - HLTInfo("Pterr: 1st:%f 2nd:%f value:%f",tracklistpointer->track.GetPterr(),trackmatchingpointer->track.GetPterr(),(tracklistpointer->track.GetPterr()-trackmatchingpointer->track.GetPterr())/tracklistpointer->track.GetPterr()); - HLTInfo("Psierr: 1st:%f 2nd:%f value:%f",tracklistpointer->track.GetPsierr(),trackmatchingpointer->track.GetPsierr(),(tracklistpointer->track.GetPsierr()-trackmatchingpointer->track.GetPsierr())/tracklistpointer->track.GetPsierr()); - HLTInfo("Tglerr: 1st:%f 2nd:%f value:%f",tracklistpointer->track.GetTglerr(),trackmatchingpointer->track.GetTglerr(),(tracklistpointer->track.GetTglerr()-trackmatchingpointer->track.GetTglerr())/tracklistpointer->track.GetTglerr()); -#endif + //HLTInfo("Pterr: 1st:%f 2nd:%f value:%f",tracklistpointer->track.GetPterr(),trackmatchingpointer->track.GetPterr(),(tracklistpointer->track.GetPterr()-trackmatchingpointer->track.GetPterr())/tracklistpointer->track.GetPterr()); + //HLTInfo("Psierr: 1st:%f 2nd:%f value:%f",tracklistpointer->track.GetPsierr(),trackmatchingpointer->track.GetPsierr(),(tracklistpointer->track.GetPsierr()-trackmatchingpointer->track.GetPsierr())/tracklistpointer->track.GetPsierr()); + //HLTInfo("Tglerr: 1st:%f 2nd:%f value:%f",tracklistpointer->track.GetTglerr(),trackmatchingpointer->track.GetTglerr(),(tracklistpointer->track.GetTglerr()-trackmatchingpointer->track.GetTglerr())/tracklistpointer->track.GetTglerr()); + //#endif } else // otherwise fill histogram with absolute differences { @@ -738,12 +1056,12 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) psihisto->Fill(tracklistpointer->track.GetPsi()-trackmatchingpointer->track.GetPsi(),1); tglhisto->Fill(tracklistpointer->track.GetTgl()-trackmatchingpointer->track.GetTgl(),1); clusterhisto->Fill(tracklistpointer->track.GetNHits()-trackmatchingpointer->track.GetNHits(),1); -#if 0 + //#if 0 // commented out since pterr is always zero for every track! pterrhisto->Fill(tracklistpointer->track.GetPterr()-trackmatchingpointer->track.GetPterr(),1); psierrhisto->Fill(tracklistpointer->track.GetPsierr()-trackmatchingpointer->track.GetPsierr(),1); tglerrhisto->Fill(tracklistpointer->track.GetTglerr()-trackmatchingpointer->track.GetTglerr(),1); -#endif + //#endif } // fill histogram that determines the quality of the fit @@ -753,11 +1071,12 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) tracklistpointer = tracklistpointer->next; } + trackeff->Divide(matchedtrackeff, firsttracks,1,1,""); + // write histograms to root file specified in command line argument -graphs .ROOT if(!fGraphFileName.IsNull()) { - TFile* graphrootfile = new TFile(fGraphFileName, "recreate"); - + TFile* graphrootfile = new TFile(fGraphFileName, "update"); graphrootfile->WriteObject(firstxhisto,"firstxhistogram"); //firstxhisto->Write(); graphrootfile->WriteObject(firstyhisto,"firstyhistogram"); @@ -780,7 +1099,10 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) //clusterhisto->Write(); graphrootfile->WriteObject(matchinghisto,"matchinghistogram"); //matchinghisto->Write(); -#if 0 + graphrootfile->WriteObject(firsttracks, "firsttrackeff"); + graphrootfile->WriteObject(matchedtrackeff, "secondtrackeff"); + graphrootfile->WriteObject(trackeff, "trackingefficiency"); + // errors in tracking (commented out since pterr is always 0 for every track!) graphrootfile->WriteObject(pterrhisto, "pterrhistogram"); //pterrhisto->Write(); @@ -788,7 +1110,6 @@ Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) //psierrhisto->Write(); graphrootfile->WriteObject(tglerrhisto, "tglerrhistogram"); //tglerrhisto->Write(); -#endif graphrootfile->Close(); } else @@ -931,6 +1252,14 @@ Int_t AliHLTTPCCompModelAnalysis::DisplayModelResults() Int_t AliHLTTPCCompModelAnalysis::DisplayTrackResults() { // see header file for class documentation + HLTInfo("---------------CLUSTER ANALYSIS---------------"); + if(CompareClusters(1) != 0) + { + return EINVAL; + } + + return 0; // exit after cluster analysis has been done + // start with comparison if(CompareTracks() != 0) { @@ -950,6 +1279,7 @@ Int_t AliHLTTPCCompModelAnalysis::DisplayTrackResults() } // print out number of compared tracks + HLTInfo("---------------TRACK ANALYSIS---------------"); HLTInfo("---------------ORIGINAL TRACKS: %d ---------------", fFirstTrackArray.GetNTracks()); HLTInfo("Number of tracks with pt < 0.1 GeV: %d", fFirstTrashTracks); HLTInfo("Number of matched tracks with pt < 0.1 GeV: %d", fMatchedFirstTrashTracks); @@ -984,8 +1314,8 @@ Int_t AliHLTTPCCompModelAnalysis::DisplayTrackResults() ////////////////////////////////////////////////////////////////////// // additional files temporarily necessary for output information - FILE* infofile = fopen("/afsuser/jwagner/TrackerTest_25092007/cosmics/fullanalysis08012008/trackingefficiency.out","a"); - FILE* info2file = fopen("/afsuser/jwagner/TrackerTest_25092007/cosmics/fullanalysis08012008/parameters.out", "a"); + FILE* infofile = fopen("/afsuser/jwagner/TrackerTest_25092007/pp-ca/fullanalysis08012008/trackingefficiency.out","a"); + FILE* info2file = fopen("/afsuser/jwagner/TrackerTest_25092007/pp-ca/fullanalysis08012008/parameters.out", "a"); // consistent = 0 if tracks and second tracks match perfectly, i.e. no doubly assigned tracks,etc. Int_t consistentfirst = fFirstTrackArray.GetNTracks() - fTotalComparedTracks - fFirstUnmatchedTracks; @@ -1110,7 +1440,7 @@ Int_t AliHLTTPCCompModelAnalysis::DisplayTrackResults() HLTInfo(" Last x: %9.6f \t last y: %9.6f \t last z: %9.6f", listprintpointer->track.GetLastPointX(),listprintpointer->track.GetLastPointY(),listprintpointer->track.GetLastPointZ()); HLTInfo(" Pt: %9.6f \t Psi: %9.6f \t Tgl: %9.6f", listprintpointer->track.GetPt(), listprintpointer->track.GetPsi(), listprintpointer->track.GetTgl()); HLTInfo("--------------"); -#endif +#endif // print these results to file if(!fDumpFileName.IsNull()) { diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelAnalysis.h b/HLT/TPCLib/comp/AliHLTTPCCompModelAnalysis.h index b3186138329..354177c3d2b 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelAnalysis.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelAnalysis.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELANALYSIS_H #define ALIHLTTPCCOMPMODELANALYSIS_H -/* TPCCompModelAnalysisright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelAnalysisright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelAnalysis.h @author J. Wagner @@ -27,7 +28,7 @@ * An implementiation of a class that is used to analyse the * loss due to the conversion / compression in the Vestbo-model * resolution change due to Vestbo-model on tracking performance - * @ingroup alihlt_tutorial + * @ingroup alihlt_tpc */ class AliHLTTPCCompModelAnalysis: public AliHLTLogging { @@ -72,12 +73,21 @@ public: Bool_t GetfTrackAnalysis() {return fTrackAnalysis;}; /** fill track arrays with track data from original and secondary tracking - * @param tracklets pointer to track array to be filled + * @param firsttracklets pointer to track array to be filled * @param fillingfirsttracks boolean to decide which track array is to be filled (1 for first, 0 for second) * @return 0 upon success */ Int_t SetTracks(AliHLTTPCTrackletData* tracklets, Bool_t fillingfirsttracks); + /** fill cluster arrays with cluster data from original and secondary clusters + * @param clusters pointer to cluster data array to be filled + * @param slice slice number where clusters come from + * @param patch patch number where clusters come from + * @param fillingfirstclusters boolean to decide which track array is to be filled (1 for first, 0 for second) + * @return 0 upon success + */ + Int_t SetClusters(AliHLTTPCClusterData* clusters, UInt_t slice, UInt_t patch, Bool_t fillingfirstclusters); + /** store discarded tracks in model analysis to be displayed in @ref DisplayModelResults(), * uses @ref GetTrashTrackPythiaInfo * @param lowpttrack pointer to discarded track which is to be remembered for analysis @@ -95,10 +105,6 @@ public: Int_t MarkTrashCluster(AliHLTTPCClusterData *discardedcluster, UInt_t slice, UInt_t patch); private: - /** copy constructor prohibited */ - AliHLTTPCCompModelAnalysis(const AliHLTTPCCompModelAnalysis&); - /** assignment operator prohibited */ - AliHLTTPCCompModelAnalysis& operator=(const AliHLTTPCCompModelAnalysis&); /** private function to display results from model loss analysis * @return 0 upon success @@ -115,6 +121,12 @@ private: */ Int_t CompareTracks(); + /** compare clusters for all tracks and create graphs out of the differences + * function used in @ref DisplayTrackResults() + * @return 0 upon success + */ + Int_t CompareClusters(Bool_t relativedifferences = 1); + /** get Pythia information about tracks in track comparison * @param comparabletrack track to look for pythia information * @return pythiatrack track information from pythia lookup @@ -129,7 +141,7 @@ private: Bool_t GetTrashTrackPythiaInfo(AliHLTTPCTrack* discardedtrack); /** compare information of a cluster not assigned to any track with its Pythia information - * @param discardedcluster pointer to discarded cluster + * @param discarded cluster pointer to discarded cluster * @return 0 upon correct decision (cluster not assigned to any track is true in Pythia, i.e. cluster = noise cluster) * @return 1 upon wrong decision (cluster wrongly discarded, i.e. it belongs to a valuable track according to Pythia) */ @@ -149,7 +161,7 @@ private: */ Int_t ComparePythiaTrackInfo(AliHLTTPCTrackList* firsttracklistelement, AliHLTTPCTrackList* secondtracklistelement); - /** if -graphfile 'filename'.root is given as input parameter, histrograms are created + /** if -graphfile .root is given as input parameter, histrograms are created * @param relativedifferences boolean to decide whether to plot histograms * with relative differences in track paramters (1) or not (0), 1 by default * @return 0 upon success @@ -174,6 +186,10 @@ private: AliHLTTPCTrackList* fFirstTrackList; /** pointer to first element of second track list containing tracks and their pythia information */ AliHLTTPCTrackList* fSecondTrackList; + /** array of original clusters for deviation analysis to secondary clusters */ + AliHLTTPCClusterData* fOriginalClusters[36][6]; + /** array of secondary clusters for deviation analysis to origin clusters */ + AliHLTTPCClusterData* fSecondaryClusters[36][6]; /** number of tracks with pt < 0.1GeV in first array */ Int_t fFirstTrashTracks; /** number of tracks with pt < 0.1GeV in second array */ diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.cxx b/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.cxx index e93b7aa9455..b82ce4e9763 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.cxx @@ -1,19 +1,20 @@ // $Id$ -/************************************************************************** - * TPCCompModelConverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelConverter.cxx @author Timm Steinbeck @@ -35,8 +36,8 @@ using namespace std; AliHLTTPCCompModelConverter::AliHLTTPCCompModelConverter(): fInputTrackArray(), fOutputTrackArray("AliHLTTPCModelTrack"), - fMinHits(0), - fModelAnalysisInstance(NULL) + fModelAnalysisInstance(NULL), + fMinHits(0) { // see header file for class documentation for ( UInt_t slice=0; slice<36; slice++ ) diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.h b/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.h index 6b961080127..1979644fc5b 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelConverter.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELCONVERTER_H #define ALIHLTTPCCOMPMODELCONVERTER_H -/* TPCCompModelConverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelConverterright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelConverter.h @author Timm Steinbeck @@ -23,7 +24,7 @@ * * An implementiation of a copy component that just copies its input data * to debug a components input data - * @ingroup alihlt_tutorial + * @ingroup alihlt_tpc */ class AliHLTTPCCompModelConverter: public AliHLTLogging { diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.cxx b/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.cxx index 9c7dea42823..ba4f50ecb92 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.cxx @@ -1,19 +1,20 @@ // $Id$ -/************************************************************************** - * TPCCompModelConverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelConverterComponent.cxx @author Timm Steinbeck @@ -29,6 +30,12 @@ using namespace std; #include "AliHLTTPCDefinitions.h" //#include "AliHLTTPCCompModelAnalysis.h" #include +/** An implementiation of a converter component that + * takes in clusters and tracks in the standard HLT format + * and converts them into the Vestbo-format + * such that the Vestbo compression can then be + * applied to these tracks and clusters + */ // this is a global object used for automatic component registration, do not use this AliHLTTPCCompModelConverterComponent gAliHLTTPCCompClusterModelConverterComponent; diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.h b/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.h index b32a430bfb0..a6d1c84216c 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelConverterComponent.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELCONVERTERCOMPONENT_H #define ALIHLTTPCCOMPMODELCONVERTERCOMPONENT_H -/* TPCCompModelConverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelConverterright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelConverterComponent.h @author Timm Steinbeck @@ -21,9 +22,12 @@ * @class AliHLTTPCCompModelConverterComponent * @brief A dummy HLT processing component. * - * An implementiation of a copy component that just copies its input data - * to debug a components input data - * @ingroup alihlt_tutorial + * An implementiation of a converter component that + * takes in clusters and tracks in the standard HLT format + * and converts them into the Vestbo-format + * such that the Vestbo compression can then be + * applied to these tracks and clusters + * @ingroup alihlt_tpc */ class AliHLTTPCCompModelConverterComponent : public AliHLTProcessor { @@ -94,14 +98,14 @@ protected: AliHLTUInt32_t& size, vector& outputBlocks ); /** pointer to model converter instance */ - AliHLTTPCCompModelConverter* fConverter; + AliHLTTPCCompModelConverter* fConverter; // pointer to model converter instance /** pointer to model analysis instance */ - AliHLTTPCCompModelAnalysis* fModelAnalysisInstance; + AliHLTTPCCompModelAnalysis* fModelAnalysisInstance; // pointer to model analysis instance /** filename (including path) where to write model analysis results if set by command line argument -dumptofile result-folder/results */ - TString fDumpFileName; + TString fDumpFileName; // filename (including path) /** root file name for graphs from track comparison */ - TString fGraphFileName; + TString fGraphFileName; // root file name for graphs private: /** copy constructor prohibited */ diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.cxx b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.cxx index 7c6b94d1a99..65d256239ae 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.cxx @@ -1,19 +1,20 @@ // $Id$ -/************************************************************************** - * TPCCompModelDeconverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelDeconverter.cxx @author Timm Steinbeck diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.h b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.h index 1a96cc34add..d8b1cf03260 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverter.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELDECONVERTER_H #define ALIHLTTPCCOMPMODELDECONVERTER_H -/* TPCCompModelDeconverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelDeconverterright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelDeconverter.h @author Timm Steinbeck @@ -22,7 +23,7 @@ * * An implementiation of a copy component that just copies its input data * to debug a components input data - * @ingroup alihlt_tutorial + * @ingroup alihlt_tpc */ class AliHLTTPCCompModelDeconverter: public AliHLTLogging { diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.cxx b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.cxx index 663fe1feaff..269300c805e 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.cxx @@ -1,19 +1,20 @@ // $Id$ -/************************************************************************** - * TPCCompModelDeconverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelDeconverterComponent.cxx @author Timm Steinbeck @@ -29,6 +30,14 @@ using namespace std; #include #include +/** + * An implementiation of a deconverter component that + * deconverts the tracks and clusters from the Vestbo-model + * into the standard HLT cluster track format again + * in order to evaluate the loss of the model + * due to the Vestbo-compression + */ + // this is a global object used for automatic component registration, do not use this AliHLTTPCCompModelDeconverterComponent gAliHLTTPCCompClusterModelDeconverterComponent; @@ -84,7 +93,7 @@ int AliHLTTPCCompModelDeconverterComponent::DoInit( int argc, const char** argv { // see header file for class documentation Int_t i = 0; - Char_t* cpErr; + //Char_t* cpErr; while ( i < argc ) { diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.h b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.h index 698a4223c8b..3aa4b18cee9 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeconverterComponent.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELDECONVERTERCOMPONENT_H #define ALIHLTTPCCOMPMODELDECONVERTERCOMPONENT_H -/* TPCCompModelDeconverterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelDeconverterright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelDeconverterComponent.h @author Timm Steinbeck @@ -19,9 +20,12 @@ * @class AliHLTTPCCompModelDeconverterComponent * @brief A dummy HLT processing component. * - * An implementiation of a copy component that just copies its input data - * to debug a components input data - * @ingroup alihlt_tutorial + * An implementiation of a deconverter component that + * deconverts the tracks and clusters from the Vestbo-model + * into the standard HLT cluster track format again + * in order to evaluate the loss of the model + * due to the Vestbo-compression + * @ingroup alihlt_tpc */ class AliHLTTPCCompModelDeconverterComponent : public AliHLTProcessor { @@ -93,9 +97,9 @@ class AliHLTTPCCompModelDeconverterComponent : public AliHLTProcessor AliHLTUInt32_t& size, vector& outputBlocks ); /** member variable for instance of deconverter class */ - AliHLTTPCCompModelDeconverter fDeconverter; + AliHLTTPCCompModelDeconverter fDeconverter; // member variable for instance of deconverter class /** memeber varible for output tracks */ - bool fOutputTracks; + bool fOutputTracks; // memeber varible for output track private: diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.cxx b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.cxx index bd0e9cccc9d..d9d00d31a14 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.cxx @@ -1,19 +1,20 @@ // $Id$ -/************************************************************************** - * TPCCompModelDeflaterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelDeflater.cxx @author Timm Steinbeck @@ -48,6 +49,139 @@ AliHLTTPCCompModelDeflater::~AliHLTTPCCompModelDeflater() // see header file for class documentation } +void AliHLTTPCCompModelDeflater::InitBitDataOutput( AliHLTUInt8_t* output, UInt_t outputSize ) + { + // see header file for class documenation + fBitDataCurrentWord = 0; + fBitDataCurrentPosInWord = 7; + fBitDataCurrentOutput = fBitDataCurrentOutputStart = output; + fBitDataCurrentOutputEnd = output+outputSize; + } + +AliHLTUInt8_t AliHLTTPCCompModelDeflater::GetCurrentOutputByte( Int_t offset ) const + { + // see header file for class documentation + if ( !offset ) + return fBitDataCurrentWord; + else + return *(fBitDataCurrentOutput+offset); + } + +bool AliHLTTPCCompModelDeflater::OutputBit( AliHLTUInt32_t const & value ) + { + // see header file for class documentation + if ( fBitDataCurrentOutput>=fBitDataCurrentOutputEnd ) + return false; + fBitDataCurrentWord |= (value & 1) << fBitDataCurrentPosInWord; + if ( fBitDataCurrentPosInWord ) + fBitDataCurrentPosInWord--; + else + { + *fBitDataCurrentOutput = fBitDataCurrentWord; + fBitDataCurrentPosInWord = 7; + fBitDataCurrentOutput++; + fBitDataCurrentWord = 0; + } + return true; + } + +bool AliHLTTPCCompModelDeflater::OutputBits( AliHLTUInt64_t const & value, UInt_t const & bitCount ) + { + // see header file for class documentation + if ( bitCount>64 ) + { + HLTFatal( "Internal error: Attempt to write more than 64 bits (%u)", (unsigned)bitCount ); + return false; + } + UInt_t bitsToWrite=bitCount; + UInt_t curBitCount; + while ( bitsToWrite>0 ) + { + if ( fBitDataCurrentOutput>=fBitDataCurrentOutputEnd ) + return false; +#if 1 + if ( bitsToWrite >= fBitDataCurrentPosInWord+1 ) + curBitCount = fBitDataCurrentPosInWord+1; + else + curBitCount = bitsToWrite; + fBitDataCurrentWord |= ( (value >> (bitsToWrite-curBitCount)) & ((1<=8 ) + { + curBitCount=8; + curValue = (value >> bitsToWrite-8) & 0xFF; + bitsToWrite -= 8; + } + else + { + curBitCount=bitsToWrite; + curValue = value & ( (1<curBitCount ) + { + fBitDataCurrentWord |= curValue << (fBitDataCurrentPosInWord-curBitCount+1); + fBitDataCurrentPosInWord -= curBitCount; + } + else if ( fBitDataCurrentPosInWord+1==curBitCount ) + { + fBitDataCurrentWord |= curValue; + *fBitDataCurrentOutput = fBitDataCurrentWord; + fBitDataCurrentPosInWord = 7; + fBitDataCurrentOutput++; + fBitDataCurrentWord = 0; + } + else + { + const UInt_t first = fBitDataCurrentPosInWord+1; // Number of bits for first block + const UInt_t second = curBitCount-first; // Number of bits for second block + fBitDataCurrentWord |= ( curValue >> second ) & ((1<=fBitDataCurrentOutputEnd ) + return false; + fBitDataCurrentWord = curValue & ((1<fBitDataCurrentOutputEnd ) + return false; + memcpy( fBitDataCurrentOutput, data, byteCount ); + fBitDataCurrentOutput += byteCount; + return true; + } + int AliHLTTPCCompModelDeflater::CompressTracks( AliHLTUInt8_t* inData, UInt_t const& inputSize, AliHLTUInt8_t* output, UInt_t& outputSize ) { // see header file for class documentation diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.h b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.h index 91a0e9e7cb6..60b349dc986 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflater.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELDEFLATER_H #define ALIHLTTPCCOMPMODELDEFLATER_H -/* TPCCompModelDeflaterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelDeflaterright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelDeflater.h @author Timm Steinbeck @@ -58,19 +59,13 @@ class AliHLTTPCCompModelDeflater: public AliHLTLogging protected: /** member variable to write shape */ - bool fWriteShape; + bool fWriteShape; // member variable to write shape /** function to initialise bit data output * @param output AliHLTUInt8_t* pointer to output data * @param outputSize UInt_t output size */ - void InitBitDataOutput( AliHLTUInt8_t* output, UInt_t outputSize ) - { - fBitDataCurrentWord = 0; - fBitDataCurrentPosInWord = 7; - fBitDataCurrentOutput = fBitDataCurrentOutputStart = output; - fBitDataCurrentOutputEnd = output+outputSize; - } + void InitBitDataOutput( AliHLTUInt8_t* output, UInt_t outputSize ); /** function to close bit data output */ void CloseBitDataOutput() @@ -98,13 +93,7 @@ class AliHLTTPCCompModelDeflater: public AliHLTLogging * @param offset Int_t (set to zero if not specified explicitly) * @return AliHLTUInt8_t value for current output byte */ - AliHLTUInt8_t GetCurrentOutputByte( Int_t offset=0 ) const - { - if ( !offset ) - return fBitDataCurrentWord; - else - return *(fBitDataCurrentOutput+offset); - } + AliHLTUInt8_t GetCurrentOutputByte( Int_t offset=0 ) const; /** function to get bit data output size bytes * @return UInt_t value of bit data output size bytes @@ -118,128 +107,24 @@ class AliHLTTPCCompModelDeflater: public AliHLTLogging * @param value AliHLTUInt32_t const & input * @return boolean (output bit) */ - bool OutputBit( AliHLTUInt32_t const & value ) - { - if ( fBitDataCurrentOutput>=fBitDataCurrentOutputEnd ) - return false; - fBitDataCurrentWord |= (value & 1) << fBitDataCurrentPosInWord; - if ( fBitDataCurrentPosInWord ) - fBitDataCurrentPosInWord--; - else - { - *fBitDataCurrentOutput = fBitDataCurrentWord; - fBitDataCurrentPosInWord = 7; - fBitDataCurrentOutput++; - fBitDataCurrentWord = 0; - } - return true; - } + bool OutputBit( AliHLTUInt32_t const & value ); /** function to output bits * @param value AliHLTUInt64_t const & * @param bitCount UInt_t const & * @return zero upon success */ - bool OutputBits( AliHLTUInt64_t const & value, UInt_t const & bitCount ) - { - if ( bitCount>64 ) - { - HLTFatal( "Internal error: Attempt to write more than 64 bits (%u)", (unsigned)bitCount ); - return false; - } - UInt_t bitsToWrite=bitCount; - UInt_t curBitCount; - while ( bitsToWrite>0 ) - { - if ( fBitDataCurrentOutput>=fBitDataCurrentOutputEnd ) - return false; -#if 1 - if ( bitsToWrite >= fBitDataCurrentPosInWord+1 ) - curBitCount = fBitDataCurrentPosInWord+1; - else - curBitCount = bitsToWrite; - fBitDataCurrentWord |= ( (value >> (bitsToWrite-curBitCount)) & ((1<=8 ) - { - curBitCount=8; - curValue = (value >> bitsToWrite-8) & 0xFF; - bitsToWrite -= 8; - } - else - { - curBitCount=bitsToWrite; - curValue = value & ( (1<curBitCount ) - { - fBitDataCurrentWord |= curValue << (fBitDataCurrentPosInWord-curBitCount+1); - fBitDataCurrentPosInWord -= curBitCount; - } - else if ( fBitDataCurrentPosInWord+1==curBitCount ) - { - fBitDataCurrentWord |= curValue; - *fBitDataCurrentOutput = fBitDataCurrentWord; - fBitDataCurrentPosInWord = 7; - fBitDataCurrentOutput++; - fBitDataCurrentWord = 0; - } - else - { - const UInt_t first = fBitDataCurrentPosInWord+1; // Number of bits for first block - const UInt_t second = curBitCount-first; // Number of bits for second block - fBitDataCurrentWord |= ( curValue >> second ) & ((1<=fBitDataCurrentOutputEnd ) - return false; - fBitDataCurrentWord = curValue & ((1<fBitDataCurrentOutputEnd ) - return false; - memcpy( fBitDataCurrentOutput, data, byteCount ); - fBitDataCurrentOutput += byteCount; - return true; - } - + bool OutputBytes( AliHLTUInt8_t const * data, UInt_t const & byteCount ); private: /** copy constructor prohibited */ AliHLTTPCCompModelDeflater(const AliHLTTPCCompModelDeflater&); @@ -247,15 +132,15 @@ class AliHLTTPCCompModelDeflater: public AliHLTLogging AliHLTTPCCompModelDeflater& operator=(const AliHLTTPCCompModelDeflater&); /** member variable for bit data current word */ - AliHLTUInt8_t fBitDataCurrentWord; + AliHLTUInt8_t fBitDataCurrentWord; // member variable for bit data current word /** member variable for bit data current position in word */ - UInt_t fBitDataCurrentPosInWord; + UInt_t fBitDataCurrentPosInWord; // member variable for bit data current position in word /** member variable for bit data current output */ - AliHLTUInt8_t *fBitDataCurrentOutput; + AliHLTUInt8_t *fBitDataCurrentOutput; // member variable for bit data current output /** member variable for bit data current output start */ - AliHLTUInt8_t *fBitDataCurrentOutputStart; + AliHLTUInt8_t *fBitDataCurrentOutputStart; // member variable for bit data current output start /** member variable for bit data current output end */ - AliHLTUInt8_t *fBitDataCurrentOutputEnd; + AliHLTUInt8_t *fBitDataCurrentOutputEnd; // member variable for bit data current output end ClassDef(AliHLTTPCCompModelDeflater, 0); diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.cxx b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.cxx index 622b09fb976..1c659f2e419 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.cxx @@ -1,19 +1,20 @@ // $Id$ -/************************************************************************** - * TPCCompModelDeflaterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelDeflaterComponent.cxx @author Timm Steinbeck @@ -35,7 +36,9 @@ AliHLTTPCCompModelDeflaterComponent gAliHLTTPCCompClusterModelDeflaterComponent; ClassImp(AliHLTTPCCompModelDeflaterComponent); AliHLTTPCCompModelDeflaterComponent::AliHLTTPCCompModelDeflaterComponent(): - fForwardIfUncompressed(true) + fForwardIfUncompressed(true), + fModelDeflater(), + fConverter() { // see header file for class documentation } diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.h b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.h index 3a79f3c44fc..24f54eae8f5 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelDeflaterComponent.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELDEFLATERCOMPONENT_H #define ALIHLTTPCCOMPMODELDEFLATERCOMPONENT_H -/* TPCCompModelDeflaterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelDeflaterright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelDeflaterComponent.h @author Timm Steinbeck @@ -20,9 +21,12 @@ * @class AliHLTTPCCompModelDeflaterComponent * @brief A dummy HLT processing component. * - * An implementiation of a copy component that just copies its input data - * to debug a components input data - * @ingroup alihlt_tutorial + * An implementiation of a deflater component that + * compresses the data previously converted with the + * converting component. + * + * + * @ingroup alihlt_tpc */ class AliHLTTPCCompModelDeflaterComponent : public AliHLTProcessor { @@ -94,12 +98,12 @@ class AliHLTTPCCompModelDeflaterComponent : public AliHLTProcessor AliHLTUInt32_t& size, vector& outputBlocks ); /** member variable for instance of model deflater class */ - AliHLTTPCCompModelDeflater fModelDeflater; + AliHLTTPCCompModelDeflater fModelDeflater; // member variable for instance of model deflater class /** member variable for instance of model converter class */ - AliHLTTPCCompModelConverter fConverter; + AliHLTTPCCompModelConverter fConverter; // member variable for instance of model converter class /** member variable for forwarding if uncompressed */ - bool fForwardIfUncompressed; + bool fForwardIfUncompressed; // member variable for forwarding if uncompressed private: diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelInflater.cxx b/HLT/TPCLib/comp/AliHLTTPCCompModelInflater.cxx index 1b51fa35447..97322c9dc1f 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelInflater.cxx +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelInflater.cxx @@ -1,24 +1,32 @@ // $Id$ -/************************************************************************** - * TPCCompModelInflaterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Authors: Timm Steinbeck * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelInflater.cxx @author Timm Steinbeck @date - @brief A copy processing component for the HLT. */ + @brief A copy processing component for the HLT. + * + * The model inflater is the counterpart of the deflater component + * which decompresses the data after a conversion and compression. + * The deflater is followed by a deconverter in order to get the + * original standard HLT cluster track format back + * + */ #if __GNUC__ >= 3 using namespace std; @@ -47,6 +55,161 @@ AliHLTTPCCompModelInflater::~AliHLTTPCCompModelInflater() // see header file for class documentation } +void AliHLTTPCCompModelInflater::InitBitDataInput( AliHLTUInt8_t* input, UInt_t inputSize ) + { + // sse header file for class documentation + fBitDataCurrentWord = 0; + fBitDataCurrentPosInWord = 7; + fBitDataCurrentInput = fBitDataCurrentInputStart = input; + fBitDataCurrentInputEnd = input+inputSize; + fBitDataCurrentWord = *fBitDataCurrentInput; + } + +bool AliHLTTPCCompModelInflater::InputBit( AliHLTUInt8_t & value ) + { + // see header file for class documenation + if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd ) + return false; + value = (fBitDataCurrentWord >> fBitDataCurrentPosInWord) & 1; + if ( fBitDataCurrentPosInWord ) + fBitDataCurrentPosInWord--; + else + { + fBitDataCurrentInput++; + if ( fBitDataCurrentInput8 ) + { + HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); + return false; + } + AliHLTUInt64_t temp; + if ( !InputBits( temp, bitCount ) ) + return false; + value = (AliHLTUInt8_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); + return true; + } + +bool AliHLTTPCCompModelInflater::InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount ) + { + // see header file for class documenation + if ( bitCount>16 ) + { + HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); + return false; + } + AliHLTUInt64_t temp; + if ( !InputBits( temp, bitCount ) ) + return false; + value = (AliHLTUInt16_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); + return true; + } + +bool AliHLTTPCCompModelInflater::InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount ) + { + // see header file for class documentation + if ( bitCount>32 ) + { + HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); + return false; + } + AliHLTUInt64_t temp; + if ( !InputBits( temp, bitCount ) ) + return false; + value = (AliHLTUInt32_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); + return true; + } + +bool AliHLTTPCCompModelInflater::InputBits( Int_t & value, UInt_t const & bitCount ) + { + // see header file for class documentation + if ( bitCount>32 ) + { + HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); + return false; + } + AliHLTUInt64_t temp; + if ( !InputBits( temp, bitCount ) ) + return false; + value = (Int_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); + return true; + } + +bool AliHLTTPCCompModelInflater::InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount ) + { + // see header file for class documenation + if ( bitCount>64 ) + { + HLTFatal( "Internal error: Attempt to write more than 64 bits (%u)", (unsigned)bitCount ); + return false; + } + UInt_t bitsToRead=bitCount; + UInt_t curBitCount; + value = 0; + while ( bitsToRead>0 ) + { + if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd ) + return false; + if ( bitsToRead >= fBitDataCurrentPosInWord+1 ) + curBitCount = fBitDataCurrentPosInWord+1; + else + curBitCount = bitsToRead; + value = (value << curBitCount) | ( (fBitDataCurrentWord >> (fBitDataCurrentPosInWord-curBitCount+1)) & ((1 << curBitCount)-1) ); + if ( fBitDataCurrentPosInWord < curBitCount ) + { + fBitDataCurrentInput++; + if ( fBitDataCurrentInputfBitDataCurrentInputEnd ) + return false; + memcpy( data, fBitDataCurrentInput, byteCount ); + fBitDataCurrentInput += byteCount; + if ( fBitDataCurrentInput=fBitDataCurrentInputEnd ) - return false; - value = (fBitDataCurrentWord >> fBitDataCurrentPosInWord) & 1; - if ( fBitDataCurrentPosInWord ) - fBitDataCurrentPosInWord--; - else - { - fBitDataCurrentInput++; - if ( fBitDataCurrentInput8 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (AliHLTUInt8_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( AliHLTUInt8_t & value, UInt_t const & bitCount ); /** function to determine input bits between 8 and 16 bits * @param value AliHLTUInt16_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount ) - { - if ( bitCount>16 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (AliHLTUInt16_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount ); /** function to determine input bits between 16 and 32 bits * @param value AliHLTUInt32_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount ) - { - if ( bitCount>32 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (AliHLTUInt32_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount ); /** function to determine input bits between 16 and 32 bits * @param value Int_t_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( Int_t & value, UInt_t const & bitCount ) - { - if ( bitCount>32 ) - { - HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount ); - return false; - } - AliHLTUInt64_t temp; - if ( !InputBits( temp, bitCount ) ) - return false; - value = (Int_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL ); - return true; - } + bool InputBits( Int_t & value, UInt_t const & bitCount ); /** function to determine input bits between 32 and 64 bits * @param value AliHLTUInt64_t & * @param bitCount UInt_t const & * @return boolean */ - bool InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount ) - { - if ( bitCount>64 ) - { - HLTFatal( "Internal error: Attempt to write more than 64 bits (%u)", (unsigned)bitCount ); - return false; - } - UInt_t bitsToRead=bitCount; - UInt_t curBitCount; - value = 0; - while ( bitsToRead>0 ) - { - if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd ) - return false; - if ( bitsToRead >= fBitDataCurrentPosInWord+1 ) - curBitCount = fBitDataCurrentPosInWord+1; - else - curBitCount = bitsToRead; - value = (value << curBitCount) | ( (fBitDataCurrentWord >> (fBitDataCurrentPosInWord-curBitCount+1)) & ((1 << curBitCount)-1) ); - if ( fBitDataCurrentPosInWord < curBitCount ) - { - fBitDataCurrentInput++; - if ( fBitDataCurrentInputfBitDataCurrentInputEnd ) - return false; - memcpy( data, fBitDataCurrentInput, byteCount ); - fBitDataCurrentInput += byteCount; - if ( fBitDataCurrentInput * - * for The ALICE Off-line Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Timm Steinbeck * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCCompModelInflaterComponent.cxx @author Timm Steinbeck diff --git a/HLT/TPCLib/comp/AliHLTTPCCompModelInflaterComponent.h b/HLT/TPCLib/comp/AliHLTTPCCompModelInflaterComponent.h index bbba0af9b84..820c9f581aa 100644 --- a/HLT/TPCLib/comp/AliHLTTPCCompModelInflaterComponent.h +++ b/HLT/TPCLib/comp/AliHLTTPCCompModelInflaterComponent.h @@ -3,8 +3,9 @@ #ifndef ALIHLTTPCCOMPMODELINFLATERCOMPONENT_H #define ALIHLTTPCCOMPMODELINFLATERCOMPONENT_H -/* TPCCompModelInflaterright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full TPCCompModelInflaterright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTTPCCompModelInflaterComponent.h @author Timm Steinbeck @@ -20,9 +21,12 @@ * @class AliHLTTPCCompModelInflaterComponent * @brief A dummy HLT processing component. * - * An implementiation of a copy component that just copies its input data - * to debug a components input data - * @ingroup alihlt_tutorial + * An implementiation of an inflater component + * to process the inflation after the + * Vestbo compression which is then followed by the + * deconversion component to retrieve the original + * standard cluster track format of the input data + * @ingroup alihlt_tpc */ class AliHLTTPCCompModelInflaterComponent : public AliHLTProcessor { @@ -94,7 +98,7 @@ class AliHLTTPCCompModelInflaterComponent : public AliHLTProcessor AliHLTUInt32_t& size, vector& outputBlocks ); /** member variable for instance of model inflater class */ - AliHLTTPCCompModelInflater fModelInflater; + AliHLTTPCCompModelInflater fModelInflater; // member variable for instance of model inflater class private: -- 2.43.0