Re: [ROOT] bitted words

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Aug 13 2001 - 17:18:15 MEST


Hi Luiz,

No need for a special function. Use the language.
If you have a variable 
  Int_t myvar;
you can test the bit 23 with
  if (myvar & 1<<23) then the bit is set

Note that if you have a ntuple, you can do:
  myntuple->draw("x","myvar & 1<<23")
This will histogram the variable x when the variable myvar has the bit 23 set.

Rene Brun

Luiz Martins Mundim Filho wrote:
> 
> Hi
> 
> I have a ntuple with an integer variable that is a bitter word and I
> need to know if the 23rd bit is 0 or 1.
> 
>  I looked for such a function on the User's Guide, on the tutorials and
> faq and could not find some thing on this subject. It would be great if
> there exist some simple way to get this information from a ntuple as a
> TMath function.
> 
> I tried
> 
> TBits Cgen = 2;
> Cgen->TestBitNunber(2)
> 
> But it did not work.
> 
> Can some one help me?
> 
> Thanks a lot
> 
> Luiz



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:57 MET