]>
Commit | Line | Data |
---|---|---|
5e375bb4 | 1 | #ifndef ALIITSUCLUSTERPIX_H |
2 | #define ALIITSUCLUSTERPIX_H | |
3 | ||
4 | #include "AliCluster.h" | |
bdb92766 | 5 | #include <TMath.h> |
5e375bb4 | 6 | |
7 | class TGeoHMatrix; | |
8 | class AliITSUGeomTGeo; | |
9 | ||
10 | ||
11 | class AliITSUClusterPix : public AliCluster | |
12 | { | |
13 | public: | |
14 | enum { // frame in which the track is currently defined | |
15 | kFrameLoc = BIT(16) | |
16 | ,kFrameTrk = BIT(17) | |
17 | ,kFrameGlo = BIT(18) | |
18 | ,kFrameBits = kFrameLoc|kFrameTrk|kFrameGlo | |
53870004 | 19 | ,kSplit = BIT(19) |
5e375bb4 | 20 | }; |
21 | // | |
22 | enum SortMode_t { // various modes | |
1f9b6041 | 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 | |
5e375bb4 | 26 | }; |
27 | ||
28 | public: | |
29 | AliITSUClusterPix(); | |
30 | AliITSUClusterPix(const AliITSUClusterPix& cluster); | |
31 | AliITSUClusterPix &operator=(const AliITSUClusterPix& cluster); | |
32 | virtual ~AliITSUClusterPix(); | |
33 | // | |
34 | Bool_t IsFrameLoc() const {return TestBit(kFrameLoc);} | |
35 | Bool_t IsFrameGlo() const {return TestBit(kFrameGlo);} | |
36 | Bool_t IsFrameTrk() const {return TestBit(kFrameTrk);} | |
53870004 | 37 | // |
38 | Bool_t IsSplit() const {return TestBit(kSplit);} | |
39 | // | |
5e375bb4 | 40 | void SetFrameLoc() {ResetBit(kFrameBits); SetBit(kFrameLoc);} |
41 | void SetFrameGlo() {ResetBit(kFrameBits); SetBit(kFrameGlo);} | |
42 | void SetFrameTrk() {ResetBit(kFrameTrk); SetBit(kFrameTrk);} | |
53870004 | 43 | // |
44 | void SetSplit(Bool_t v=kTRUE) {SetBit(kSplit,v);} | |
45 | // | |
5e375bb4 | 46 | void GoToFrameGlo(); |
47 | void GoToFrameLoc(); | |
48 | void GoToFrameTrk(); | |
29ad4146 | 49 | void GetLocalXYZ(Float_t xyz[3]) const; |
50 | void GetTrackingXYZ(Float_t xyz[3]) const; | |
5e375bb4 | 51 | // |
bdb92766 | 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();} | |
56 | void DecClUsage(); | |
29ad4146 | 57 | Int_t GetNx() const {return (fNxNzN>>8)&0xff;} |
58 | Int_t GetNz() const {return fNxNzN&0xff;} | |
bdb92766 | 59 | Int_t GetNPix() const {return (fNxNzN>>16)&0xff;} |
60 | Int_t GetClUsage() const {return (fNxNzN>>24)&0xff;} | |
29ad4146 | 61 | // |
62 | void SetQ(UShort_t q) {fCharge = q;} | |
63 | Int_t GetQ() const {return fCharge;} | |
5e375bb4 | 64 | // |
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 GetGlobalCov(Float_t cov[6]) const; | |
70 | virtual Bool_t GetXRefPlane(Float_t &xref) const; | |
71 | // | |
72 | virtual Bool_t IsSortable() const {return kTRUE;} | |
73 | virtual Bool_t IsEqual(const TObject* obj) const; | |
74 | virtual Int_t Compare(const TObject* obj) const; | |
75 | // | |
08419930 | 76 | UShort_t GetRecoInfo() const {return fRecoInfo;} |
77 | void SetRecoInfo(UShort_t v) {fRecoInfo = v; ModClUsage(v>0);} | |
78 | // | |
53870004 | 79 | Bool_t HasCommonTrack(const AliCluster* cl) const; |
80 | // | |
5e375bb4 | 81 | static void SetGeom(AliITSUGeomTGeo* gm) {fgGeom = gm;} |
82 | static void SetSortMode(SortMode_t md) {fgMode &= ~kSortBits; fgMode |= md;} | |
cb50e082 | 83 | static UInt_t GetSortMode() {return fgMode&kSortBits;} |
5e375bb4 | 84 | static UInt_t GetMode() {return fgMode;} |
3dd9c283 | 85 | static SortMode_t SortModeIdTrkYZ() {return kSortIdTrkYZ;} |
86 | static SortMode_t SortModeIdLocXZ() {return kSortIdLocXZ;} | |
5e375bb4 | 87 | // |
88 | protected: | |
89 | // | |
29ad4146 | 90 | UShort_t fCharge; // charge (for MC studies only) |
08419930 | 91 | UShort_t fRecoInfo; //! space reserved for reco time manipulations |
29ad4146 | 92 | Int_t fNxNzN; // effective cluster size in X (1st byte) and Z (2nd byte) directions |
bdb92766 | 93 | // and total Npix(3d byte). 4th byte is used for clusters usage counter |
32d38de2 | 94 | static UInt_t fgMode; //! general mode (sorting mode etc) |
95 | static AliITSUGeomTGeo* fgGeom; //! pointer on the geometry data | |
5e375bb4 | 96 | |
08419930 | 97 | ClassDef(AliITSUClusterPix,2) |
5e375bb4 | 98 | }; |
99 | ||
bdb92766 | 100 | //______________________________________________________ |
101 | inline void AliITSUClusterPix::DecClUsage() { | |
102 | // decrease cluster usage counter | |
103 | int n=GetClUsage(); | |
104 | if (n) SetClUsage(--n); | |
105 | // | |
106 | } | |
107 | ||
108 | //______________________________________________________ | |
109 | inline void AliITSUClusterPix::SetClUsage(Int_t n) { | |
110 | // set cluster usage counter | |
8c9d1b4c | 111 | fNxNzN &= 0x00ffffff; |
112 | fNxNzN |= (n&0xff)<<24; | |
bdb92766 | 113 | if (n<2) SetBit(kShared,kFALSE); |
114 | if (!n) SetBit(kUsed,kFALSE); | |
115 | } | |
116 | ||
5e375bb4 | 117 | #endif |