]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSUClusterPix.h
d942f322c42fc61326ca4b03efc99c5b18414247
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUClusterPix.h
1 #ifndef ALIITSUCLUSTERPIX_H
2 #define ALIITSUCLUSTERPIX_H
3
4 #include "AliCluster.h"
5
6 class TGeoHMatrix;
7 class AliITSUGeomTGeo;
8
9
10 class AliITSUClusterPix : public AliCluster
11 {
12  public:
13   enum { // frame in which the track is currently defined
14     kFrameLoc  = BIT(16)
15     ,kFrameTrk = BIT(17)
16     ,kFrameGlo = BIT(18)
17     ,kFrameBits = kFrameLoc|kFrameTrk|kFrameGlo
18     ,kSplit    = BIT(19)
19   };
20   //
21   enum SortMode_t { // various modes
22     kSortIdLocXZ  = BIT(0)    // sort according to ID, then X,Z of local frame
23     ,kSortIdTrkYZ = BIT(1)    // sort according to ID, then Y,Z of tracking frame
24     ,kSortBits = kSortIdLocXZ|kSortIdTrkYZ
25   };
26
27  public:
28   AliITSUClusterPix();
29   AliITSUClusterPix(const AliITSUClusterPix& cluster);
30   AliITSUClusterPix &operator=(const AliITSUClusterPix& cluster);
31   virtual ~AliITSUClusterPix();
32   //
33   Bool_t  IsFrameLoc()         const {return TestBit(kFrameLoc);}
34   Bool_t  IsFrameGlo()         const {return TestBit(kFrameGlo);}
35   Bool_t  IsFrameTrk()         const {return TestBit(kFrameTrk);}
36   //
37   Bool_t  IsSplit()            const {return TestBit(kSplit);}
38   //
39   void    SetFrameLoc()              {ResetBit(kFrameBits); SetBit(kFrameLoc);}
40   void    SetFrameGlo()              {ResetBit(kFrameBits); SetBit(kFrameGlo);}
41   void    SetFrameTrk()              {ResetBit(kFrameTrk);  SetBit(kFrameTrk);}
42   //
43   void    SetSplit(Bool_t v=kTRUE)   {SetBit(kSplit,v);}
44   //
45   void    GoToFrameGlo();
46   void    GoToFrameLoc();
47   void    GoToFrameTrk();
48   void    GetLocalXYZ(Float_t xyz[3])                       const;
49   void    GetTrackingXYZ(Float_t xyz[3])                    const; 
50   //
51   void    SetNxNzN(UChar_t nx,UChar_t nz,UShort_t n) {fNxNzN = (n<<16) + (nx<<8) + nz;}
52   Int_t   GetNx()                                           const {return (fNxNzN>>8)&0xff;}
53   Int_t   GetNz()                                           const {return fNxNzN&0xff;}
54   Int_t   GetNPix()                                         const {return fNxNzN>>16;}
55   //
56   void    SetQ(UShort_t q)                                        {fCharge = q;}
57   Int_t   GetQ()                                            const {return fCharge;}
58   //
59   virtual void                 Print(Option_t* option = "") const;
60   virtual const TGeoHMatrix*   GetTracking2LocalMatrix()           const;
61   virtual TGeoHMatrix*         GetMatrix(Bool_t original = kFALSE) const;
62   virtual Bool_t               GetGlobalXYZ(Float_t xyz[3]) const;
63   virtual Bool_t               GetGlobalCov(Float_t cov[6]) const;
64   virtual Bool_t               GetXRefPlane(Float_t &xref)  const;
65   //
66   virtual Bool_t               IsSortable()                 const {return kTRUE;}
67   virtual Bool_t               IsEqual(const TObject* obj)  const;
68   virtual Int_t                Compare(const TObject* obj)  const;
69   //
70   Bool_t  HasCommonTrack(const AliCluster* cl)          const;
71   //
72   static  void                 SetGeom(AliITSUGeomTGeo* gm) {fgGeom = gm;}
73   static  void                 SetSortMode(SortMode_t md)   {fgMode &= ~kSortBits; fgMode |= md;}
74   static  UInt_t               GetSortMode()                {return fgMode&kSortBits;}
75   static  UInt_t               GetMode()                    {return fgMode;}
76   static  SortMode_t           SortModeIdTrkYZ()            {return kSortIdTrkYZ;}
77   static  SortMode_t           SortModeIdLocXZ()            {return kSortIdLocXZ;}
78   //
79  protected:
80   //
81   UShort_t                fCharge;        //  charge (for MC studies only)
82   Int_t                   fNxNzN;         //  effective cluster size in X (1st byte) and Z (2nd byte) directions 
83                                           //  and total Npix(3d&4th bytes)
84   static UInt_t           fgMode;         //! general mode (sorting mode etc)
85   static AliITSUGeomTGeo* fgGeom;         //! pointer on the geometry data
86
87   ClassDef(AliITSUClusterPix,1)
88 };
89
90 #endif