]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/UPGRADE/AliITSUClusterPix.h
MakeITSUSimuParam macro with the tuned/fixed scale values (Levente)
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUClusterPix.h
index bed08a82688d55c718f4d4a74e860418febd5e9a..fc2d018fa6f7da48ff09ef67036b64c143542a8b 100644 (file)
@@ -2,6 +2,7 @@
 #define ALIITSUCLUSTERPIX_H
 
 #include "AliCluster.h"
+#include <TMath.h>
 
 class TGeoHMatrix;
 class AliITSUGeomTGeo;
@@ -15,6 +16,7 @@ class AliITSUClusterPix : public AliCluster
     ,kFrameTrk = BIT(17)
     ,kFrameGlo = BIT(18)
     ,kFrameBits = kFrameLoc|kFrameTrk|kFrameGlo
+    ,kSplit    = BIT(19)
   };
   //
   enum SortMode_t { // various modes
@@ -32,20 +34,30 @@ class AliITSUClusterPix : public AliCluster
   Bool_t  IsFrameLoc()         const {return TestBit(kFrameLoc);}
   Bool_t  IsFrameGlo()         const {return TestBit(kFrameGlo);}
   Bool_t  IsFrameTrk()         const {return TestBit(kFrameTrk);}
+  //
+  Bool_t  IsSplit()            const {return TestBit(kSplit);}
+  //
   void    SetFrameLoc()              {ResetBit(kFrameBits); SetBit(kFrameLoc);}
   void    SetFrameGlo()              {ResetBit(kFrameBits); SetBit(kFrameGlo);}
   void    SetFrameTrk()              {ResetBit(kFrameTrk);  SetBit(kFrameTrk);}
-   //
+  //
+  void    SetSplit(Bool_t v=kTRUE)   {SetBit(kSplit,v);}
+  //
   void    GoToFrameGlo();
   void    GoToFrameLoc();
   void    GoToFrameTrk();
   void    GetLocalXYZ(Float_t xyz[3])                       const;
   void    GetTrackingXYZ(Float_t xyz[3])                    const; 
   //
-  void    SetNxNzN(UChar_t nx,UChar_t nz,UShort_t n) {fNxNzN = (n<<16) + (nx<<8) + nz;}
+  void    SetNxNzN(UChar_t nx,UChar_t nz,UShort_t n)              {fNxNzN = ( ((n&0xff)<<16)) + ((nx&0xff)<<8) + (nz&0xff);}
+  void    SetClUsage(Int_t n);
+  void    ModClUsage(Bool_t used=kTRUE)                           {used ? IncClUsage() : DecClUsage();}
+  void    IncClUsage()                                            {SetClUsage(GetClUsage()+1); IncreaseClusterUsage();}
+  void    DecClUsage();
   Int_t   GetNx()                                           const {return (fNxNzN>>8)&0xff;}
   Int_t   GetNz()                                           const {return fNxNzN&0xff;}
-  Int_t   GetNPix()                                         const {return fNxNzN>>16;}
+  Int_t   GetNPix()                                         const {return (fNxNzN>>16)&0xff;}
+  Int_t   GetClUsage()                                      const {return (fNxNzN>>24)&0xff;}
   //
   void    SetQ(UShort_t q)                                        {fCharge = q;}
   Int_t   GetQ()                                            const {return fCharge;}
@@ -61,9 +73,14 @@ class AliITSUClusterPix : public AliCluster
   virtual Bool_t               IsEqual(const TObject* obj)  const;
   virtual Int_t                       Compare(const TObject* obj)  const;
   //
+  UShort_t                     GetRecoInfo()                const {return fRecoInfo;}
+  void                         SetRecoInfo(UShort_t v)            {fRecoInfo = v; ModClUsage(v>0);}
+  //
+  Bool_t  HasCommonTrack(const AliCluster* cl)          const;
+  //
   static  void                 SetGeom(AliITSUGeomTGeo* gm) {fgGeom = gm;}
   static  void                 SetSortMode(SortMode_t md)   {fgMode &= ~kSortBits; fgMode |= md;}
-  static  UInt_t               GetSortMode()                {return fgMode|kSortBits;}
+  static  UInt_t               GetSortMode()                {return fgMode&kSortBits;}
   static  UInt_t               GetMode()                    {return fgMode;}
   static  SortMode_t           SortModeIdTrkYZ()            {return kSortIdTrkYZ;}
   static  SortMode_t           SortModeIdLocXZ()            {return kSortIdLocXZ;}
@@ -71,12 +88,30 @@ class AliITSUClusterPix : public AliCluster
  protected:
   //
   UShort_t                fCharge;        //  charge (for MC studies only)
+  UShort_t                fRecoInfo;      //! space reserved for reco time manipulations
   Int_t                   fNxNzN;         //  effective cluster size in X (1st byte) and Z (2nd byte) directions 
-                                          //  and total Npix(3d&4th bytes)
+                                          //  and total Npix(3d byte). 4th byte is used for clusters usage counter
   static UInt_t           fgMode;         //! general mode (sorting mode etc)
   static AliITSUGeomTGeo* fgGeom;         //! pointer on the geometry data
 
-  ClassDef(AliITSUClusterPix,1)
+  ClassDef(AliITSUClusterPix,2)
 };
 
+//______________________________________________________
+inline void AliITSUClusterPix::DecClUsage() {
+  // decrease cluster usage counter
+  int n=GetClUsage(); 
+  if (n) SetClUsage(--n);
+  //
+}
+
+//______________________________________________________
+inline void AliITSUClusterPix::SetClUsage(Int_t n) {
+  // set cluster usage counter
+  fNxNzN &= 0x00ffffff;
+  fNxNzN |= (n&0xff)<<24;
+  if (n<2) SetBit(kShared,kFALSE);
+  if (!n)  SetBit(kUsed,kFALSE);
+}
+
 #endif