Hi,
Thanks for your help, I hadn’t seen this post.
When I try to implement similarly I get an issue with saving the histograms.
Here is the current code:
import ROOT
init_dir = '/work/pi_mjrm_umass_edu/LNV_collider/AnalysisOutput/'
def combineHistos(start_dir=init_dir):
eventTypes = ['LNVF', 'ZZ2j', 'WZ2j', 'ttbar', 'W3j']
Stack = ROOT.THStack('WjPair', 'Inv_Mass_2Jets_close_to_W')
# ROOT.gStyle.SetPalette(ROOT.kOcean)
Files = []
for typ in eventTypes:
# print(type(typ))
# print(type(init_dir))
filepath = init_dir+typ+'/plots/Mass_2jW.root'
Files.append(ROOT.TFile.Open(filepath))
LNVHisto = Files[0].Get('Inv_Mass_2Jets_close_to_W')
LNVHisto.SetFillColor(ROOT.kRed)
LNVHisto.SetLineColor(ROOT.kBlack)
LNVHisto.SetStats(0)
ZZHisto = Files[1].Get('Inv_Mass_2Jets_close_to_W')
ZZHisto.SetFillColor(ROOT.kGreen+1)
ZZHisto.SetLineColor(ROOT.kBlack)
ZZHisto.SetStats(0)
WZHisto = Files[2].Get('Inv_Mass_2Jets_close_to_W')
WZHisto.SetFillColor(ROOT.kGreen+3)
WZHisto.SetLineColor(ROOT.kBlack)
WZHisto.SetStats(0)
ttbarHisto = Files[3].Get('Inv_Mass_2Jets_close_to_W')
ttbarHisto.SetFillColor(ROOT.kBlue)
ttbarHisto.SetLineColor(ROOT.kBlack)
ttbarHisto.SetStats(0)
W3Histo = Files[4].Get('Inv_Mass_2Jets_close_to_W')
W3Histo.SetFillColor(ROOT.kCyan)
W3Histo.SetLineColor(ROOT.kBlack)
W3Histo.SetStats(0)
print("i have it")
Stack.Add(LNVHisto)
Stack.Add(ZZHisto)
Stack.Add(WZHisto)
Stack.Add(ttbarHisto)
Stack.Add(W3Histo)
print("I added them")
legend = ROOT.TLegend(0.7,0.7,0.9,0.9)
legend.AddEntry(LNVHisto, "signal", "l")
legend.AddEntry(ZZHisto, "Diboson: ZZ2j", 'l')
legend.AddEntry(WZHisto, "Diboson: WZ2j", 'l')
legend.AddEntry(ttbarHisto, "JetFake: ttbar", "l")
legend.AddEntry(W3Histo, "JetFake: W+3j", 'l')
# can = ROOT.TCanvas('Canvas')
# can.cd()
# Stack.Draw()
# legend.Draw()
# ROOT.gPad.BuildLegend()
# Stack.GetXaxis().SetTitle("#Delta m_{jj} (GeV)")
# can.Print(init_dir+'/plots/stackTest.png')
# Stack.SaveAs(init_dir+'/plots/stackTest.root')
return legend, Stack
if __name__=='__main__':
eventTypes = ['LNVF', 'ZZ2j', 'WZ2j', 'ttbar', 'W3j']
leg, stack = combineHistos(eventTypes)
can = ROOT.TCanvas('Canvas')
can.cd()
stack.Draw()
leg.Draw()
can.Print(init_dir+'/plots/stackTest.png')
stack.SaveAs(init_dir+'plots/stackTest.root')
This produces a segmentation fault
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
Thread 2 (Thread 0x786b408006c0 (LWP 122751) "python3"):
#0 0x0000786b50698d61 in __futex_abstimed_wait_common64 (private=40025, cancel=true, abstime=0x786b407ff9b0, op=137, expected=0, futex_word=0x786b50eb6710 <_PyRuntime+432>) at ./nptl/futex-internal.c:57
#1 __futex_abstimed_wait_common (cancel=true, private=40025, abstime=0x786b407ff9b0, clockid=22069, expected=0, futex_word=0x786b50eb6710 <_PyRuntime+432>) at ./nptl/futex-internal.c:87
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word
entry=0x786b50eb6710 <_PyRuntime+432>, expected=expected
entry=0, clockid=clockid
entry=1, abstime=abstime
entry=0x786b407ff9b0, private=private
entry=0) at ./nptl/futex-internal.c:139
#3 0x0000786b5069bc7e in __pthread_cond_wait_common (abstime=0x786b407ff9b0, clockid=1, mutex=0x786b50eb6718 <_PyRuntime+440>, cond=0x786b50eb66e8 <_PyRuntime+392>) at ./nptl/pthread_cond_wait.c:503
#4 ___pthread_cond_timedwait64 (cond=cond
entry=0x786b50eb66e8 <_PyRuntime+392>, mutex=mutex
entry=0x786b50eb6718 <_PyRuntime+440>, abstime=abstime
entry=0x786b407ff9b0) at ./nptl/pthread_cond_wait.c:652
#5 0x0000786b50bacabf in PyCOND_TIMEDWAIT (us=<optimized out>, mut=0x786b50eb6718 <_PyRuntime+440>, cond=0x786b50eb66e8 <_PyRuntime+392>) at Python/condvar.h:73
#6 take_gil (tstate=tstate
entry=0x5635d3946cb0) at Python/ceval_gil.h:231
#7 0x0000786b50bacfc2 in PyEval_RestoreThread (tstate=tstate
entry=0x5635d3946cb0) at Python/ceval.c:521
#8 0x0000786b50c7e1a4 in pysleep (timeout=<optimized out>) at ./Modules/timemodule.c:2168
#9 time_sleep (self=<optimized out>, timeout_obj=<optimized out>) at ./Modules/timemodule.c:383
#10 0x0000786b50afe2d6 in cfunction_vectorcall_O (func=0x786b501a7470, args=0x786b40f7c1e8, nargsf=<optimized out>, kwnames=<optimized out>) at Objects/methodobject.c:514
#11 0x0000786b50aab287 in _PyObject_VectorcallTstate (kwnames=0xf1, nargsf=<optimized out>, args=0x786b40f7c1e8, callable=0x786b501a7470, tstate=0x5635d3946cb0) at ./Include/internal/pycore_call.h:92
#12 PyObject_Vectorcall (callable=callable
entry=0x786b501a7470, args=args
entry=0x786b40f7c1e8, nargsf=<optimized out>, kwnames=kwnames
entry=0x0) at Objects/call.c:299
#13 0x0000786b50a4ca32 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:4769
#14 0x0000786b50badd58 in _PyEval_EvalFrame (throwflag=0, frame=0x786b40f7c188, tstate=0x5635d3946cb0) at ./Include/internal/pycore_ceval.h:73
#15 _PyEval_Vector (tstate=0x5635d3946cb0, func=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>) at Python/ceval.c:6434
#16 0x0000786b50a4f458 in do_call_core (use_tracing=<optimized out>, kwdict=0x786b501a8240, callargs=0x786b501b99f0, func=0x786b5001d580, tstate=<optimized out>) at Python/ceval.c:7352
#17 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:5376
#18 0x0000786b50badd58 in _PyEval_EvalFrame (throwflag=0, frame=0x786b40f7c020, tstate=0x5635d3946cb0) at ./Include/internal/pycore_ceval.h:73
#19 _PyEval_Vector (tstate=0x5635d3946cb0, func=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>) at Python/ceval.c:6434
#20 0x0000786b50aadcc4 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=1, args=0x786b407ffe18, callable=0x786b414e56c0, tstate=0x5635d3946cb0) at ./Include/internal/pycore_call.h:92
#21 method_vectorcall (method=<optimized out>, args=0x786b50ec4b90 <_PyRuntime+58928>, nargsf=<optimized out>, kwnames=0x0) at Objects/classobject.c:67
#22 0x0000786b50c7cb82 in thread_run (boot_raw=0x5635d38c5a70) at ./Modules/_threadmodule.c:1124
#23 0x0000786b50c09ffb in pythread_wrapper (arg=<optimized out>) at Python/thread_pthread.h:241
#24 0x0000786b5069ca94 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
#25 0x0000786b50729c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 1 (Thread 0x786b5084fe80 (LWP 122733) "python3"):
#0 0x0000786b507107e3 in __GI___wait4 (pid=122767, stat_loc=stat_loc
entry=0x7fff4a1e8fd8, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1 0x0000786b507108eb in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7fff4a1e8fd8, options=options
entry=0) at ./posix/waitpid.c:38
#2 0x0000786b506585ab in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:172
#3 0x0000786b4fd82a47 in TUnixSystem::StackTrace() () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libCore.so.6.30
#4 0x0000786b505490f3 in (anonymous namespace)::TExceptionHandlerImp::HandleException(int) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy_backend3_11.so.6.30
#5 0x0000786b4fd82209 in TUnixSystem::DispatchSignals(ESignals) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libCore.so.6.30
#6 <signal handler called>
#7 0x0000000000000000 in ?? ()
#8 0x0000786b3f68fa9a in TLegend::PaintPrimitives() () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGraf.so.6.30.06
#9 0x0000786b3f52cea3 in TPad::Paint(char const*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGpad.so.6.30.06
#10 0x0000786b3f5274bc in TPad::Print(char const*, char const*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGpad.so.6.30.06
#11 0x0000786b3f518201 in TPad::SaveAs(char const*, char const*) const () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGpad.so.6.30.06
#12 0x0000786b4081004d in ?? ()
#13 0x00007fff4a1ec6a0 in ?? ()
#14 0x00007fff4a1ec390 in ?? ()
#15 0x00005635d4454790 in ?? ()
#16 0x00000001d4454790 in ?? ()
#17 0x0000000000000001 in ?? ()
#18 0x0000786b50552ed8 in WrapperCall(long, unsigned long, void*, void*, void*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy_backend3_11.so.6.30
#19 0x0000786b4ffa0cc6 in CPyCppyy::(anonymous namespace)::VoidExecutor::Execute(long, void*, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#20 0x0000786b4ff8acbb in CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) [clone .isra.0] () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#21 0x0000786b4ff8e6c8 in CPyCppyy::CPPMethod::ExecuteProtected(void*, long, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#22 0x0000786b4ff8c25d in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#23 0x0000786b4ff8d233 in CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object*, _object*, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#24 0x0000786b4ff92c3f in CPyCppyy::(anonymous namespace)::mp_call(CPyCppyy::CPPOverload*, _object*, _object*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#25 0x0000786b50aaac41 in _PyObject_MakeTpCall (tstate=0x786b50edef18 <_PyRuntime+166328>, callable=callable
entry=0x786b409aa1a0, args=args
entry=0x786b5093e078, nargs=1, keywords=keywords
entry=0x0) at Objects/call.c:214
#26 0x0000786b50aab2bf in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x786b5093e078, callable=0x786b409aa1a0, tstate=<optimized out>) at ./Include/internal/pycore_call.h:90
#27 0x0000786b50a4ca32 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:4769
#28 0x0000786b50badbec in _PyEval_EvalFrame (throwflag=0, frame=0x786b5093e020, tstate=0x786b50edef18 <_PyRuntime+166328>) at ./Include/internal/pycore_ceval.h:73
#29 _PyEval_Vector (args=0x0, argcount=0, kwnames=0x0, locals=0x786b50007840, func=0x786b501d6f20, tstate=0x786b50edef18 <_PyRuntime+166328>) at Python/ceval.c:6434
#30 PyEval_EvalCode (co=co
entry=0x786b50129630, globals=globals
entry=0x786b50007840, locals=locals
entry=0x786b50007840) at Python/ceval.c:1148
#31 0x0000786b50bf8d39 in run_eval_code_obj (locals=0x786b50007840, globals=0x786b50007840, co=0x786b50129630, tstate=0x786b50edef18 <_PyRuntime+166328>) at Python/pythonrun.c:1710
#32 run_mod (mod=<optimized out>, filename=filename
entry=0x786b50196230, globals=globals
entry=0x786b50007840, locals=locals
entry=0x786b50007840, flags=flags
entry=0x7fff4a1ecb58, arena=arena
entry=0x786b5011b8b0) at Python/pythonrun.c:1731
#33 0x0000786b50bfa6ce in pyrun_file (flags=0x7fff4a1ecb58, closeit=1, locals=0x786b50007840, globals=0x786b50007840, start=257, filename=0x786b50196230, fp=<optimized out>) at Python/pythonrun.c:1626
#34 _PyRun_SimpleFileObject (fp=fp
entry=0x5635d0337370, filename=filename
entry=0x786b50196230, closeit=closeit
entry=1, flags=flags
entry=0x7fff4a1ecb58) at Python/pythonrun.c:440
#35 0x0000786b50bfad50 in _PyRun_AnyFileObject (fp=0x5635d0337370, filename=filename
entry=0x786b50196230, closeit=closeit
entry=1, flags=flags
entry=0x7fff4a1ecb58) at Python/pythonrun.c:79
#36 0x0000786b50c1be00 in pymain_run_file_obj (skip_source_first_line=0, filename=0x786b50196230, program_name=0x786b50007a30) at Modules/main.c:360
#37 pymain_run_file (config=0x786b50ec4f60 <_PyRuntime+59904>) at Modules/main.c:379
#38 pymain_run_python (exitcode=0x7fff4a1ecb50) at Modules/main.c:601
#39 Py_RunMain () at Modules/main.c:680
#40 0x0000786b50c1c39e in pymain_main (args=0x7fff4a1ecc70) at Modules/main.c:710
#41 Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:734
#42 0x0000786b5062a1ca in __libc_start_call_main (main=main
entry=0x5635cf706060 <main>, argc=argc
entry=2, argv=argv
entry=0x7fff4a1ece08) at ../sysdeps/nptl/libc_start_call_main.h:58
#43 0x0000786b5062a28b in __libc_start_main_impl (main=0x5635cf706060 <main>, argc=2, argv=0x7fff4a1ece08, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff4a1ecdf8) at ../csu/libc-start.c:360
#44 0x00005635cf706095 in _start ()
===========================================================
The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#7 0x0000000000000000 in ?? ()
#8 0x0000786b3f68fa9a in TLegend::PaintPrimitives() () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGraf.so.6.30.06
#9 0x0000786b3f52cea3 in TPad::Paint(char const*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGpad.so.6.30.06
#10 0x0000786b3f5274bc in TPad::Print(char const*, char const*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGpad.so.6.30.06
#11 0x0000786b3f518201 in TPad::SaveAs(char const*, char const*) const () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libGpad.so.6.30.06
#12 0x0000786b4081004d in ?? ()
#13 0x00007fff4a1ec6a0 in ?? ()
#14 0x00007fff4a1ec390 in ?? ()
#15 0x00005635d4454790 in ?? ()
#16 0x00000001d4454790 in ?? ()
#17 0x0000000000000001 in ?? ()
#18 0x0000786b50552ed8 in WrapperCall(long, unsigned long, void*, void*, void*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy_backend3_11.so.6.30
#19 0x0000786b4ffa0cc6 in CPyCppyy::(anonymous namespace)::VoidExecutor::Execute(long, void*, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#20 0x0000786b4ff8acbb in CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) [clone .isra.0] () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#21 0x0000786b4ff8e6c8 in CPyCppyy::CPPMethod::ExecuteProtected(void*, long, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#22 0x0000786b4ff8c25d in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#23 0x0000786b4ff8d233 in CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object*, _object*, CPyCppyy::CallContext*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#24 0x0000786b4ff92c3f in CPyCppyy::(anonymous namespace)::mp_call(CPyCppyy::CPPOverload*, _object*, _object*) () from /modules/spack/packages/linux-ubuntu24.04-x86_64_v3/gcc-13.2.0/root-6.30.06-thrfpcvvbuqgtwvd3qvuythhw4jppu57/lib/root/libcppyy3_11.so
#25 0x0000786b50aaac41 in _PyObject_MakeTpCall (tstate=0x786b50edef18 <_PyRuntime+166328>, callable=callable
entry=0x786b409aa1a0, args=args
entry=0x786b5093e078, nargs=1, keywords=keywords
entry=0x0) at Objects/call.c:214
#26 0x0000786b50aab2bf in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x786b5093e078, callable=0x786b409aa1a0, tstate=<optimized out>) at ./Include/internal/pycore_call.h:90
#27 0x0000786b50a4ca32 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:4769
#28 0x0000786b50badbec in _PyEval_EvalFrame (throwflag=0, frame=0x786b5093e020, tstate=0x786b50edef18 <_PyRuntime+166328>) at ./Include/internal/pycore_ceval.h:73
#29 _PyEval_Vector (args=0x0, argcount=0, kwnames=0x0, locals=0x786b50007840, func=0x786b501d6f20, tstate=0x786b50edef18 <_PyRuntime+166328>) at Python/ceval.c:6434
#30 PyEval_EvalCode (co=co
entry=0x786b50129630, globals=globals
entry=0x786b50007840, locals=locals
entry=0x786b50007840) at Python/ceval.c:1148
#31 0x0000786b50bf8d39 in run_eval_code_obj (locals=0x786b50007840, globals=0x786b50007840, co=0x786b50129630, tstate=0x786b50edef18 <_PyRuntime+166328>) at Python/pythonrun.c:1710
#32 run_mod (mod=<optimized out>, filename=filename
entry=0x786b50196230, globals=globals
entry=0x786b50007840, locals=locals
entry=0x786b50007840, flags=flags
entry=0x7fff4a1ecb58, arena=arena
entry=0x786b5011b8b0) at Python/pythonrun.c:1731
#33 0x0000786b50bfa6ce in pyrun_file (flags=0x7fff4a1ecb58, closeit=1, locals=0x786b50007840, globals=0x786b50007840, start=257, filename=0x786b50196230, fp=<optimized out>) at Python/pythonrun.c:1626
#34 _PyRun_SimpleFileObject (fp=fp
entry=0x5635d0337370, filename=filename
entry=0x786b50196230, closeit=closeit
entry=1, flags=flags
entry=0x7fff4a1ecb58) at Python/pythonrun.c:440
#35 0x0000786b50bfad50 in _PyRun_AnyFileObject (fp=0x5635d0337370, filename=filename
entry=0x786b50196230, closeit=closeit
entry=1, flags=flags
entry=0x7fff4a1ecb58) at Python/pythonrun.c:79
#36 0x0000786b50c1be00 in pymain_run_file_obj (skip_source_first_line=0, filename=0x786b50196230, program_name=0x786b50007a30) at Modules/main.c:360
#37 pymain_run_file (config=0x786b50ec4f60 <_PyRuntime+59904>) at Modules/main.c:379
#38 pymain_run_python (exitcode=0x7fff4a1ecb50) at Modules/main.c:601
#39 Py_RunMain () at Modules/main.c:680
#40 0x0000786b50c1c39e in pymain_main (args=0x7fff4a1ecc70) at Modules/main.c:710
#41 Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:734
#42 0x0000786b5062a1ca in __libc_start_call_main (main=main
entry=0x5635cf706060 <main>, argc=argc
entry=2, argv=argv
entry=0x7fff4a1ece08) at ../sysdeps/nptl/libc_start_call_main.h:58
#43 0x0000786b5062a28b in __libc_start_main_impl (main=0x5635cf706060 <main>, argc=2, argv=0x7fff4a1ece08, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff4a1ecdf8) at ../csu/libc-start.c:360
#44 0x00005635cf706095 in _start ()
===========================================================
Traceback (most recent call last):
File "/home/dkennedy_umass_edu/LNV/MyFiles/LFVLNV/AnalysisAndSuch/combineHistos.py", line 81, in <module>
can.Print(init_dir+'/plots/stackTest.png')
TypeError: none of the 2 overloaded methods succeeded. Full details:
void TPad::Print(const char* filename, const char* option) =>
TypeError: takes at least 2 arguments (1 given)
void TPad::Print(const char* filename = "") =>
SegmentationViolation: segfault in C++; program state was reset
Looking at the Print() documentation. I changed the Print() line to can.Print(<file location>, 'png')
. This, in turn still produces a segmentation fault, but this time telling my the reverse – that Print() takes 1 argument and 2 were given.