public:
enum ETRDtrackletBuffers {
- kNtb = 31 // max clusters/pad row
+ kNbits = 6 // bits to store number of clusters
+ ,kMask = 0x3f // bit mask
+ ,kNtb = 31 // max clusters/pad row
,kNclusters = 2*kNtb // max number of clusters/tracklet
,kNslices = 10 // max dEdx slices
};
};
enum ETRDtrackletError {
kAttachClFound = 1 // not enough clusters found
- ,kAttachRow // found row < 0
+ ,kAttachRowGap // found gap attached rows
+ ,kAttachRow // found 3 rows
,kAttachMultipleCl // multiple clusters attached to time bin
,kAttachClAttach // not enough clusters attached
};
Int_t GetIndexes(Int_t i) const{ return i<0 || i>=kNclusters ? -1 : fIndexes[i];}
Int_t GetLabels(Int_t i) const { return fLabels[i];}
Float_t GetMomentum(Float_t *err = NULL) const;
- Int_t GetN() const { return (Int_t)fN&0x1f;}
+ Int_t GetN() const { return (Int_t)fN&kMask;}
Int_t GetN2() const { return GetN();}
- Int_t GetNUsed() const { return Int_t((fN>>5)&0x1f);}
- Int_t GetNShared() const { return Int_t((fN>>10)&0x1f);}
+ Int_t GetNUsed() const { return Int_t((fN>>kNbits)&kMask);}
+ Int_t GetNShared() const { return Int_t(((fN>>kNbits)>>kNbits)&kMask);}
Float_t GetQuality(Bool_t kZcorr) const;
Float_t GetPadLength() const { return fPad[0];}
Float_t GetPadWidth() const { return fPad[1];}
inline AliTRDcluster* PrevCluster();
void Print(Option_t *o = "") const;
inline void ResetClusterIter(Bool_t forward = kTRUE);
- void Reset();
+ void Reset(Option_t *opt="");
void SetC(Float_t c) { fC = c;}
void SetChi2(Float_t chi2) { fChi2 = chi2;}
inline void SetN(Int_t n);
inline void SetNUsed(Int_t n);
inline void SetNShared(Int_t n);
+ inline void Swap(Int_t &n1, Int_t &n2);
+ inline void Swap(Double_t &d1, Double_t &d2);
const AliTRDReconstructor *fkReconstructor;//! local reconstructor
AliTRDcluster **fClusterIter; //! clusters iterator
inline void AliTRDseedV1::SetN(Int_t n)
{
if(n<0 || n>kNclusters) return;
- UInt_t mask(0x3f);
- fN &= ~mask;
- fN |= (n&mask);
+ fN &= ~kMask;
+ fN |= (n&kMask);
}
//____________________________________________________________
inline void AliTRDseedV1::SetNUsed(Int_t n)
{
if(n<0 || n>kNclusters) return;
- UInt_t mask(0x3f<<6);
+ UInt_t mask(kMask<<kNbits);
fN &= ~mask;
- n <<= 6; fN |= (n&mask);
+ n=n<<kNbits; fN |= (n&mask);
}
//____________________________________________________________
inline void AliTRDseedV1::SetNShared(Int_t n)
{
if(n<0 || n>kNclusters) return;
- UInt_t mask(0x3f<<12);
+ UInt_t mask((kMask<<kNbits)<<kNbits);
fN &= ~mask;
- n <<= 12; fN |= (n&mask);
+ n = (n<<kNbits)<<kNbits; fN|=(n&mask);
+}
+
+//____________________________________________________________
+inline void AliTRDseedV1::Swap(Int_t &n1, Int_t &n2)
+{
+// swap values of n1 with n2
+ Int_t tmp(n1);
+ n1=n2; n2=tmp;
+}
+
+//____________________________________________________________
+inline void AliTRDseedV1::Swap(Double_t &d1, Double_t &d2)
+{
+// swap values of d1 with d2
+ Double_t tmp(d1);
+ d1=d2; d2=tmp;
}