Dear Rooters,
I would have a question on RooDataSets.
Is it possible to “extract” (or export) the corresponding TTree of a RooDataSet?
I tried the following:
TFile *fIn = new TFile("RooDataSet.root");
TTree *treeData = (TTree*)fIn->Get("data");
but as soon as I try to work with the TTree, I get a segmentation fault.
root [5] treeData->GetEntries()
*** Break *** segmentation violation
Attaching to program: /proc/10205/exe, process 10205
[Thread debugging using libthread_db enabled]
0xffffe410 in __kernel_vsyscall ()
#1 0x009e94a3 in __waitpid_nocancel () from /lib/libc.so.6
#2 0x0098e07b in do_system () from /lib/libc.so.6
#3 0x00ab3ccd in system () from /lib/libpthread.so.0
#4 0xf7a0fb0d in TUnixSystem::Exec(char const*) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#5 0xf7a14fab in TUnixSystem::StackTrace() () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#6 0xf7a15d7d in TUnixSystem::DispatchSignals(ESignals) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#7 0xf7a15e7d in SigHandler(ESignals) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#8 0xf7a0c782 in sighandler(int) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#9 <signal handler called>
#10 0xffffffe4 in ?? ()
#11 0xf66b52d1 in G__G__Tree_109_0_61(G__value*, char const*, G__param*, int) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libTree.so
#12 0xf6f892b6 in Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) ()
from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#13 0xf7049a7c in G__execute_call () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#14 0xf704ad56 in G__call_cppfunc () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#15 0xf7022f9c in G__interpret_func () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#16 0xf701226c in G__getfunction () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#17 0xf7104dd1 in G__getstructmem () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#18 0xf70fe506 in G__getvariable () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#19 0xf6fe22ef in G__getitem () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#20 0xf6fe8333 in G__getexpr () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#21 0xf7079bb0 in G__exec_statement () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#22 0xf6fcd29a in G__exec_tempfile_core () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#23 0xf6fcd579 in G__exec_tempfile_fp () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#24 0xf708275f in G__process_cmd () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCint.so
#25 0xf79ff1a4 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#26 0xf7924243 in TApplication::ProcessLine(char const*, bool, int*) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#27 0xf6d7a9d8 in TRint::HandleTermInput() () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libRint.so
#28 0xf6d7a495 in TTermInputHandler::Notify() () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libRint.so
#29 0xf6d7cc24 in TTermInputHandler::ReadNotify() () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libRint.so
#30 0xf7a13169 in TUnixSystem::CheckDescriptors() () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#31 0xf7a134c9 in TUnixSystem::DispatchOneEvent(bool) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#32 0xf7986b71 in TSystem::InnerLoop() () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#33 0xf798993b in TSystem::Run() () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#34 0xf7921de7 in TApplication::Run(bool) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libCore.so
#35 0xf6d7c704 in TRint::Run(bool) () from /afs/cern.ch/cms/sw/slc5_ia32_gcc434/lcg/root/5.22.00d-cms18/lib/libRint.so
#36 0x08048d55 in main ()
A debugging session is active.
Inferior 1 [process 10205] will be detached.
Quit anyway? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/10205/exe, process 10205
Root >
Has anyone an idea how to solve this issue?
Or is there a way to extract the corresponding TTree of a RooDataSet?!
best regards
Florian