Hello Rooters,
I have a few root files, which containe trees with some values. I need to open the tree, apply for value inside formula and plot the result of this formula. I use th following code for it
sprintf(canvas11_name[detector],“Target_%d_TYPES”,detector);
ccxzoom = new TCanvas (canvas11_name[detector],canvas11_name[detector],1000,1000);
sprintf(tree1_name[detector],“treetype2_%d”,detector);
TChain ch1(tree1_name[detector]);
ch1.Add("/afs/cern.ch/exp/ntof/users/ag9/ppac/03/Files/Run4960_ppac_v1.root");
ch1.Add("/afs/cern.ch/exp/ntof/users/ag9/ppac/03/Files/Run4962_ppac_v1.root");
ch1.Add("/afs/cern.ch/exp/ntof/users/ag9/ppac/03/Files/Run4963_ppac_v1.root");
TH1F h1 = new TH1F(“h1”,“TYPE-2 Center”,nbbin,es,ef);
n1 = ch1->GetEntries();
ch1->Draw("log10(939.56(sqrt(1/(1-pl*pl/0.0009/((t0+t1)/2-55900+6210)/((t0+t1)/2-55900+6210)))-1)*1000000)>>h1",G0&&G1&&A01&&PCT2,"",n1);
h1->SetXTitle(“Log(En, eV)”);
parameters t0 and t1 contained in root files, but pl is the variable discribed in code as float and has some value. G0&&G1&&A01&&PCT2 - are the cuts discribed before in code.
But in this case if I start code message hapens “unknown pl”.
Do you know how is it possible to make calculations (using external in respect to trees variable) with values in trees using Chain and plot result of it after?