1 #ifndef ALIITSUCLUSTERPIX_H
2 #define ALIITSUCLUSTERPIX_H
4 #include "AliCluster.h"
11 class AliITSUClusterPix : public AliCluster
14 enum { // frame in which the track is currently defined
18 ,kFrameBits = kFrameLoc|kFrameTrk|kFrameGlo
22 enum SortMode_t { // various modes
23 kSortIdLocXZ = BIT(0) // sort according to ID, then X,Z of local frame
24 ,kSortIdTrkYZ = BIT(1) // sort according to ID, then Y,Z of tracking frame
25 ,kSortBits = kSortIdLocXZ|kSortIdTrkYZ
30 AliITSUClusterPix(const AliITSUClusterPix& cluster);
31 AliITSUClusterPix &operator=(const AliITSUClusterPix& cluster);
32 virtual ~AliITSUClusterPix();
34 Bool_t IsFrameLoc() const {return TestBit(kFrameLoc);}
35 Bool_t IsFrameGlo() const {return TestBit(kFrameGlo);}
36 Bool_t IsFrameTrk() const {return TestBit(kFrameTrk);}
38 Bool_t IsSplit() const {return TestBit(kSplit);}
40 void SetFrameLoc() {ResetBit(kFrameBits); SetBit(kFrameLoc);}
41 void SetFrameGlo() {ResetBit(kFrameBits); SetBit(kFrameGlo);}
42 void SetFrameTrk() {ResetBit(kFrameTrk); SetBit(kFrameTrk);}
44 void SetSplit(Bool_t v=kTRUE) {SetBit(kSplit,v);}
49 void GetLocalXYZ(Float_t xyz[3]) const;
50 void GetTrackingXYZ(Float_t xyz[3]) const;
52 void SetNxNzN(UChar_t nx,UChar_t nz,UShort_t n) {fNxNzN = ( ((n&0xff)<<16)) + ((nx&0xff)<<8) + (nz&0xff);}
53 void SetClUsage(Int_t n);
54 void ModClUsage(Bool_t used=kTRUE) {used ? IncClUsage() : DecClUsage();}
55 void IncClUsage() {SetClUsage(GetClUsage()+1); IncreaseClusterUsage();}
57 Int_t GetNx() const {return (fNxNzN>>8)&0xff;}
58 Int_t GetNz() const {return fNxNzN&0xff;}
59 Int_t GetNPix() const {return (fNxNzN>>16)&0xff;}
60 Int_t GetClUsage() const {return (fNxNzN>>24)&0xff;}
62 void SetQ(UShort_t q) {fCharge = q;}
63 Int_t GetQ() const {return fCharge;}
65 virtual void Print(Option_t* option = "") const;
66 virtual const TGeoHMatrix* GetTracking2LocalMatrix() const;
67 virtual TGeoHMatrix* GetMatrix(Bool_t original = kFALSE) const;
68 virtual Bool_t GetGlobalXYZ(Float_t xyz[3]) const;
69 virtual Bool_t GetGlobalXYZ(Double_t xyz[3]) const;
70 virtual Bool_t GetGlobalCov(Float_t cov[6]) const;
71 virtual Bool_t GetXRefPlane(Float_t &xref) const;
73 virtual Bool_t IsSortable() const {return kTRUE;}
74 virtual Bool_t IsEqual(const TObject* obj) const;
75 virtual Int_t Compare(const TObject* obj) const;
77 UShort_t GetRecoInfo() const {return fRecoInfo;}
78 void SetRecoInfo(UShort_t v) {fRecoInfo = v; ModClUsage(v>0);}
80 Bool_t HasCommonTrack(const AliCluster* cl) const;
82 static void SetGeom(AliITSUGeomTGeo* gm) {fgGeom = gm;}
83 static void SetSortMode(SortMode_t md) {fgMode &= ~kSortBits; fgMode |= md;}
84 static UInt_t GetSortMode() {return fgMode&kSortBits;}
85 static UInt_t GetMode() {return fgMode;}
86 static SortMode_t SortModeIdTrkYZ() {return kSortIdTrkYZ;}
87 static SortMode_t SortModeIdLocXZ() {return kSortIdLocXZ;}
91 UShort_t fCharge; // charge (for MC studies only)
92 UShort_t fRecoInfo; //! space reserved for reco time manipulations
93 Int_t fNxNzN; // effective cluster size in X (1st byte) and Z (2nd byte) directions
94 // and total Npix(3d byte). 4th byte is used for clusters usage counter
95 static UInt_t fgMode; //! general mode (sorting mode etc)
96 static AliITSUGeomTGeo* fgGeom; //! pointer on the geometry data
98 ClassDef(AliITSUClusterPix,2)
101 //______________________________________________________
102 inline void AliITSUClusterPix::DecClUsage() {
103 // decrease cluster usage counter
105 if (n) SetClUsage(--n);
109 //______________________________________________________
110 inline void AliITSUClusterPix::SetClUsage(Int_t n) {
111 // set cluster usage counter
112 fNxNzN &= 0x00ffffff;
113 fNxNzN |= (n&0xff)<<24;
114 if (n<2) SetBit(kShared,kFALSE);
115 if (!n) SetBit(kUsed,kFALSE);