#define ALIITSUCLUSTERPIX_H
#include "AliCluster.h"
+#include <TMath.h>
class TGeoHMatrix;
class AliITSUGeomTGeo;
,kFrameTrk = BIT(17)
,kFrameGlo = BIT(18)
,kFrameBits = kFrameLoc|kFrameTrk|kFrameGlo
+ ,kSplit = BIT(19)
};
//
enum SortMode_t { // various modes
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 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&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)&0xff;}
+ Int_t GetClUsage() const {return (fNxNzN>>24)&0xff;}
//
- void SetNxNz(UChar_t nx,UChar_t nz) {fNxNz = (nx<<8) + nz;}
- Int_t GetNx() const {return fNxNz>>8;}
- Int_t GetNz() const {return fNxNz&0xff;}
+ void SetQ(UShort_t q) {fCharge = q;}
+ Int_t GetQ() const {return fCharge;}
//
virtual void Print(Option_t* option = "") const;
virtual const TGeoHMatrix* GetTracking2LocalMatrix() const;
virtual Bool_t IsEqual(const TObject* obj) const;
virtual Int_t Compare(const TObject* obj) const;
//
+ 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;}
+ static SortMode_t SortModeIdTrkYZ() {return kSortIdTrkYZ;}
+ static SortMode_t SortModeIdLocXZ() {return kSortIdLocXZ;}
//
protected:
//
- UShort_t fNxNz; // effective cluster size in X (1st byte) and Z (2nd byte) directions
+ UShort_t fCharge; // charge (for MC studies only)
+ Int_t fNxNzN; // effective cluster size in X (1st byte) and Z (2nd byte) directions
+ // 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)
};
+//______________________________________________________
+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 &= ((n&0xff)<<24)&0x00ffffff;
+ if (n<2) SetBit(kShared,kFALSE);
+ if (!n) SetBit(kUsed,kFALSE);
+}
+
#endif