String operations in TTree::Draw()?

Hello ROOTers,

Is there a simple way to do

tree->Draw("a:TString(b,0,3)")

??

I played a bit around with TTreeFormula, but didn’t get it to work. When workarounding I created a Looper-Method (by MakeClass) and tried to do a

TH2I *h = new TH2I("h","h",10,0,10,10,0,10);
for(...){
...
h->Fill(myString, a)
}

which doesn’t work either… it seem that TH2::Fill(char*, Double_t) is protected,

Oh before I forget this:
Would be nice to get it running on Windows with root5.very-old.34/36

Thanks
George

It seems public in the current implementation:
https://root.cern/doc/master/classTH2.html#ac2f764220c9711153f8a6070ca2715d0

Anyhow it doesn’t work in root 5.
When I’m doing

TH2I *h = new TH2I("h","h",100,0,100,500,0,500);   
for (...){
(..)
h->Fill(myCstring,myFloat);
}

I’m getting:
Error in TH2I::Fill: Invalid signature - do nothing

Any other suggestions?

Georg

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.