Hello, fellow rooters,
There are some older forum posts on this topic, but all the responses contain phrases like “at this time”, so I figure I’ll ask if anything’s changed.
I have a class which has a vector of Channel objects, each of which has a vector of Pulse objects. The Channel class has a member function which converts indices on the sampling digitizer to times, SampleToTime(int samp).
What I would like to do is call
tree->Draw("channels[].SampleToTime(channels[].pulses[].start_index)")
However, this results in obtaining the indices, as if I had called
tree->Draw("channels[].pulses[].start_index")
(Am I doing something wrong here? It seems to me that that should generate an error or at least a warning, not just silently ignore the function.)
But this would be a complicated loop, so maybe it is still not possible to define this behavior. What I thought should work, based on the TTree::Draw documentation, is
tree->Draw("channels[0].SampleToTime(channels[0].pulses[0].start_index)"
But this doesn’t work either; again the surrounding function is simply ignored. In this case there is no looping, and the argument to the function is numeric, which seems analagous to “event.GetTrack(fMax).GetPx()” mentioned in TTree::Draw. Does this not work when the class is contained in a vector?
Thanks,
~Ben[/code]