ROOT.TTreeReaderValue function doesn't recognize double and ctypes.c_double type


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.26.10
Platform: Windows


Hello everyone!

I’m trying to use the ROOT.TTreeReaderValue function in pyROOT for a branch that contains data of type double.

If I put in ROOT.TTreeReaderValue(float), I get the following error:

Error in TTreeReaderValueBase::CreateProxy(): The branch TotWeight contains data of type double. It cannot be accessed by a TTreeReaderValue

If I put in ROOT.TTreeReaderValue(double), it just doesn’t recognize it, and I know that ROOT.Double class doesn’t exist anymore so I put in ROOT.TTreeReaderValue(ctypes.c_double) and it gave me the following error:

TypeError: ‘TTreeReaderValue<c_double>’ is not a known C++ class

Is there another way to work with double types?

Thank you in advance!!
Kirill

Hi Kirill,

check out this reply to a similar question: python - how to use TTreeReader in PyROOT - Stack Overflow

Thank you! I will be sure to check it out.

Cheers,
K