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(AliHLTSpacePointGrid* pGrid, AliHLTUInt32_t mask) const;
56 int PopulateAccessGrid(AliHLTSpacePointGrid* pGrid, AliHLTTPCHWCFData* pDecoder, int slice, int partition) const;
57 virtual const AliHLTSpacePointGrid* GetAccessGrid(AliHLTUInt32_t /*mask*/) const;
59 /// clear the object and reset pointer references
60 virtual void Clear(Option_t * option ="");
63 virtual void Print(ostream& out, Option_t *option="") const;
65 /// create a collection of clusters for a space point mask
66 virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const;
68 /// create a collection of clusters for a specific track
69 virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const;
71 /// create a collection of clusters for a specific MC track
72 virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const;
74 /// create a collection of all used clusters
75 virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const;
77 /// create a collection of all unused clusters
78 virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const;
80 virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize);
81 virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize);
82 virtual int GetTrackID(AliHLTUInt32_t clusterID) const;
83 virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize);
85 virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size,
86 vector<AliHLTComponentBlockData>& outputBlocks,
87 AliHLTDataDeflater* pDeflater,
88 const char* option="") const;
89 virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
90 vector<AliHLTComponentBlockData>& outputBlocks,
91 AliHLTDataDeflater* pDeflater,
92 const char* option="") const;
94 int WriteUnsorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
95 vector<AliHLTComponentBlockData>& outputBlocks,
96 AliHLTDataDeflater* pDeflater,
97 const char* option="") const;
99 int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
100 vector<AliHLTComponentBlockData>& outputBlocks,
101 AliHLTDataDeflater* pDeflater,
102 const char* option="") const;
104 int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
105 AliHLTTPCHWCFData* pDecoder, AliHLTSpacePointGrid* pGrid,
107 vector<AliHLTComponentBlockData>& outputBlocks,
108 AliHLTDataDeflater* pDeflater,
109 const char* option) const;
111 class AliHLTTPCHWCFSpacePointProperties {
113 AliHLTTPCHWCFSpacePointProperties();
114 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFData* pDecoder, int index);
115 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFSpacePointProperties& src);
116 AliHLTTPCHWCFSpacePointProperties& operator=(const AliHLTTPCHWCFSpacePointProperties& src);
118 ~AliHLTTPCHWCFSpacePointProperties() {}
120 const AliHLTTPCHWCFData* Decoder() const {return fDecoder;}
121 int GetSpacepointIndex() const {return fIndex;}
122 bool IsUsed() const {return fUsed;}
123 void MarkUsed(bool used=true) {fUsed=used;}
124 int GetTrackId() const {return fTrackId;}
125 void SetTrackId(int trackId) {fTrackId=trackId;}
126 int GetMCId() const {return fMCId;}
127 void SetMCId(int mcId) {fMCId=mcId;}
129 void Print(ostream& out, Option_t *option="") const;
132 const AliHLTTPCHWCFData* fDecoder; //! decoder for data block
133 int fIndex; //! index within the decoder block
134 bool fUsed; //! transient
135 int fTrackId; //! track id from reconstruction
139 class AliHLTTPCHWCFSpacePointBlock {
141 AliHLTTPCHWCFSpacePointBlock(AliHLTUInt32_t id=0, AliHLTTPCHWCFData* pDecoder=NULL, AliHLTSpacePointGrid* pGrid=NULL)
142 : fDecoder(pDecoder), fGrid(pGrid), fId(id) {}
143 AliHLTTPCHWCFSpacePointBlock(const AliHLTTPCHWCFSpacePointBlock& s)
144 : fDecoder(s.fDecoder), fGrid(s.fGrid), fId(s.fId) {}
145 AliHLTTPCHWCFSpacePointBlock& operator=(const AliHLTTPCHWCFSpacePointBlock& s)
146 { fDecoder=s.fDecoder; fGrid=s.fGrid; fId=s.fId; return *this;}
147 ~AliHLTTPCHWCFSpacePointBlock() {}
149 int GetNofSpacepoints() const {return fDecoder?fDecoder->GetNumberOfClusters():0;}
150 AliHLTUInt32_t GetId() const {return fId;}
151 void SetId(AliHLTUInt32_t id) {fId=id;}
152 AliHLTTPCHWCFData* GetDecoder() const {return fDecoder;}
153 void SetDecoder(AliHLTTPCHWCFData* pDecoder) {fDecoder=pDecoder;}
154 AliHLTSpacePointGrid* GetGrid() const {return fGrid;}
155 void SetGrid(AliHLTSpacePointGrid* pGrid) {fGrid=pGrid;}
159 AliHLTTPCHWCFData* fDecoder; //!
160 AliHLTSpacePointGrid* fGrid; //!
161 AliHLTUInt32_t fId; //!
168 std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointProperties> fClusters; //!
170 /// map of cluster id collection for different masks
171 std::map<AliHLTUInt32_t, vector<AliHLTUInt32_t>*> fSelections; //!
173 /// array of decoders
174 std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointBlock> fBlocks; //!
176 /// the one instance for mode single (=1)
177 AliHLTTPCHWCFSpacePointBlock fSingleBlock;
182 ClassDef(AliHLTTPCHWCFSpacePointContainer, 0)
185 ostream& operator<<(ostream &out, const AliHLTTPCHWCFSpacePointContainer::AliHLTTPCHWCFSpacePointProperties& p);