You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TTree is written properly to the TFile and I can draw all these variables using TTree::Draw. This works great ! But now I'd like to implement the event loop myself using a standard ROOT macro. I could not figure out a way to do so. It always seems to fail because of the missing dictionnary for the ROOTDataMult2 object.
Would you have an example ROOT macro that allows looping over TTree with structs inside ?
Alternatively, is it possible to create TTree with croot with simple variables only (ints, floats, ...) and arrays of simple variables, no structs (in order to avoid the "missing dictionnary" issue) ? I tried creating a branch with
_, err = t.tree.Branch("data", &var, bufsiz, 0)
where var is an int, but it fails saying that it expects a struct.
Thanks !
Emmanuel
The text was updated successfully, but these errors were encountered:
Thanks ! The creation of branches for simple variables (and arrays of simple variables) with Branch2 works fine. I can now implement myself the event loop with the TTreeReader class.
Hi Seb,
I created a TTree with croot using the following struct:
type ROOTDataMult2 struct {
Run uint32
Evt uint32
IChanAbs240 [2]uint16
Ampl [2]float64
Charge [2]float64
T20 [2]float64
T30 [2]float64
T80 [2]float64
NoLocMaxRisingFront [2]uint16
SampleTimes [999]float64
Pulse [2][999]float64
}
The TTree is written properly to the TFile and I can draw all these variables using TTree::Draw. This works great ! But now I'd like to implement the event loop myself using a standard ROOT macro. I could not figure out a way to do so. It always seems to fail because of the missing dictionnary for the ROOTDataMult2 object.
Would you have an example ROOT macro that allows looping over TTree with structs inside ?
Alternatively, is it possible to create TTree with croot with simple variables only (ints, floats, ...) and arrays of simple variables, no structs (in order to avoid the "missing dictionnary" issue) ? I tried creating a branch with
_, err = t.tree.Branch("data", &var, bufsiz, 0)
where var is an int, but it fails saying that it expects a struct.
Thanks !
Emmanuel
The text was updated successfully, but these errors were encountered: