The block is then read by DataCompressionComponent which sets corresponding "merged clusters" flag for the compressed clusters.
decoder.Clear();
decoder.SetVerbosity(fVerbosity);
+ bool bHavePartitionRawData=false;
+ bool bHavePartitionCompressedData=false;
+
bool bNextBlock=false;
// add cluster id and mc information data blocks
for (bNextBlock=(pHLTOUT->SelectFirstDataBlock()>=0);
if ((iResult=decoder.AddCompressionDescriptor(&desc))<0) {
return iResult;
}
+ bHavePartitionCompressedData = kTRUE;
+ }
+ if (desc.fDataType==AliHLTTPCDefinitions::RawClustersDescriptorDataType()) {
+ // header
+ if ((iResult=decoder.AddRawClustersDescriptor(&desc))<0) {
+ return iResult;
+ }
+ bHavePartitionRawData = kTRUE;
}
if (desc.fDataType==AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo()) {
// add mc information
}
}
- bool bHavePartitionRawData=false;
- bool bHavePartitionCompressedData=false;
vector<bool> bHavePartitionData(216, false);
// read data
decoder.Clear();
decoder.SetVerbosity(GetVerbosity());
+ bool bHavePartitionRawData=false;
+ bool bHavePartitionCompressedData=false;
+
bool bNextBlock=false;
// add cluster id and mc information data blocks
for (bNextBlock=(pHLTOUT->SelectFirstDataBlock()>=0);
continue;
}
if (desc.fDataType==AliHLTTPCDefinitions::DataCompressionDescriptorDataType()) {
- // header
+ // compression header
if ((iResult=decoder.AddCompressionDescriptor(&desc))<0) {
return iResult;
}
+ bHavePartitionCompressedData = true;
+ }
+ if (desc.fDataType==AliHLTTPCDefinitions::RawClustersDescriptorDataType()) {
+ // raw clusters header
+ if ((iResult=decoder.AddRawClustersDescriptor(&desc))<0) {
+ return iResult;
+ }
+ bHavePartitionRawData = true;
}
if (desc.fDataType==AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo()) {
// add mc information
}
}
- bool bHavePartitionRawData=false;
- bool bHavePartitionCompressedData=false;
vector<bool> bHavePartitionData(216, false);
// read data
const AliHLTComponentDataType AliHLTTPCDefinitions::fgkUnpackedRawDataType = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC);
const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC);
const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRawClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC);
+const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRawClustersDescriptorDataType = AliHLTComponentDataTypeInitializer("CLRAWDSC", kAliHLTDataOriginTPC);
const AliHLTComponentDataType AliHLTTPCDefinitions::fgkHWClustersDataType = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC);
const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAlterClustersDataType = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC);
const AliHLTComponentDataType AliHLTTPCDefinitions::fgkVertexDataType = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC);
static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC);
return dt;
}
+const AliHLTComponentDataType& AliHLTTPCDefinitions::RawClustersDescriptorDataType() {
+ static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLRAWDSC", kAliHLTDataOriginTPC);
+ return dt;
+}
const AliHLTComponentDataType& AliHLTTPCDefinitions::HWClustersDataType() {
static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC);
return dt;
/** raw cluster data (not transformed) */
static const AliHLTComponentDataType fgkRawClustersDataType; // see above
static const AliHLTComponentDataType& RawClustersDataType();
+ /** raw cluster data descriptor*/
+ static const AliHLTComponentDataType fgkRawClustersDescriptorDataType; // see above
+ static const AliHLTComponentDataType& RawClustersDescriptorDataType();
/** HW cluster data */
static const AliHLTComponentDataType fgkHWClustersDataType; // see above
static const AliHLTComponentDataType& HWClustersDataType();
#include "AliHLTTPCHWCFEmulator.h"
#include "AliHLTTPCHWCFData.h"
#include "AliHLTErrorGuard.h"
+#include "AliHLTTPCRawClustersDescriptor.h"
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
tgtList.clear();
tgtList.push_back( AliHLTTPCDefinitions::fgkRawClustersDataType | kAliHLTDataOriginTPC );
+ tgtList.push_back( AliHLTTPCDefinitions::RawClustersDescriptorDataType() );
tgtList.push_back( AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo | kAliHLTDataOriginTPC );
return tgtList.size();
}
AliHLTUInt8_t* origOutputPtr = outputPtr;
UInt_t origOutputBlocksSize = outputBlocks.size();
+ bool isInputPresent = kFALSE;
+
for( unsigned long ndx=0; ndx<evtData.fBlockCnt; ndx++ ){
const AliHLTComponentBlockData *iter = blocks+ndx;
}
if( iter->fDataType == (AliHLTTPCDefinitions::fgkHWClustersDataType | kAliHLTDataOriginTPC) ){
-
- UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(*iter);
- UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(*iter);
-
- fBenchmark.SetName(Form("HWClusterTransform slice %d patch %d",minSlice,minPartition));
- HLTDebug("minSlice: %d, minPartition: %d", minSlice, minPartition);
+
+ isInputPresent = 1;
+
+ HLTDebug("minSlice: %d, minPartition: %d", AliHLTTPCDefinitions::GetMinSliceNr(*iter), AliHLTTPCDefinitions::GetMinPatchNr(*iter));
long maxRawClusters = ((long)maxOutSize-size-sizeof(AliHLTTPCRawClusterData))/sizeof(AliHLTTPCRawCluster);
} // end of loop over data blocks
+ AliHLTTPCRawClustersDescriptor desc;
+ desc.SetMergedClustersFlag(0);
+
if( fDoMerge && fpClusterMerger ){
fpClusterMerger->Clear();
fpClusterMerger->SetDataPointer(origOutputPtr);
}
int nMerged = fpClusterMerger->Merge();
fpClusterMerger->Clear();
+ desc.SetMergedClustersFlag(1);
HLTInfo("Merged %d clusters",nMerged);
}
-
+
+ // Write header block
+ if( isInputPresent ){
+ AliHLTComponent_BlockData bd;
+ FillBlockData(bd);
+ bd.fOffset = size;
+ bd.fSize = sizeof(AliHLTTPCRawClustersDescriptor);
+ bd.fDataType = AliHLTTPCDefinitions::RawClustersDescriptorDataType();
+ if( maxOutSize < size + bd.fSize ){
+ HLTWarning( "Output buffer (%db) is too small, required %db", maxOutSize, size+bd.fSize);
+ iResult = -ENOSPC;
+ return iResult;
+ }
+ *(AliHLTTPCRawClustersDescriptor*)(outputPtr ) = desc;
+ outputBlocks.push_back(bd);
+ size += bd.fSize;
+ outputPtr += bd.fSize;
+ fBenchmark.AddOutput(bd.fSize);
+ HLTBenchmark("header data block of size %d", bd.fSize);
+ }
fBenchmark.Stop(0);
HLTInfo(fBenchmark.GetStatistics());
--- /dev/null
+#ifndef ALIHLTTPCRAWCLUSTERSDESCRIPTOR_H
+#define ALIHLTTPCRAWCLUSTERSDESCRIPTOR_H
+
+#include "Rtypes.h"
+
+/**
+ * @struct AliHLTTPCRawClustersDescriptor
+ * The class describes properties of the raw clusters
+ * @ingroup alihlt_tpc_datastructs
+ */
+class AliHLTTPCRawClustersDescriptor
+{
+ public:
+
+ AliHLTTPCRawClustersDescriptor(): fVersion(0), fMergedClustersFlag(1){}
+ ~AliHLTTPCRawClustersDescriptor(){}
+ AliHLTTPCRawClustersDescriptor(const AliHLTTPCRawClustersDescriptor& other)
+ : fVersion(other.fVersion)
+ , fMergedClustersFlag(other.fMergedClustersFlag)
+ {}
+
+ AliHLTTPCRawClustersDescriptor& operator=(const AliHLTTPCRawClustersDescriptor& other){
+ if( &other == this ) return *this;
+ fVersion = other.fVersion;
+ fMergedClustersFlag = other.fMergedClustersFlag;
+ return *this;
+ }
+
+ Bool_t CheckSize( UInt_t size ) const {
+ if( size<sizeof(UInt_t) ) return 0;
+ if( fVersion==0 ) return ( size==sizeof(AliHLTTPCRawClustersDescriptor));
+ return 0;
+ }
+
+ UInt_t GetVersion() const { return fVersion; }
+ Int_t GetMergedClustersFlag() const { return fMergedClustersFlag; }
+
+ void SetMergedClustersFlag( Int_t flag ){ fMergedClustersFlag=flag; }
+
+ private:
+
+ UInt_t fVersion; // version number
+ Int_t fMergedClustersFlag; // flag tells if the clusters were merged at the branch borders
+};
+
+#endif
#include "AliHLTTPCDataCompressionComponent.h"
#include "AliHLTTPCDefinitions.h"
#include "AliHLTTPCDataCompressionDescriptor.h"
+#include "AliHLTTPCRawClustersDescriptor.h"
#include "AliHLTTPCTrackGeometry.h"
#include "AliHLTTPCSpacePointContainer.h"
#include "AliHLTTPCRawSpacePointContainer.h"
/// inherited from AliHLTComponent: list of data types in the vector reference
tgtList.clear();
tgtList.push_back(AliHLTTPCDefinitions::RawClustersDataType());
+ tgtList.push_back(AliHLTTPCDefinitions::RawClustersDescriptorDataType());
tgtList.push_back(AliHLTTPCDefinitions::ClustersDataType());
tgtList.push_back(kAliHLTDataTypeTrack|kAliHLTDataOriginTPC);
}
fRawInputClusters->Clear();
// Write header block
+
if( isInputPresent ){
- AliHLTComponent_BlockData bd;
- FillBlockData(bd);
- bd.fOffset = size;
- bd.fSize = sizeof(AliHLTTPCDataCompressionDescriptor);
- bd.fDataType = AliHLTTPCDefinitions::DataCompressionDescriptorDataType();
- if( capacity < size + bd.fSize ){
- iResult = -ENOMEM;
- return iResult;
- }
- AliHLTTPCDataCompressionDescriptor desc;
- desc.SetMergedClustersFlag(1);
- *(AliHLTTPCDataCompressionDescriptor*)(outputPtr + bd.fOffset ) = desc;
- outputBlocks.push_back(bd);
- size += bd.fSize;
- outputDataSize+=bd.fSize;
- HLTBenchmark("header data block of size %d", bd.fSize);
+ pDesc=GetFirstInputBlock(AliHLTTPCDefinitions::RawClustersDescriptorDataType() );
+ if( pDesc ){
+ const AliHLTTPCRawClustersDescriptor &clDesc = *reinterpret_cast<const AliHLTTPCRawClustersDescriptor*>(pDesc->fPtr);
+ if( !clDesc.CheckSize( pDesc->fSize ) ){
+ HLTError("Corrupted cluster descriptor");
+ }
+
+ AliHLTComponent_BlockData bd;
+ FillBlockData(bd);
+ bd.fOffset = size;
+ bd.fSize = sizeof(AliHLTTPCDataCompressionDescriptor);
+ bd.fDataType = AliHLTTPCDefinitions::DataCompressionDescriptorDataType();
+ if( capacity < size + bd.fSize ){
+ iResult = -ENOSPC;
+ return iResult;
+ }
+
+ AliHLTTPCDataCompressionDescriptor &compDesc = *(AliHLTTPCDataCompressionDescriptor*)(outputPtr + bd.fOffset );
+ compDesc.SetMergedClustersFlag( clDesc.GetMergedClustersFlag() );
+
+ outputBlocks.push_back(bd);
+ size += bd.fSize;
+ outputDataSize+=bd.fSize;
+ //HLTBenchmark("header data block of size %d", bd.fSize);
+ }
}
float compressionFactor=(float)inputRawClusterSize;
#include "AliHLTTPCDataCompressionDecoder.h"
#include "AliHLTTPCDataCompressionDescriptor.h"
+#include "AliHLTTPCRawClustersDescriptor.h"
#include "AliHLTDataInflaterSimple.h"
#include "AliHLTDataInflaterHuffman.h"
#include "TList.h"
return 0;
}
+int AliHLTTPCDataCompressionDecoder::AddRawClustersDescriptor(const AliHLTComponentBlockData* pDesc)
+{
+ /// read descriptor
+ if (!pDesc) return -EINVAL;
+ if (pDesc->fDataType!=AliHLTTPCDefinitions::RawClustersDescriptorDataType()) return -ENODATA;
+ const AliHLTTPCRawClustersDescriptor* pHeader=reinterpret_cast<const AliHLTTPCRawClustersDescriptor*>(pDesc->fPtr);
+ if (! pHeader->CheckSize( pDesc->fSize ) ) return -EINVAL;
+ if( pHeader->GetMergedClustersFlag() == 0 ){
+ fUseClusterMerger = kTRUE;
+ } else if( pHeader->GetMergedClustersFlag() == 1 ){
+ fUseClusterMerger = kFALSE;
+ } else return -EINVAL;
+ return 0;
+}
+
int AliHLTTPCDataCompressionDecoder::AddClusterMCData(const AliHLTComponentBlockData* pDesc)
{
/// add cluster mc data block
int InitPartitionClusterDecoding(AliHLTUInt32_t specification);
int InitTrackModelClusterClusterDecoding();
int AddCompressionDescriptor(const AliHLTComponentBlockData* pDesc);
+ int AddRawClustersDescriptor(const AliHLTComponentBlockData* pDesc);
int AddClusterMCData(const AliHLTComponentBlockData* pDesc);
int AddClusterIds(const AliHLTComponentBlockData* pDesc);
AliHLTUInt32_t GetClusterId(int clusterNo) const;