X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDrawStream.h;h=515a3b94c5555d2070d222c1421a9fc173c72e28;hb=8f7b1226e6156cef90cac09edaf8b085c8e6f503;hp=20cdcd3424cc9b6e208a41f838b37974de6fdcb2;hpb=0508ca3105262265813a209864d368a92026f78c;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDrawStream.h b/TRD/AliTRDrawStream.h index 20cdcd3424c..515a3b94c55 100644 --- a/TRD/AliTRDrawStream.h +++ b/TRD/AliTRDrawStream.h @@ -41,6 +41,8 @@ class AliTRDrawStream : public AliTRDrawStreamBase Int_t NextChamber(AliTRDdigitsManager *digMgr, UInt_t ** /* trackletContainer */, UShort_t ** /* errorContainer */); + Bool_t ConnectTracklets(TTree *trklTree); + // legacy code, to be removed Bool_t SetRawVersion(Int_t) { return kTRUE; } void SetSharedPadReadout(Bool_t) {} @@ -98,7 +100,7 @@ class AliTRDrawStream : public AliTRDrawStreamBase // ADC mask decoding Int_t GetActiveChannels(UInt_t adcmask) const { return 0x1fffff & adcmask >> 4; } - Int_t GetNActiveChannelsFromMask(UInt_t adcmask) const; // { Int_t nch = 0; for (Int_t i = 0; i < 21; i++) if ((GetActiveChannels(adcmask) & 1 << i)) nch++; return nch; } + inline Int_t GetNActiveChannelsFromMask(UInt_t adcmask) const; // { Int_t nch = 0; for (Int_t i = 0; i < 21; i++) if ((GetActiveChannels(adcmask) & 1 << i)) nch++; return nch; } Int_t GetNActiveChannels(UInt_t adcmask) const { return (0x1f & ~(adcmask >> 25)); } Int_t CouldBeADCmask(UInt_t adcmask) const { return ((0xf & adcmask) == 0xc && (0x3 & adcmask >> 30) == 0x1); } @@ -195,4 +197,14 @@ class AliTRDrawStream : public AliTRDrawStreamBase ClassDef(AliTRDrawStream, 0); }; +Int_t AliTRDrawStream::GetNActiveChannelsFromMask(UInt_t adcmask) const +{ + // return number of active bits in the ADC mask + + adcmask = GetActiveChannels(adcmask); + adcmask = adcmask - ((adcmask >> 1) & 0x55555555); + adcmask = (adcmask & 0x33333333) + ((adcmask >> 2) & 0x33333333); + return (((adcmask + (adcmask >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24; +} + #endif