Line data Source code
1 : // $Id$
2 :
3 : #ifndef SPACEPOINTDATA_H
4 : #define SPACEPOINTDATA_H
5 :
6 : #include "Rtypes.h"
7 :
8 : /**
9 : * @struct AliHLTTPCSpacePointData
10 : * Primitive data exchange structure for TPC clusters.
11 : * Together with the AliHLTTPCClusterDataFormat this defines
12 : * the output of the TPC online Cluster Finder.
13 : *
14 : * To translate between local coordinates, global coordinates, and row-pad-time coordinates
15 : * one cann use AliHLTTPCTransform.
16 : *
17 : * See AliHLTTPCClusterFinder::WriteClusters() for example.
18 : *
19 : * @ingroup alihlt_tpc_datastructs
20 : */
21 : struct AliHLTTPCSpacePointData{
22 : Float_t fPad; // Pad coordinate in raw coordinates
23 : Float_t fTime; // Time coordinate in raw coordinates
24 : Float_t fX; // X coordinate in local coordinates
25 : Float_t fY; // Y coordinate in local coordinates
26 : Float_t fZ; // Z coordinate in local coordinates
27 : UInt_t fID; // contains slice patch and number
28 : UChar_t fPadRow; // Pad row number
29 : Float_t fSigmaY2; // error (former width) of the clusters
30 : Float_t fSigmaZ2; // error (former width) of the clusters
31 : UInt_t fCharge; // total charge of cluster
32 : UInt_t fQMax; // QMax of cluster
33 : Bool_t fUsed; // only used in AliHLTTPCDisplay
34 : Int_t fTrackN; // only used in AliHLTTPCDisplay
35 :
36 0 : void SetPad(Float_t pad) {fPad=pad;}
37 0 : void SetTime(Float_t time) {fTime=time;}
38 0 : void SetX(Float_t x) {fX=x;}
39 0 : void SetY(Float_t y) {fY=y;}
40 0 : void SetZ(Float_t z) {fZ=z;}
41 : void SetID(UInt_t id) {fID=id;}
42 0 : void SetPadRow(Short_t padrow) {fPadRow=padrow;}
43 0 : void SetSigmaY2(Float_t sigmaY2) {fSigmaY2=sigmaY2;}
44 0 : void SetSigmaZ2(Float_t sigmaZ2) {fSigmaZ2=sigmaZ2;}
45 0 : void SetCharge(UShort_t charge) {fCharge=charge;}
46 0 : void SetQMax(UShort_t qmax) {fQMax=qmax;}
47 :
48 : Float_t GetPad() const {return fPad;}
49 : Float_t GetTime() const {return fTime;}
50 : Float_t GetX() const {return fX;}
51 : Float_t GetY() const {return fY;}
52 : Float_t GetZ() const {return fZ;}
53 : UInt_t GetID() const {return fID;}
54 : UShort_t GetPadRow() const {return fPadRow;}
55 0 : Float_t GetSigmaY2() const {return fSigmaY2;}
56 0 : Float_t GetSigmaZ2() const {return fSigmaZ2;}
57 0 : UShort_t GetCharge() const {return fCharge;}
58 0 : UShort_t GetQMax() const {return fQMax;}
59 :
60 0 : static UInt_t GetSlice( UInt_t Id ) { return (Id>>25)&0x3F; }
61 0 : static UInt_t GetPatch( UInt_t Id ) { return (Id>>22)&0x7; }
62 0 : static UInt_t GetNumber( UInt_t Id ) { return Id&0x003FFFFF; }
63 : static UInt_t GetID( UInt_t Slice, UInt_t Patch, UInt_t Number ){
64 0 : return ((Slice&0x3F)<<25)+((Patch&0x7)<<22) + (Number&0x003FFFFF);
65 : }
66 :
67 : AliHLTTPCSpacePointData()
68 0 : : fPad(0.), fTime(0.), fX(0.), fY(0.), fZ(0.), fID(0), fPadRow(0), fSigmaY2(0.), fSigmaZ2(0.), fCharge(0), fQMax(0), fUsed(kFALSE), fTrackN(0) {}
69 : void SetID( UInt_t Slice, UInt_t Patch, UInt_t Number ){
70 0 : fID = GetID(Slice, Patch,Number);
71 0 : }
72 0 : UInt_t GetSlice() const { return GetSlice(fID); }
73 0 : UInt_t GetPatch() const { return GetPatch(fID); }
74 : UInt_t GetNumber() const { return GetNumber(fID); }
75 :
76 : Bool_t IsUsed() const {return fUsed;}
77 0 : void SetUsed(Bool_t used) {fUsed=used;}
78 : Int_t GetTrackNumber() const {return fTrackN;}
79 0 : void SetTrackNumber(Int_t trackN) {fTrackN=trackN;}
80 : };
81 : typedef struct AliHLTTPCSpacePointData AliHLTTPCSpacePointData;
82 :
83 :
84 : #endif /* SPACEPOINTDATA_H */
|