In the question:
Save output in the TTree ROOT
I could not fix the problem, as in the moment
I understand much more the problem.
This question can help to solve the problem.
How to change the MakeFile to call library TTree
from ROOT to save the output from pythia in the file.root
What I did in the MakeFile:
FLAGS = -w -I/opt/root6/include -I../include -O2 -pedantic -W -Wall -Wshadow -fPIC -L../lib -Wl,-rpath,../lib -lpythia8 -ldl `root-config --cflags` -Wl,-rpath,./ -Wl,-rpath,/opt/root6/lib `/opt/root6/bin/root-config --glibs`
...
# Examples without external dependencies.
main% : main%.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $< -o $@ $(CXX_COMMON) $(FLAGS)
In the pythia/example this MakeFile there is one target
for main92.cc where work very well to save the output in the file.root
# ROOT (turn off all warnings for readability).
main91: $$@.cc $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
$(CXX) $< -o $@ -w -I$(ROOT_INCLUDE) $(CXX_COMMON)\
`$(ROOTBIN)root-config --cflags`\
-Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)root-config --glibs`
else
@echo "Error: $@ requires ROOT"
endif
main92: $$@.cc $(PREFIX_LIB)/libpythia8.a main92.so
ifeq ($(ROOT_USE),true)
$(CXX) $< main92.so -o $@ -w -I$(ROOT_INCLUDE) $(CXX_COMMON)\
`$(ROOTBIN)root-config --cflags` -Wl,-rpath,./\
-Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)root-config --glibs`
else
@echo "Error: $@ requires ROOT"
endif
main92.so: main92Dct.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $< -o $@ -w -I$(ROOT_INCLUDE) $(CXX_SHARED) $(CXX_COMMON)\
`$(ROOTBIN)root-config --cflags`
main92Dct.cc: main92.h main92LinkDef.h
export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(ROOT_LIB);\
$(ROOT_BIN)rootcint -f $@ -c -I$(PREFIX_INCLUDE) $^
# User-written examples for tutorials, without external dependencies.
mymain% : mymain%.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $< -o $@ $(CXX_COMMON)
# Internally used tests, without external dependencies.
test% : test%.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $< -o $@ $(CXX_COMMON)
# Clean.
clean:
@rm -f main[0-9][0-9]; rm -f out[0-9][0-9];\
rm -f main[0-9][0-9][0-9]; rm -f out[0-9][0-9][0-9];\
rm -f mymain[0-9][0-9]; rm -f myout[0-9][0-9];\
rm -f test[0-9][0-9][0-9]; rm -f *.dat\
rm -f weakbosons.lhe; rm -f Pythia8.promc; rm -f hist.root;\
rm -f *~; rm -f \#*; rm -f core*; rm -f *Dct.*; rm -f *.so;
I’m using root:
- ROOT 6.13/01 Built for linuxx8664gcc From heads/master@v6-11-02-2013-gd639b6a, Mar 09 2018, 10:15:08
Someone can help me?
Cheers, Andre