TPie graphics

Hello, I need to create some TPie chart. I am using ROOT from lxplus, I copied the macro piechart.C in my private area, and it works fine. But at the moment my graph has only three numbers, so I modify the macro from the tutorial leaving only 3 values (and 3 colours, of course!), but it does not work. This is what I get (see below). What’s happening?
Thanks for your help!
Cheers, Davide

*** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library “/lib/tls/libthread_db.so.1”.
Attaching to program: /proc/21188/exe, process 21188
(no debugging symbols found)…done.
(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
[New Thread -1208097088 (LWP 21188)]
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.

0x004637a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x03eed0f3 in __waitpid_nocancel () from /lib/tls/libc.so.6
#2 0x03e967b9 in do_system () from /lib/tls/libc.so.6
#3 0x003ed98d in system () from /lib/tls/libpthread.so.0
#4 0x00671b2b in TUnixSystem::Exec ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#5 0x006777d7 in TUnixSystem::StackTrace ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#6 0x006741be in TUnixSystem::DispatchSignals ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#7 0x0067424c in SigHandler ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#8 0x006734c9 in sighandler ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#9
#10 0x0390eeaa in TPieSlice::SetRadiusOffset ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libGraf.so
#11 0x0390da79 in TPie::SetEntryRadiusOffset ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libGraf.so
#12 0x03965052 in G__G__Graf_203_0_48 ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libGraf.so
#13 0x00b4a623 in Cint::G__ExceptionWrapper ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#14 0x00bdf620 in G__execute_call ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#15 0x00bdf932 in G__call_cppfunc ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#16 0x00bc0497 in G__interpret_func ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#17 0x00baedcc in G__getfunction ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#18 0x00c95491 in G__getstructmem ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#19 0x00c8cf87 in G__getvariable ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#20 0x00b92dba in G__getitem ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#21 0x00b95d4f in G__getexpr ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#22 0x00c0f018 in G__exec_statement ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#23 0x00bc1f7f in G__interpret_func ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#24 0x00baec0e in G__getfunction ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#25 0x00b93104 in G__getitem ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#26 0x00b95d4f in G__getexpr ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#27 0x00b9f064 in G__calc_internal ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#28 0x00c1d607 in G__process_cmd ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCint.so
#29 0x0065fb27 in TCint::ProcessLine ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#30 0x0065fca8 in TCint::ProcessLineSynch ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#31 0x00594d77 in TApplication::ExecuteFile ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#32 0x00595107 in TApplication::ProcessFile ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#33 0x00592f6f in TApplication::ProcessLine ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libCore.so
#34 0x002c0371 in TRint::Run ()
from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00b/slc4_ia32_gcc34/root/lib/libRint.so
#35 0x08048d46 in main ()
Root > Function piechart_dvd() busy flag cleared

Could you post your script?

Rene

Hello Rene, you can find it here. Let me remind that I took the $ROOTSYS/tutorials/graphics/piechart.C script, I changed a bit the name and reduced the number of entries. In case it helps, I am using lxplus226 node.
Thanks for the moment.
Cheers,
Davide
piechart_dvd.C (1.49 KB)

You are referencing a pie slice that does not exist. Replace

pie1->SetEntryRadiusOffset( 4, 0.1); by

pie1->SetEntryRadiusOffset( 3, 0.1);
Anyhow, teh code should not crash. I have now protected the TPie setters against wrong slices values.

Rene

Hello, thanks it works.
Cheers,
Davide