Line data Source code
1 : //-*- Mode: C++ -*-
2 : // $Id$
3 : #ifndef ALIHLTTPCSPACEPOINTCONTAINER_H
4 : #define ALIHLTTPCSPACEPOINTCONTAINER_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 AliHLTTPCSpacePointContainer.h
10 : /// @author Matthias Richter
11 : /// @date 2011-04-29
12 : /// @brief Helper class for handling of HLT TPC space point data blocks
13 : ///
14 :
15 : #include "AliHLTSpacePointContainer.h"
16 : #include "AliHLTTPCClusterDataFormat.h"
17 : #include "AliHLTTPCSpacePointData.h"
18 : #include <map>
19 : using namespace std;
20 :
21 : /**
22 : * @class AliHLTTPCSpacePointContainer
23 : * Handler class for HLT TPCS space point data blocks.
24 : *
25 : * @ingroup alihlt_tpc
26 : */
27 : class AliHLTTPCSpacePointContainer : public AliHLTSpacePointContainer
28 : {
29 : public:
30 : /// standard constructor
31 : AliHLTTPCSpacePointContainer();
32 : /// copy constructor
33 : AliHLTTPCSpacePointContainer(const AliHLTTPCSpacePointContainer& c);
34 : /// assignment operator
35 : AliHLTTPCSpacePointContainer& operator=(const AliHLTTPCSpacePointContainer& c);
36 : /// destructor
37 : ~AliHLTTPCSpacePointContainer();
38 :
39 : virtual bool Check(AliHLTUInt32_t clusterID) const;
40 : virtual int GetClusterIDs(vector<AliHLTUInt32_t>& tgt) const;
41 : virtual const vector<AliHLTUInt32_t>* GetClusterIDs(AliHLTUInt32_t mask);
42 : virtual float GetX(AliHLTUInt32_t clusterID) const;
43 : virtual float GetXWidth(AliHLTUInt32_t clusterID) const;
44 : virtual float GetY(AliHLTUInt32_t clusterID) const;
45 : virtual float GetYWidth(AliHLTUInt32_t clusterID) const;
46 : virtual float GetZ(AliHLTUInt32_t clusterID) const;
47 : virtual float GetZWidth(AliHLTUInt32_t clusterID) const;
48 : virtual float GetCharge(AliHLTUInt32_t clusterID) const;
49 : virtual float GetMaxSignal(AliHLTUInt32_t clusterID) const;
50 : virtual float GetPhi(AliHLTUInt32_t clusterID) const;
51 : virtual UChar_t GetPadRow(AliHLTUInt32_t clusterID) const;
52 :
53 : /// add input block to the collection
54 : virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc);
55 :
56 : /// clear the object and reset pointer references
57 : virtual void Clear(Option_t * option ="");
58 :
59 : /// print information
60 : virtual void Print(ostream& out, Option_t *option="") const;
61 :
62 : /// create a collection of clusters for a space point mask
63 : virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const;
64 :
65 : /// create a collection of clusters for a specific track
66 : virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const;
67 :
68 : /// create a collection of clusters for a specific MC track
69 : virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const;
70 :
71 : /// create a collection of all used clusters
72 : virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const;
73 :
74 : /// create a collection of all unused clusters
75 : virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const;
76 :
77 : virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize);
78 : virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize);
79 : virtual int GetTrackID(AliHLTUInt32_t clusterID) const;
80 : virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize);
81 :
82 : class AliHLTTPCSpacePointProperties {
83 : public:
84 : AliHLTTPCSpacePointProperties();
85 : AliHLTTPCSpacePointProperties(const AliHLTTPCSpacePointData* pCluster);
86 : AliHLTTPCSpacePointProperties(const AliHLTTPCSpacePointProperties& src);
87 : AliHLTTPCSpacePointProperties& operator=(const AliHLTTPCSpacePointProperties& src);
88 :
89 0 : ~AliHLTTPCSpacePointProperties() {}
90 :
91 0 : const AliHLTTPCSpacePointData* Data() const {return fCluster;}
92 0 : bool IsUsed() const {return fUsed;}
93 0 : void MarkUsed(bool used=true) {fUsed=used;}
94 0 : int GetTrackId() const {return fTrackId;}
95 0 : void SetTrackId(int trackId) {fTrackId=trackId;}
96 0 : int GetMCId() const {return fMCId;}
97 0 : void SetMCId(int mcId) {fMCId=mcId;}
98 :
99 : void Print(ostream& out, Option_t *option="") const;
100 :
101 : private:
102 : const AliHLTTPCSpacePointData* fCluster; //! transient
103 : bool fUsed; //! transient
104 : int fTrackId; //! track id from reconstruction
105 : int fMCId; //! MC id
106 : };
107 :
108 : protected:
109 :
110 : private:
111 : /// map of clusters
112 : std::map<AliHLTUInt32_t, AliHLTTPCSpacePointProperties> fClusters; //!
113 :
114 : /// map of cluster id collection for different masks
115 : std::map<AliHLTUInt32_t, vector<AliHLTUInt32_t>*> fSelections; //!
116 :
117 6 : ClassDef(AliHLTTPCSpacePointContainer, 0)
118 : };
119 :
120 : ostream& operator<<(ostream &out, const AliHLTTPCSpacePointContainer::AliHLTTPCSpacePointProperties& p);
121 :
122 : #endif
|