root [1] .L src/hsimple.cxx++
Info in <ACLiC>: script has already been loaded in interpreted mode
Info in <ACLiC>: unloading ${HOME}/src/hsimple.cxx and compiling it
Info in <TUnixSystem::ACLiC>: creating shared library ${HOME}/src/hsimple_cxx.so
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
Error in <ACLiC>: Compilation failed!
There must be something in the session which is possible to clean to be able to compile again.
The original problem was with the TTreeDraw function
Let’s say there are two files with functions. The first one is hsimple1.cxx
double hsimple1() {
return px1;
}
The second file is hsimple2.cxx
double hsimple2() {
return px2;
}
where px1 and px2 are branches of by tree.
Then I do
tree->Draw("hsimple1.cxx"); // Works
tree->Draw("hsimple2.cxx"); // Error
It fails because of some conflict…
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <ACLiC>: modified script has already been compiled and loaded
Info in <ACLiC>: it will be regenerated and reloaded!
Info in <TUnixSystem::ACLiC>: creating shared library ${HOME}/generatedSel_h.so
c++: error: ${HOME}/generatedSel_h.so: No such file or directory
Error in <ACLiC>: Compilation failed!
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
Indeed generatedSel_h.so from the first command is deleted, the new one is not created.
For curiosity I tried with the ntuple stored in the standard example “hsimple.root”. I replaced px1 by px in hsimple1.cxx and px2 by py in hsimple2.cxx. I get the following:
$ root
--------------------------------------------------------------------
| Welcome to ROOT 6.15/01 http://root.cern.ch |
| (c) 1995-2018, The ROOT Team |
| Built for macosx64 |
| From heads/master@v6-13-04-1008-g5028941cbe, Aug 24 2018, 08:26:52 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
--------------------------------------------------------------------
root [0] ntuple->Draw("hsimple1.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/couet/roottest/./generatedSel_h.so
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [1] ntuple->Draw("hsimple2.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <ACLiC>: modified script has already been compiled and loaded
Info in <ACLiC>: it will be regenerated and reloaded!
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/couet/roottest/./generatedSel_h.so
root [2]
Attaching file hsimple.root as _file0...
(TFile *) 0x248f160
root [1] ntuple->Draw("hsimple1.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <TUnixSystem::ACLiC>: creating shared library /home/mikhasenko/Documents/dynamics-3pi-plots/./generatedSel_h.so
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [2] ntuple->Draw("hsimple2.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <ACLiC>: modified script has already been compiled and loaded
Info in <ACLiC>: it will be regenerated and reloaded!
Info in <TUnixSystem::ACLiC>: creating shared library /home/mikhasenko/Documents/dynamics-3pi-plots/./generatedSel_h.so
c++: error: /home/mikhasenko/Documents/dynamics-3pi-plots/generatedSel_h.so: No such file or directory
Error in <ACLiC>: Compilation failed!