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 *
9 /// @file AliHLTSpacePointContainer.h
10 /// @author Matthias Richter
12 /// @brief Base helper class for handling of HLT space point data blocks
17 #include "AliHLTLogging.h"
18 #include "AliHLTDataTypes.h"
19 #include "AliHLTStdIncludes.h"
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.
30 * @ingroup alihlt_base
32 class AliHLTSpacePointContainer : public TObject, public AliHLTLogging
35 /// standard constructor
36 AliHLTSpacePointContainer();
38 AliHLTSpacePointContainer(const AliHLTSpacePointContainer&);
39 /// assignment operator
40 AliHLTSpacePointContainer& operator=(const AliHLTSpacePointContainer&);
43 ~AliHLTSpacePointContainer();
45 /// add input block to the collection
46 virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc)=0;
48 virtual int GetNumberOfSpacePoints() const;
49 virtual bool Check(AliHLTUInt32_t clusterID) const;
50 virtual int GetClusterIDs(vector<AliHLTUInt32_t>& tgt) const = 0;
51 virtual const vector<AliHLTUInt32_t>* GetClusterIDs(AliHLTUInt32_t /*mask*/) {return NULL;}
52 virtual float GetX(AliHLTUInt32_t clusterID) const = 0;
53 virtual float GetXWidth(AliHLTUInt32_t clusterID) const = 0;
54 virtual float GetY(AliHLTUInt32_t clusterID) const = 0;
55 virtual float GetYWidth(AliHLTUInt32_t clusterID) const = 0;
56 virtual float GetZ(AliHLTUInt32_t clusterID) const = 0;
57 virtual float GetZWidth(AliHLTUInt32_t clusterID) const = 0;
58 virtual float GetCharge(AliHLTUInt32_t clusterID) const = 0;
59 virtual float GetPhi(AliHLTUInt32_t /*clusterID*/) const {return 0.0;}
61 /// create a collection of clusters for a space point mask
62 virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const;
64 /// create a collection of clusters for a specific track
65 virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const;
67 /// create a collection of clusters for a specific MC track
68 virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const;
70 /// create a collection of all used clusters
71 virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const;
73 /// create a collection of all unused clusters
74 virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const;
76 int MarkUsed(AliHLTUInt32_t clusterID) {return MarkUsed(&clusterID, sizeof(clusterID));}
77 virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize);
79 int SetTrackID(int trackID, AliHLTUInt32_t clusterID) {
80 return SetTrackID(trackID, &clusterID, sizeof(clusterID));
82 virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize);
84 virtual int GetTrackID(AliHLTUInt32_t /*clusterID*/) const {return -1;}
86 int SetMCID(int mcID, AliHLTUInt32_t clusterID) {
87 return SetMCID(mcID, &clusterID, sizeof(clusterID));
89 virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize);
91 /// add input block from file to collection
92 int AddInputBlock(const char* filename, AliHLTComponentDataType dt, unsigned specification);
94 /// add input block from list of blank separated files to collection
95 int AddInputBlocks(const char* filenames, AliHLTComponentDataType dt);
97 /// alloc memory for a space point data block
98 AliHLTUInt8_t* Alloc(int size);
100 /// inherited from TObject: clear the object and reset pointer references
101 virtual void Clear(Option_t * /*option*/ ="");
103 /// inherited from TObject
104 virtual void Print(Option_t *option="") const;
106 virtual void Print(ostream& out, Option_t *option="") const;
108 void Draw(Option_t *option);
110 TH1* DrawProjection(const char* plane) const {
111 vector<AliHLTUInt32_t> selection; // empty list -> no selection
112 return DrawProjection(plane, selection);
115 TH1* DrawProjection(const char* plane, AliHLTUInt32_t specification) const {
116 vector<AliHLTUInt32_t> selection; selection.push_back(specification);
117 return DrawProjection(plane, selection);
120 TH1* DrawProjection(const char* plane, const vector<AliHLTUInt32_t>& selection) const;
125 vector<TArrayC*> fBuffers; //! buffers of loaded files
127 ClassDef(AliHLTSpacePointContainer, 0)
130 ostream& operator<<(ostream &out, const AliHLTSpacePointContainer& c);