Line data Source code
1 : #ifndef ALIHLTTPCDATACOMPRESSIONIDMAP_H
2 : #define ALIHLTTPCDATACOMPRESSIONIDMAP_H
3 :
4 : //* This file is property of and copyright by the ALICE HLT Project *
5 : //* ALICE Experiment at CERN, All rights reserved. *
6 : //* See cxx source for full Copyright notice *
7 :
8 : // @file AliHLTTPCDataCompressionIDMap.h
9 : // @author Sergey Gorbunov
10 : // @date 2013-14-05
11 : // @brief Map HLT cluster ID to offline index (sector,row,number) after HLT compression
12 :
13 :
14 : #include "AliHLTDataTypes.h"
15 : #include "AliHLTLogging.h"
16 : #include <vector>
17 :
18 : class AliHLTComponentBlockData;
19 :
20 : class AliHLTTPCDataCompressionIDMap: public AliHLTLogging{
21 :
22 : public:
23 : AliHLTTPCDataCompressionIDMap();
24 : ~AliHLTTPCDataCompressionIDMap();
25 :
26 :
27 : void StartFilling();
28 : void SetClusterBlock( const AliHLTComponentBlockData* clusters );
29 : void FillHLTID( AliHLTUInt32_t hltID );
30 : void EndFilling();
31 :
32 : Int_t GetNumberOfIDs(){
33 0 : return fPatchFirstID[fkNPatchesTotal];
34 : }
35 :
36 : Bool_t GetOfflineID( AliHLTUInt32_t hltID, Int_t §or, Int_t &row, UInt_t &ind );
37 : Bool_t GetOfflineID( AliHLTUInt32_t hltID, AliHLTUInt32_t &offlineID);
38 :
39 : void SetIDMap( const AliHLTUInt8_t *data, AliHLTUInt32_t sizeBytes );
40 : int WriteIDMap( AliHLTUInt8_t* output, AliHLTUInt32_t& sizeBytes );
41 :
42 : // Must be public for dictionary
43 : struct AliIDMapEntry{
44 : AliHLTUInt32_t fHltID; // HLT ID of a cluster
45 : AliHLTUInt32_t fOfflineID; // offline ID of a cluster
46 : };
47 : private:
48 :
49 0 : static Bool_t CompareIDs( const AliIDMapEntry &a, const AliIDMapEntry &b ){ return a.fHltID < b.fHltID; }
50 :
51 : AliHLTTPCDataCompressionIDMap(const AliHLTTPCDataCompressionIDMap& src);
52 : AliHLTTPCDataCompressionIDMap& operator=(const AliHLTTPCDataCompressionIDMap& src);
53 :
54 : void SetPatchIndices( UInt_t nIDs );
55 :
56 : static const UInt_t fkNSlices; // !transient
57 : static const UInt_t fkNPatches; // !transient
58 : static const UInt_t fkNPatchesTotal; // NSlices*NPatches
59 :
60 : const AliHLTComponentBlockData **fPatchClusterBlocks; // pointers to data blocks (needed to read row numbers of HLT clusters)
61 : std::vector< AliIDMapEntry > *fInternalMemory; // memory block to fill IDs
62 :
63 :
64 : const AliIDMapEntry *fIDMap; // pointer to ID map; can point to fInternalMemory or to external memory block
65 : AliHLTUInt32_t *fPatchFirstID; // index of the first ID of a patch in the IDMap [size of fkNPatches+1]
66 : Bool_t *fPatchAllHltIDsPresent; // are all the HLT IDs of the patch present in the map [size of fkNPatches]
67 :
68 : };
69 :
70 :
71 : #endif
|