]>
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; |
488caaa0 | 23 | |
24 | /** | |
25 | * @class AliHLTSpacePointContainer | |
26 | * Base class of helper classes for space point data blocks. | |
27 | * The class implements a couple of interface methods to be commonly used | |
28 | * for space point data blocks. | |
29 | * | |
30 | * @ingroup alihlt_base | |
31 | */ | |
32 | class AliHLTSpacePointContainer : public TObject, public AliHLTLogging | |
33 | { | |
34 | public: | |
35 | /// standard constructor | |
36 | AliHLTSpacePointContainer(); | |
37 | /// copy constructor | |
38 | AliHLTSpacePointContainer(const AliHLTSpacePointContainer&); | |
39 | /// assignment operator | |
40 | AliHLTSpacePointContainer& operator=(const AliHLTSpacePointContainer&); | |
41 | ||
42 | /// destructor | |
43 | ~AliHLTSpacePointContainer(); | |
44 | ||
45 | /// add input block to the collection | |
46 | virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc)=0; | |
47 | ||
5f195a83 | 48 | int GetNumberOfSpacePoints() const; |
488caaa0 | 49 | virtual int GetClusterIDs(vector<AliHLTUInt32_t>& tgt) const = 0; |
50 | virtual float GetX(AliHLTUInt32_t clusterID) const = 0; | |
51 | virtual float GetXWidth(AliHLTUInt32_t clusterID) const = 0; | |
52 | virtual float GetY(AliHLTUInt32_t clusterID) const = 0; | |
53 | virtual float GetYWidth(AliHLTUInt32_t clusterID) const = 0; | |
54 | virtual float GetZ(AliHLTUInt32_t clusterID) const = 0; | |
55 | virtual float GetZWidth(AliHLTUInt32_t clusterID) const = 0; | |
56 | virtual float GetCharge(AliHLTUInt32_t clusterID) const = 0; | |
27d45f0c | 57 | virtual float GetPhi(AliHLTUInt32_t /*clusterID*/) const {return 0.0;} |
488caaa0 | 58 | |
59 | /// create a collection of clusters for a specific track | |
60 | virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const; | |
61 | ||
62 | /// create a collection of clusters for a specific MC track | |
63 | virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const; | |
64 | ||
65 | /// create a collection of all used clusters | |
66 | virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const; | |
67 | ||
68 | /// create a collection of all unused clusters | |
69 | virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const; | |
70 | ||
71 | int MarkUsed(AliHLTUInt32_t clusterID) {return MarkUsed(&clusterID, sizeof(clusterID));} | |
72 | virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize); | |
73 | ||
74 | int SetTrackID(int trackID, AliHLTUInt32_t clusterID) { | |
75 | return SetTrackID(trackID, &clusterID, sizeof(clusterID)); | |
76 | } | |
77 | virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize); | |
78 | ||
79 | int SetMCID(int mcID, AliHLTUInt32_t clusterID) { | |
80 | return SetMCID(mcID, &clusterID, sizeof(clusterID)); | |
81 | } | |
82 | virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize); | |
83 | ||
84 | /// add input block from file to collection | |
85 | int AddInputBlock(const char* filename, AliHLTComponentDataType dt, unsigned specification); | |
86 | ||
87 | /// add input block from list of blank separated files to collection | |
88 | int AddInputBlocks(const char* filenames, AliHLTComponentDataType dt); | |
89 | ||
90 | /// inherited from TObject: clear the object and reset pointer references | |
91 | virtual void Clear(Option_t * /*option*/ =""); | |
92 | ||
93 | /// inherited from TObject | |
94 | virtual void Print(Option_t *option="") const; | |
95 | ||
96 | virtual void Print(ostream& out, Option_t *option="") const; | |
97 | ||
5f195a83 | 98 | void Draw(Option_t *option); |
99 | ||
27d45f0c | 100 | TH1* DrawProjection(const char* plane) const { |
101 | vector<AliHLTUInt32_t> selection; // empty list -> no selection | |
102 | return DrawProjection(plane, selection); | |
103 | } | |
104 | ||
105 | TH1* DrawProjection(const char* plane, AliHLTUInt32_t specification) const { | |
106 | vector<AliHLTUInt32_t> selection; selection.push_back(specification); | |
107 | return DrawProjection(plane, selection); | |
108 | } | |
109 | ||
110 | TH1* DrawProjection(const char* plane, const vector<AliHLTUInt32_t>& selection) const; | |
111 | ||
488caaa0 | 112 | protected: |
113 | ||
114 | private: | |
115 | vector<TArrayC*> fBuffers; //! buffers of loaded files | |
116 | ||
117 | ClassDef(AliHLTSpacePointContainer, 0) | |
118 | }; | |
119 | ||
120 | ostream& operator<<(ostream &out, const AliHLTSpacePointContainer& c); | |
121 | ||
122 | #endif |