I am having trouble pushing back a leaf from my TChain into a histogram. The reason being, I have named my leaf with whitespace at the start of the name . This causes the name of the leaf not to be recognized when I try to fill the histogram.
The example code is here:
TChain mychainJ0("jetVariables"); mychainJ0.Add(filename); .. .. .. .. //I tried this but it didn't work mychainJ0.GetLeaf(" nt_jet_pt").SetName("nt_jet_pt"); myhist_MC10_Pythia_J0_pt = new TH1F("myhist_MC10_Pythia_J0_pt","", binnum, bins); canvas1.cd(1); mychainJ0->Draw(" nt_jet_pt>>myhist_MC10_Pythia_J0_pt");
The error message is as follows:
Error in TTreeFormula::Compile: Bad numerical expression : “nt_jet_pt”
I have tried to change the name of the leaf using the SetName() member function, but it doesn’t work for me. Perhaps I am using it incorrectly.
Does anyone have any idea how to solve the whitespace problem I am having?