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();
40 virtual bool Check(AliHLTUInt32_t clusterID) const;
41 virtual int GetClusterIDs(vector<AliHLTUInt32_t>& tgt) const;
42 virtual const vector<AliHLTUInt32_t>* GetClusterIDs(AliHLTUInt32_t mask);
43 virtual float GetX(AliHLTUInt32_t clusterID) const;
44 virtual float GetXWidth(AliHLTUInt32_t clusterID) const;
45 virtual float GetY(AliHLTUInt32_t clusterID) const;
46 virtual float GetYWidth(AliHLTUInt32_t clusterID) const;
47 virtual float GetZ(AliHLTUInt32_t clusterID) const;
48 virtual float GetZWidth(AliHLTUInt32_t clusterID) const;
49 virtual float GetCharge(AliHLTUInt32_t clusterID) const;
50 virtual float GetPhi(AliHLTUInt32_t clusterID) const;
52 /// add input block to the collection
53 virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc);
55 virtual int PopulateAccessGrid(AliHLTSpacePointPropertyGrid* pGrid, AliHLTUInt32_t mask) const;
56 int PopulateAccessGrid(AliHLTSpacePointPropertyGrid* pGrid, AliHLTTPCHWCFData* pDecoder, int slice, int partition) const;
57 virtual const AliHLTSpacePointPropertyGrid* GetSpacePointPropertyGrid(AliHLTUInt32_t mask) const;
58 virtual int SetSpacePointPropertyGrid(AliHLTUInt32_t mask, AliHLTSpacePointPropertyGrid*);
60 /// clear the object and reset pointer references
61 virtual void Clear(Option_t * option ="");
64 virtual void Print(ostream& out, Option_t *option="") const;
66 /// create a collection of clusters for a space point mask
67 virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const;
69 /// create a collection of clusters for a specific track
70 virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const;
72 /// create a collection of clusters for a specific MC track
73 virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const;
75 /// create a collection of all used clusters
76 virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const;
78 /// create a collection of all unused clusters
79 virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const;
81 virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize);
82 virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize);
83 virtual int GetTrackID(AliHLTUInt32_t clusterID) const;
84 virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize);
86 virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size,
87 vector<AliHLTComponentBlockData>& outputBlocks,
88 AliHLTDataDeflater* pDeflater,
89 const char* option="") const;
90 virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
91 vector<AliHLTComponentBlockData>& outputBlocks,
92 AliHLTDataDeflater* pDeflater,
93 const char* option="") const;
95 int WriteUnsorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
96 vector<AliHLTComponentBlockData>& outputBlocks,
97 AliHLTDataDeflater* pDeflater,
98 const char* option="") const;
100 int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
101 vector<AliHLTComponentBlockData>& outputBlocks,
102 AliHLTDataDeflater* pDeflater,
103 const char* option="") const;
105 int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
106 AliHLTTPCHWCFData* pDecoder, AliHLTSpacePointPropertyGrid* pGrid,
108 vector<AliHLTComponentBlockData>& outputBlocks,
109 AliHLTDataDeflater* pDeflater,
110 const char* option) const;
112 /// allocate index grid, one single point to define the dimensions
113 static AliHLTSpacePointPropertyGrid* AllocateIndexGrid();
115 class AliHLTTPCHWCFSpacePointProperties {
117 AliHLTTPCHWCFSpacePointProperties();
118 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFData* pDecoder, int index);
119 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFSpacePointProperties& src);
120 AliHLTTPCHWCFSpacePointProperties& operator=(const AliHLTTPCHWCFSpacePointProperties& src);
122 ~AliHLTTPCHWCFSpacePointProperties() {}
124 const AliHLTTPCHWCFData* Decoder() const {return fDecoder;}
125 int GetSpacepointIndex() const {return fIndex;}
126 bool IsUsed() const {return fUsed;}
127 void MarkUsed(bool used=true) {fUsed=used;}
128 int GetTrackId() const {return fTrackId;}
129 void SetTrackId(int trackId) {fTrackId=trackId;}
130 int GetMCId() const {return fMCId;}
131 void SetMCId(int mcId) {fMCId=mcId;}
133 void Print(ostream& out, Option_t *option="") const;
136 const AliHLTTPCHWCFData* fDecoder; //! decoder for data block
137 int fIndex; //! index within the decoder block
138 bool fUsed; //! transient
139 int fTrackId; //! track id from reconstruction
143 class AliHLTTPCHWCFSpacePointBlock {
145 AliHLTTPCHWCFSpacePointBlock(AliHLTUInt32_t id=0, AliHLTTPCHWCFData* pDecoder=NULL, AliHLTSpacePointPropertyGrid* pGrid=NULL)
146 : fDecoder(pDecoder), fGrid(pGrid), fId(id) {}
147 AliHLTTPCHWCFSpacePointBlock(const AliHLTTPCHWCFSpacePointBlock& s)
148 : fDecoder(s.fDecoder), fGrid(s.fGrid), fId(s.fId) {}
149 AliHLTTPCHWCFSpacePointBlock& operator=(const AliHLTTPCHWCFSpacePointBlock& s)
150 { fDecoder=s.fDecoder; fGrid=s.fGrid; fId=s.fId; return *this;}
151 ~AliHLTTPCHWCFSpacePointBlock() {}
153 int GetNofSpacepoints() const {return fDecoder?fDecoder->GetNumberOfClusters():0;}
154 AliHLTUInt32_t GetId() const {return fId;}
155 void SetId(AliHLTUInt32_t id) {fId=id;}
156 AliHLTTPCHWCFData* GetDecoder() const {return fDecoder;}
157 void SetDecoder(AliHLTTPCHWCFData* pDecoder) {fDecoder=pDecoder;}
158 AliHLTSpacePointPropertyGrid* GetGrid() const {return fGrid;}
159 void SetGrid(AliHLTSpacePointPropertyGrid* pGrid) {fGrid=pGrid;}
163 AliHLTTPCHWCFData* fDecoder; //!
164 AliHLTSpacePointPropertyGrid* fGrid; //!
165 AliHLTUInt32_t fId; //!
172 std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointProperties> fClusters; //!
174 /// map of cluster id collection for different masks
175 std::map<AliHLTUInt32_t, vector<AliHLTUInt32_t>*> fSelections; //!
177 /// array of decoders
178 std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointBlock> fBlocks; //!
180 /// the one instance for mode single (=1)
181 AliHLTTPCHWCFSpacePointBlock fSingleBlock;
186 ClassDef(AliHLTTPCHWCFSpacePointContainer, 0)
189 ostream& operator<<(ostream &out, const AliHLTTPCHWCFSpacePointContainer::AliHLTTPCHWCFSpacePointProperties& p);