Hi experts
I have an output root file which I try to fill with two TTrees using the code attached below.
The code compiles and runs successfully and I can see the TTrees in the TBrowser window and also the Branches make complete sense. (Please see the screenshot). In addition to my TTrees, I see some additional histograms, which I never asked for.
Now when I try to print the contents of my root file, I get this:
Basically I’m not able to see the TTrees which I see in the TBrowser window. If I try , I get this error:
-bash-4.1$ root -l RecoEfficiency.root
root [0]
Attaching file RecoEfficiency.root as _file0...
(TFile *) 0x31808c0
root [1] TCanvas c1;
root [2] Matchtree->Draw("MC_Track_StartX_det>>h0");
input_line_67:2:3: error: use of undeclared identifier 'Matchtree'
(Matchtree->Draw("MC_Track_StartX_det>>h0"))
^
Error in <HandleInterpreterException>: Error evaluating expression (Matchtree->Draw("MC_Track_Length>>h0")).
Execution of your code was aborted.
I have no idea what’s going on.
When I use the TBrowser window and click on the TTree while I use the above command, only then will the TTree appear in the canvas. I’m just thinking why does it have to depend on the TBrowser to work at all?