Error when acessing data members of TNtuple

Hi
I am trying to access a TNtuple and get a error message which i do not understand.

My commands are

   [code] IVTuple = ROOT.TNtuple(self.GetUniqueID(), "IVTuple", varlist)  # IVTuple
    entries  = IVTuple.ReadFile(fileName)
    for Entry in IVTuple:
            voltage = Entry.Voltage[/code]

When running it on my Mac OS X 10.9.4 I get an TypeError with the message
"TypeError: attempt to bind ROOT object w/o class"

I did IVTuple.Print before running the loop and I get

[code]******************************************************************************
*Tree :IVCurve_98: IVTuple *
*Entries : 46 : Total = 2819 bytes File Size = 0 *

  •    :          : Tree compression factor =   1.00                       *
    

*Br 0 :Timestamp : Float_t *
*Entries : 46 : Total Size= 852 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *

*Br 1 :Voltage : Float_t *
*Entries : 46 : Total Size= 840 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *

*Br 2 :Current : Float_t *
*Entries : 46 : Total Size= 840 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
[/code]
So it looks ok.
I don’t have any idea what i can do now.

Could you please help?
Cheers
Felix

And I though I was going crazy ([url]Reading Tree in PyROOT
I would guess it has something to do with the 10.9.4 implementation? :confused:

Hi, I’ve been trying to understand this for the whole day.

I have the same problem on lxplus. So it is not something about OSX.

On my pc (Ubuntu linux - python2.7.6 - root 5.99/05) I can reed ntuples via commands like

for event in tree: print event.branchName

while on lxplus (root 5.34.19 - python 2.6.6) this raises the same error as you:

What is driving me crazy is that I used the same commands two days ago, with the same config, and it worked absolutely fine.

What is going on? I’m stuck on this!

EDIT: it is not even possible to read the ntuple through

for event in tree: print event.__getattr__('branchName')
or

for i in xrange(10): tree.GetEntry(i) print tree.__getattr__('branchName')
because it raises the same error!

Hi,

Updating to 5.34.20, everything seems to work fine again. :slight_smile:

Cheers

Hi,

yes … I’m not sure where these use cases are coming from all of a sudden (I don’t know whether it’s due to a change in ROOT I/O or due to the way certain files are written), but the basic problem was that TBranch::GetAddress() returns null if there is a TLeaf of the same name.

Cheers,
Wim