TString Fill for TH1F

Hi All,
i have a problem i have a root file which contain some branches and i wanted to have new variable which in principle some thing to get from other 3 variables you may understand better from the attached root file and plotting script

i wander if i am doing the correct thing when i tried to build my new variable in the script called Link120 at line 113 or not?
if i changed the definition
from Link120 = "L"+std::to_string(tmlink[j])+"_S_"+std::to_string(tmsec[j])+"_R_"+std::to_string(tmwh[j]);
to Link120 = "L"+std::to_string(*tmlink)+"_S_"+std::to_string(*tmsec)+"_R_"+std::to_string(*tmwh);
i got different results which in principle makes more sense but i am not sure what is the best to access and array variable by just call it by Variable[j] or *Variable

Cheers
Ashraf

test_Run302485_output.root (153.8 KB)
drawplot.C (5.6 KB)

Hi,

This is rather a language question, but tmlink[j] gets you the jth element of the array, whereas *tmlink always gets you the first one. So I guess what you want is tmlink[j].

Cheers,

Enric

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