if I comment out the hist->Draw() row, my code compiles, and I get a ps file with a canavas in it. If I leave the line in (the hist is a TH1I empty, but defined histogram), the code crashes with output:
1
2
3
4
*** Break *** segmentation violation
Generating stack trace...
0x4271d5c8 in <unknown> from /lib/libc.so.6
IOT Trap
Hi Jimmy,
well I know that this should be that easy, but it is not working in my case. Some more details maybe will clear the situation:
My main program is in fortran, I am declaring all my C functions as external, and I am using C++/ROOT objects in them. So basically all my histos are declared as external and by calling some function I am filling them event by event. In the end of my loop I create in a separate function (let’s say my_end()) a root file and fill it with the histograms which are in the memory already. It works perfectly. In the same function I would like to fill some histograms in a ps file. Yes, you are right, this code:
produces a nice histo on a ps file if you run it as a macro, or compile it as a standalone piece of code. But no, in my case it again results in sigmentation fault… And I really have no idea why!