For starting data processing I using the following script:
{
gROOT->ProcessLine(“.L mc_base.C+”);
gROOT->ProcessLine(“.L hmanager.C+”);
gROOT->ProcessLine(“.L inclu_proc.C+”);TChain chain(“t1”);
chain.Add(“/sweet/home/shtol/snd2k/reldev/work/tup/mc/hadronisr1E4-nochrcut/*.root”);
incluproc* proc = new incluproc(&chain,“inclhists_mc900.root”);
proc->Loop();
}
Running of this script gives the following result:
[shtol@sndbb2 macro]$ root -l test_start.C
Processing test_start.C…
/sweet/home/shtol/root/macro/./test_start.C:11:24: error: unknown type name ‘incluproc’
incluproc* proc = new incluproc(&chain,“inclhists_mc900.root”);
^
/sweet/home/shtol/root/macro/./test_start.C:13:2: error: use of undeclared identifier ‘proc’
proc->Loop();
^
[shtol@sndbb2 macro]
But if I process the same commands in command line, it works:
[shtol@sndbb2 macro]$ root -l
root [0] gROOT->ProcessLine(“.L mc_base.C+”);
root [1] gROOT->ProcessLine(“.L hmanager.C+”);
root [2] gROOT->ProcessLine(“.L inclu_proc.C+”);
root [3] TChain chain(“t1”);
root [4] chain.Add("/sweet/home/shtol/snd2k/reldev/work/tup/mc/hadronisr1E4-nochrcut/.root");
root [5] incluproc proc = new incluproc(&chain,“inclhists_mc900.root”);
root [6]
tab completion not implemented for this context
root [6] proc->Loop();
… Loop output…
Why it works from command line, but doesn’t works as a script?
Thanks.
ROOT Version: 6.22/0
Platform: CentOS 8
Compiler: Built for linuxx8664gcc