Hi,
I am trying to create a TH1F from a TTree, extracting leaves with a certain condition (in my datas I have some with variables flag=0 and flag=1).
TTree *T = (TTree*)f.Get("mytree"); //open the tree
TH1F *h = new TH1F("h","h",100,0.,0.);
TCanvas *myCanvas = new TCanvas();
T->Draw("flux>>h","energy>>h","flag == 1"); //draw histograms with var flag==1
As you may see I am trying to plot a spectrum (a flux vs an energy), is a TH1 adapted ? Or should I rather use a TH2F ?
I have this error : 'Bad numerical expression : βhβ β followed by a β Variable compilation failed: {flux,energy>>h} '.
I donβt get my mistake hence asking for help please, thanks