Segmentation error break

Dear developers,
I am running a macro to make a 2D histogram using tree. But I am getting a error below


" *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007fe73e59f82e in waitpid () from /lib64/libc.so.6
#1  0x00007fe73e531479 in do_system () from /lib64/libc.so.6
#2  0x00007fe73f242b04 in TUnixSystem::StackTrace() () from /usr/lib64/root/libCore.so.5.34
#3  0x00007fe73f241f23 in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib64/root/libCore.so.5.34
#4  <signal handler called>
#5  0x00007fe73dca7cf5 in G__LD_p0_float () from /usr/lib64/root/libCint.so.5.34
#6  0x00007fe73dbddb03 in G__exec_asm () from /usr/lib64/root/libCint.so.5.34
#7  0x00007fe73dc9cfc0 in ?? () from /usr/lib64/root/libCint.so.5.34
#8  0x00007fe73dc98651 in G__exec_statement () from /usr/lib64/root/libCint.so.5.34
#9  0x00007fe73dc49dd9 in G__interpret_func () from /usr/lib64/root/libCint.so.5.34
#10 0x00007fe73dc37918 in G__getfunction () from /usr/lib64/root/libCint.so.5.34
#11 0x00007fe73dc1612e in G__getitem () from /usr/lib64/root/libCint.so.5.34
#12 0x00007fe73dc1acb8 in G__getexpr () from /usr/lib64/root/libCint.so.5.34
#13 0x00007fe73dc241c8 in G__calc_internal () from /usr/lib64/root/libCint.so.5.34
#14 0x00007fe73dca3275 in G__process_cmd () from /usr/lib64/root/libCint.so.5.34
#15 0x00007fe73f202c46 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /usr/lib64/root/libCore.so.5.34
#16 0x00007fe73f2003b3 in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /usr/lib64/root/libCore.so.5.34
#17 0x00007fe73f167126 in TApplication::ExecuteFile(char const*, int*, bool) () from /usr/lib64/root/libCore.so.5.34
#18 0x00007fe73f1665d3 in TApplication::ProcessLine(char const*, bool, int*) () from /usr/lib64/root/libCore.so.5.34
#19 0x00007fe73edb6811 in TRint::Run(bool) () from /usr/lib64/root/libRint.so.5.34
#20 0x000000000040103c in main ()
===========================================================


The crash is most likely caused by a problem in your script.
Try to compile it (.L myscript.C+g) and fix any errors.
If that does not help then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.


Root > Function pt_eta_nonIsomu() busy flag cleared "

<a class="attachment" href="/uploads/default/original/2X/7/7c149f14b7e22340fdaef067baf641e5e7c7d523.cc">pt_eta_nonIsomu.cc</a> (850 Bytes)

Best regards,
Nabila

Post here the output of this: [code]{
TFile *f = TFile::Open(“May26_1.root”);
if (!f || f->IsZombie()) { delete f; return; } // no file

TTree *t2; f->GetObject(“demo/AnaTree”, t2);
if (!t2) { delete f; return; } // no tree

t2->Print();
}[/code]

You also posted the same question on roottalk. It is better to follow up here.
To be complete I put here also what I told you in roottalk:


We cannot execute your macro because the ROOT file is missing.
But seems to me your macro can be simplified.
I think the following is equivalent to what you are doing:

void pt_eta_nonIsomu() {

   TFile *f = new TFile("May26_1.root");

   TTree *t2 = (TTree*)f->Get("demo/AnaTree");

   TH2D *h2 = new TH2D("h2","hist_nonIsoMu",100,0,300,100,-3,3);
   h2->GetXaxis()->SetTitle("selNonIsoMu_pt");
   h2->GetYaxis()->SetTitle("selNonIsoMu_eta");

   t2->Draw("selNonIsoMu_eta:selNonIsoMu_pt >> h2","","COLZ"); 
}

just do:

$ root pt_eta_nonIsomu.cc

Dear developers,

I followed the instructions given by you. Still i am getting the same error.
I am sending you the path of my root file May26_2.root, could you please run the macro and sort out my error.

/afs/cern.ch/user/n/nmajeed/public

Thanks and Best Regards,
Nabila

I copied your file on my machine.
I ran the following macro:

void pt_eta_nonIsomu() {

   TFile *f = new TFile("May26_2.root");

   TTree *t2 = (TTree*)f->Get("demo/AnaTree");

   TH2D *h2 = new TH2D("h2","hist_nonIsoMu",100,0,300,100,-3,3);
   h2->GetXaxis()->SetTitle("selNonIsoMu_pt");
   h2->GetYaxis()->SetTitle("selNonIsoMu_eta");

   t2->Draw("selNonIsoMu_eta:selNonIsoMu_pt >> h2","","COLZ");
}

and I get the following plot:

Thank you so much for your help. You guys are really doing a great job.
God bless you.

Regards,
Nabila

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.