]>
Commit | Line | Data |
---|---|---|
488caaa0 | 1 | //-*- Mode: C++ -*- |
2 | // $Id$ | |
3 | #ifndef ALIHLTSPACEPOINTCONTAINER_H | |
4 | #define ALIHLTSPACEPOINTCONTAINER_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 AliHLTSpacePointContainer.h | |
10 | /// @author Matthias Richter | |
11 | /// @date 2011-04-29 | |
12 | /// @brief Base helper class for handling of HLT space point data blocks | |
13 | /// | |
14 | ||
15 | #include <vector> | |
16 | #include <TObject.h> | |
17 | #include "AliHLTLogging.h" | |
18 | #include "AliHLTDataTypes.h" | |
19 | #include "AliHLTStdIncludes.h" | |
20 | ||
21 | class TArrayC; | |
27d45f0c | 22 | class TH1; |
6fa220b4 | 23 | class TTree; |
488caaa0 | 24 | |
25 | /** | |
26 | * @class AliHLTSpacePointContainer | |
27 | * Base class of helper classes for space point data blocks. | |
28 | * The class implements a couple of interface methods to be commonly used | |
29 | * for space point data blocks. | |
30 | * | |
31 | * @ingroup alihlt_base | |
32 | */ | |
33 | class AliHLTSpacePointContainer : public TObject, public AliHLTLogging | |
34 | { | |
35 | public: | |
36 | /// standard constructor | |
37 | AliHLTSpacePointContainer(); | |
38 | /// copy constructor | |
39 | AliHLTSpacePointContainer(const AliHLTSpacePointContainer&); | |
40 | /// assignment operator | |
41 | AliHLTSpacePointContainer& operator=(const AliHLTSpacePointContainer&); | |
42 | ||
43 | /// destructor | |
44 | ~AliHLTSpacePointContainer(); | |
45 | ||
46 | /// add input block to the collection | |
47 | virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc)=0; | |
48 | ||
e1e03704 | 49 | virtual int GetNumberOfSpacePoints() const; |
50 | virtual bool Check(AliHLTUInt32_t clusterID) const; | |
488caaa0 | 51 | virtual int GetClusterIDs(vector<AliHLTUInt32_t>& tgt) const = 0; |
54ff4c01 | 52 | virtual const vector<AliHLTUInt32_t>* GetClusterIDs(AliHLTUInt32_t /*mask*/) {return NULL;} |
488caaa0 | 53 | virtual float GetX(AliHLTUInt32_t clusterID) const = 0; |
54 | virtual float GetXWidth(AliHLTUInt32_t clusterID) const = 0; | |
55 | virtual float GetY(AliHLTUInt32_t clusterID) const = 0; | |
56 | virtual float GetYWidth(AliHLTUInt32_t clusterID) const = 0; | |
57 | virtual float GetZ(AliHLTUInt32_t clusterID) const = 0; | |
58 | virtual float GetZWidth(AliHLTUInt32_t clusterID) const = 0; | |
59 | virtual float GetCharge(AliHLTUInt32_t clusterID) const = 0; | |
37c3ba28 | 60 | virtual float GetMaxSignal(AliHLTUInt32_t /*clusterID*/) const {return 0.0;} |
27d45f0c | 61 | virtual float GetPhi(AliHLTUInt32_t /*clusterID*/) const {return 0.0;} |
488caaa0 | 62 | |
54ff4c01 | 63 | /// create a collection of clusters for a space point mask |
64 | virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const; | |
65 | ||
488caaa0 | 66 | /// create a collection of clusters for a specific track |
67 | virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const; | |
68 | ||
69 | /// create a collection of clusters for a specific MC track | |
70 | virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const; | |
71 | ||
72 | /// create a collection of all used clusters | |
73 | virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const; | |
74 | ||
75 | /// create a collection of all unused clusters | |
76 | virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const; | |
77 | ||
78 | int MarkUsed(AliHLTUInt32_t clusterID) {return MarkUsed(&clusterID, sizeof(clusterID));} | |
79 | virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize); | |
80 | ||
81 | int SetTrackID(int trackID, AliHLTUInt32_t clusterID) { | |
82 | return SetTrackID(trackID, &clusterID, sizeof(clusterID)); | |
83 | } | |
84 | virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize); | |
85 | ||
e1e03704 | 86 | virtual int GetTrackID(AliHLTUInt32_t /*clusterID*/) const {return -1;} |
87 | ||
488caaa0 | 88 | int SetMCID(int mcID, AliHLTUInt32_t clusterID) { |
89 | return SetMCID(mcID, &clusterID, sizeof(clusterID)); | |
90 | } | |
91 | virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize); | |
92 | ||
da9919a1 | 93 | /// write blocks to HLT component output |
94 | virtual int Write(AliHLTUInt8_t* /*outputPtr*/, AliHLTUInt32_t /*size*/, | |
95 | vector<AliHLTComponentBlockData>& /*outputBlocks*/, | |
96 | const char* /*option*/="") const {return 0;} | |
97 | ||
488caaa0 | 98 | /// add input block from file to collection |
99 | int AddInputBlock(const char* filename, AliHLTComponentDataType dt, unsigned specification); | |
100 | ||
101 | /// add input block from list of blank separated files to collection | |
102 | int AddInputBlocks(const char* filenames, AliHLTComponentDataType dt); | |
103 | ||
3488f70b | 104 | /// alloc memory for a space point data block |
105 | AliHLTUInt8_t* Alloc(int size); | |
106 | ||
488caaa0 | 107 | /// inherited from TObject: clear the object and reset pointer references |
108 | virtual void Clear(Option_t * /*option*/ =""); | |
109 | ||
110 | /// inherited from TObject | |
111 | virtual void Print(Option_t *option="") const; | |
112 | ||
113 | virtual void Print(ostream& out, Option_t *option="") const; | |
114 | ||
5f195a83 | 115 | void Draw(Option_t *option); |
116 | ||
27d45f0c | 117 | TH1* DrawProjection(const char* plane) const { |
118 | vector<AliHLTUInt32_t> selection; // empty list -> no selection | |
119 | return DrawProjection(plane, selection); | |
120 | } | |
121 | ||
122 | TH1* DrawProjection(const char* plane, AliHLTUInt32_t specification) const { | |
123 | vector<AliHLTUInt32_t> selection; selection.push_back(specification); | |
124 | return DrawProjection(plane, selection); | |
125 | } | |
126 | ||
127 | TH1* DrawProjection(const char* plane, const vector<AliHLTUInt32_t>& selection) const; | |
128 | ||
6fa220b4 | 129 | TTree* FillTree(const char* name, const char* title=""); |
130 | ||
488caaa0 | 131 | protected: |
132 | ||
133 | private: | |
134 | vector<TArrayC*> fBuffers; //! buffers of loaded files | |
135 | ||
136 | ClassDef(AliHLTSpacePointContainer, 0) | |
137 | }; | |
138 | ||
139 | ostream& operator<<(ostream &out, const AliHLTSpacePointContainer& c); | |
140 | ||
141 | #endif |