]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCHWCFSpacePointContainer.h
remove transformed clusters from TPCDataCompressor input; added configuration object...
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCHWCFSpacePointContainer.h
CommitLineData
f4ee4ed8 1//-*- Mode: C++ -*-
2// $Id$
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 *
8
9/// @file AliHLTTPCHWCFSpacePointContainer.h
10/// @author Matthias Richter
11/// @date 2011-08-08
12/// @brief Helper class for handling of HLT TPC cluster data blocks from the
13/// HW ClusterFinder
14/// @note Class is a duplicate of AliHLTTPCHWCFSpacePointContainer and should
15/// be merged with it in a generic way
16
17#include "AliHLTSpacePointContainer.h"
18#include "AliHLTTPCHWCFData.h"
19#include <map>
20using namespace std;
21
22/**
23 * @class AliHLTTPCHWCFSpacePointContainer
24 * Handler class for HLT TPC hardware ClusterFinder space point data blocks.
25 *
26 * @ingroup alihlt_tpc
27 */
28class AliHLTTPCHWCFSpacePointContainer : public AliHLTSpacePointContainer
29{
30 public:
31 /// standard constructor
32 AliHLTTPCHWCFSpacePointContainer();
33 /// copy constructor
34 AliHLTTPCHWCFSpacePointContainer(const AliHLTTPCHWCFSpacePointContainer& c);
35 /// assignment operator
36 AliHLTTPCHWCFSpacePointContainer& operator=(const AliHLTTPCHWCFSpacePointContainer& c);
37 /// destructor
38 ~AliHLTTPCHWCFSpacePointContainer();
39
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;
51
52 /// add input block to the collection
53 virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc);
54
55 /// clear the object and reset pointer references
56 virtual void Clear(Option_t * option ="");
57
58 /// print information
59 virtual void Print(ostream& out, Option_t *option="") const;
60
61 /// create a collection of clusters for a space point mask
62 virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const;
63
64 /// create a collection of clusters for a specific track
65 virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const;
66
67 /// create a collection of clusters for a specific MC track
68 virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const;
69
70 /// create a collection of all used clusters
71 virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const;
72
73 /// create a collection of all unused clusters
74 virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const;
75
76 virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize);
77 virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize);
78 virtual int GetTrackID(AliHLTUInt32_t clusterID) const;
79 virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize);
80
81 virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size,
82 vector<AliHLTComponentBlockData>& outputBlocks,
83 const char* option="") const;
84
85 class AliHLTTPCHWCFSpacePointProperties {
86 public:
87 AliHLTTPCHWCFSpacePointProperties();
88 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFData* pDecoder, int index);
89 AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFSpacePointProperties& src);
90 AliHLTTPCHWCFSpacePointProperties& operator=(const AliHLTTPCHWCFSpacePointProperties& src);
91
92 ~AliHLTTPCHWCFSpacePointProperties() {}
93
94 const AliHLTTPCHWCFData* Decoder() const {return fDecoder;}
95 int GetSpacepointIndex() const {return fIndex;}
96 bool IsUsed() const {return fUsed;}
97 void MarkUsed(bool used=true) {fUsed=used;}
98 int GetTrackId() const {return fTrackId;}
99 void SetTrackId(int trackId) {fTrackId=trackId;}
100 int GetMCId() const {return fMCId;}
101 void SetMCId(int mcId) {fMCId=mcId;}
102
103 void Print(ostream& out, Option_t *option="") const;
104
105 private:
106 const AliHLTTPCHWCFData* fDecoder; //! decoder for data block
107 int fIndex; //! index within the decoder block
108 bool fUsed; //! transient
109 int fTrackId; //! track id from reconstruction
110 int fMCId; //! MC id
111 };
112
113 protected:
114
115 private:
116 /// map of clusters
117 std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointProperties> fClusters; //!
118
119 /// map of cluster id collection for different masks
120 std::map<AliHLTUInt32_t, vector<AliHLTUInt32_t>*> fSelections; //!
121
122 /// array of decoders
123 std::vector<AliHLTTPCHWCFData*> fDecoders; //!
124
125 ClassDef(AliHLTTPCHWCFSpacePointContainer, 0)
126};
127
128ostream& operator<<(ostream &out, const AliHLTTPCHWCFSpacePointContainer::AliHLTTPCHWCFSpacePointProperties& p);
129
130#endif