3 #ifndef ALIHLTTPCHWCFSPACEPOINTCONTAINER_H
4 #define ALIHLTTPCHWCFSPACEPOINTCONTAINER_H
5 //* This file is property of and copyright by the ALICE HLT Project *
6 //* ALICE Experiment at CERN, All rights reserved. *
7 //* See cxx source for full Copyright notice *
9 /// @file AliHLTTPCHWCFSpacePointContainer.h
10 /// @author Matthias Richter
12 /// @brief Helper class for handling of HLT TPC cluster data blocks from the
14 /// @note Class is a duplicate of AliHLTTPCHWCFSpacePointContainer and should
15 /// be merged with it in a generic way
17 #include "AliHLTSpacePointContainer.h"
18 #include "AliHLTTPCHWCFData.h"
23 * @class AliHLTTPCHWCFSpacePointContainer
24 * Handler class for HLT TPC hardware ClusterFinder space point data blocks.
28 class AliHLTTPCHWCFSpacePointContainer : public AliHLTSpacePointContainer
31 /// standard constructor
32 AliHLTTPCHWCFSpacePointContainer(int mode=0);
34 AliHLTTPCHWCFSpacePointContainer(const AliHLTTPCHWCFSpacePointContainer& c);
35 /// assignment operator
36 AliHLTTPCHWCFSpacePointContainer& operator=(const AliHLTTPCHWCFSpacePointContainer& c);
38 ~AliHLTTPCHWCFSpacePointContainer();
45 virtual bool Check(AliHLTUInt32_t clusterID) const;
46 virtual int GetClusterIDs(vector<AliHLTUInt32_t>& tgt) const;
47 virtual const vector<AliHLTUInt32_t>* GetClusterIDs(AliHLTUInt32_t mask);
48 virtual float GetX(AliHLTUInt32_t clusterID) const;
49 virtual float GetXWidth(AliHLTUInt32_t clusterID) const;
50 virtual float GetY(AliHLTUInt32_t clusterID) const;
51 virtual float GetYWidth(AliHLTUInt32_t clusterID) const;
52 virtual float GetZ(AliHLTUInt32_t clusterID) const;
53 virtual float GetZWidth(AliHLTUInt32_t clusterID) const;
54 virtual float GetCharge(AliHLTUInt32_t clusterID) const;
55 virtual float GetQMax(AliHLTUInt32_t clusterID) const;
56 virtual float GetPhi(AliHLTUInt32_t clusterID) const;
58 /// add input block to the collection
59 virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc);
61 virtual int PopulateAccessGrid(AliHLTSpacePointPropertyGrid* pGrid, AliHLTUInt32_t mask) const;
62 int PopulateAccessGrid(AliHLTSpacePointPropertyGrid* pGrid, AliHLTTPCHWCFData* pDecoder, int slice, int partition) const;
63 virtual const AliHLTSpacePointPropertyGrid* GetSpacePointPropertyGrid(AliHLTUInt32_t mask) const;
64 virtual int SetSpacePointPropertyGrid(AliHLTUInt32_t mask, AliHLTSpacePointPropertyGrid*);
66 /// clear the object and reset pointer references
67 virtual void Clear(Option_t * option ="");
70 virtual void Print(ostream& out, Option_t *option="") const;
72 /// create a collection of clusters for a space point mask
73 virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const;
75 /// create a collection of clusters for a specific track
76 virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const;
78 /// create a collection of clusters for a specific MC track
79 virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const;
81 /// create a collection of all used clusters
82 virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const;
84 /// create a collection of all unused clusters
85 virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const;
87 virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize);
88 virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize);
89 virtual int GetTrackID(AliHLTUInt32_t clusterID) const;
90 virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize);
92 virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size,
93 vector<AliHLTComponentBlockData>& outputBlocks,
94 AliHLTDataDeflater* pDeflater,
95 const char* option="") const;
96 virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
97 vector<AliHLTComponentBlockData>& outputBlocks,
98 AliHLTDataDeflater* pDeflater,
99 const char* option="") const;
101 int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
102 vector<AliHLTComponentBlockData>& outputBlocks,
103 AliHLTDataDeflater* pDeflater,
104 const char* option="") const;
106 int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
107 AliHLTTPCHWCFData* pDecoder, AliHLTSpacePointPropertyGrid* pGrid,
109 vector<AliHLTComponentBlockData>& outputBlocks,
110 AliHLTDataDeflater* pDeflater,
111 const char* option) const;
113 /// allocate index grid, one single point to define the dimensions
114 static AliHLTSpacePointPropertyGrid* AllocateIndexGrid();
116 class AliHLTTPCHWCFSpacePointProperties {
118 AliHLTTPCHWCFSpacePointProperties();
119 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFData* pDecoder, int index);
120 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFSpacePointProperties& src);
121 AliHLTTPCHWCFSpacePointProperties& operator=(const AliHLTTPCHWCFSpacePointProperties& src);
123 ~AliHLTTPCHWCFSpacePointProperties() {}
125 const AliHLTTPCHWCFData* Decoder() const {return fDecoder;}
126 int GetSpacepointIndex() const {return fIndex;}
127 bool IsUsed() const {return fUsed;}
128 void MarkUsed(bool used=true) {fUsed=used;}
129 int GetTrackId() const {return fTrackId;}
130 void SetTrackId(int trackId) {fTrackId=trackId;}
131 int GetMCId() const {return fMCId;}
132 void SetMCId(int mcId) {fMCId=mcId;}
134 void Print(ostream& out, Option_t *option="") const;
137 const AliHLTTPCHWCFData* fDecoder; //! decoder for data block
138 int fIndex; //! index within the decoder block
139 bool fUsed; //! transient
140 int fTrackId; //! track id from reconstruction
144 class AliHLTTPCHWCFSpacePointBlock {
146 AliHLTTPCHWCFSpacePointBlock(AliHLTUInt32_t id=0, AliHLTTPCHWCFData* pDecoder=NULL, AliHLTSpacePointPropertyGrid* pGrid=NULL)
147 : fDecoder(pDecoder), fGrid(pGrid), fId(id) {}
148 AliHLTTPCHWCFSpacePointBlock(const AliHLTTPCHWCFSpacePointBlock& s)
149 : fDecoder(s.fDecoder), fGrid(s.fGrid), fId(s.fId) {}
150 AliHLTTPCHWCFSpacePointBlock& operator=(const AliHLTTPCHWCFSpacePointBlock& s)
151 { fDecoder=s.fDecoder; fGrid=s.fGrid; fId=s.fId; return *this;}
152 ~AliHLTTPCHWCFSpacePointBlock() {}
154 int GetNofSpacepoints() const {return fDecoder?fDecoder->GetNumberOfClusters():0;}
155 AliHLTUInt32_t GetId() const {return fId;}
156 void SetId(AliHLTUInt32_t id) {fId=id;}
157 AliHLTTPCHWCFData* GetDecoder() const {return fDecoder;}
158 void SetDecoder(AliHLTTPCHWCFData* pDecoder) {fDecoder=pDecoder;}
159 AliHLTSpacePointPropertyGrid* GetGrid() const {return fGrid;}
160 void SetGrid(AliHLTSpacePointPropertyGrid* pGrid) {fGrid=pGrid;}
164 AliHLTTPCHWCFData* fDecoder; //!
165 AliHLTSpacePointPropertyGrid* fGrid; //!
166 AliHLTUInt32_t fId; //!
173 std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointProperties> fClusters; //!
175 /// map of cluster id collection for different masks
176 std::map<AliHLTUInt32_t, vector<AliHLTUInt32_t>*> fSelections; //!
178 /// array of decoders
179 std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointBlock> fBlocks; //!
181 /// the one instance for mode single (=1)
182 AliHLTTPCHWCFSpacePointBlock fSingleBlock;
187 ClassDef(AliHLTTPCHWCFSpacePointContainer, 0)
190 ostream& operator<<(ostream &out, const AliHLTTPCHWCFSpacePointContainer::AliHLTTPCHWCFSpacePointProperties& p);