Root crashes while processing delphes.root file

Hello,

I am analyzing a .root file produced by Delphes. I am using my own code. Now when I execute my code from Delphes using command

root -l examples/EFTdelphes1.C("~/Programs/MG5_aMC_v2_0_1/MLMaxialEFT_1Gmed10T1/Events/run_01/tag_1_delphes_events.root")

root crashes giving the following error:

[color=#FF0000]{
Processing examples/EFTdelphes1.C("~/Programs/MG5_aMC_v2_0_1/MLMaxialEFT_1Gmed10T1/Events/run_01/tag_1_delphes_events.root")…

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00007f7abf1c046a in __libc_waitpid (pid=8787, stat_loc=stat_loc
entry=0x7fff7cbcbf80, options=options
entry=0) at …/sysdeps/unix/sysv/linux/waitpid.c:31
#1 0x00007f7abf144fae in do_system (line=0x299d240 “/etc/root/gdb-backtrace.sh 8772 1>&2”) at …/sysdeps/posix/system.c:148
#2 0x00007f7abfe6aee3 in TUnixSystem::StackTrace() () from /home/swasti/root/lib/libCore.so
#3 0x00007f7abfe6cbac in TUnixSystem::DispatchSignals(ESignals) () from /home/swasti/root/lib/libCore.so
#4
#5 __memcpy_ssse3_back () at …/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:198
#6 0x00007f7abe6f6d7b in G__classassign () from /home/swasti/root/lib/libCint.so
#7 0x00007f7abe6f931f in G__letstructp () from /home/swasti/root/lib/libCint.so
#8 0x00007f7abe70f383 in G__letvariable(G__FastAllocString&, G__value, G__var_array*, G__var_array*, Cint::G__DataMemberHandle&) () from /home/swasti/root/lib/libCint.so
#9 0x00007f7abe7149f3 in G__letstructmem(int, G__FastAllocString&, int, G__FastAllocString&, char*, G__var_array*, G__value, int, Cint::G__DataMemberHandle&) () from /home/swasti/root/lib/libCint.so
#10 0x00007f7abe70bfc9 in G__letvariable(G__FastAllocString&, G__value, G__var_array*, G__var_array*, Cint::G__DataMemberHandle&) () from /home/swasti/root/lib/libCint.so
#11 0x00007f7abe715141 in G__letvariable(G__FastAllocString&, G__value, G__var_array*, G__var_array*) () from /home/swasti/root/lib/libCint.so
#12 0x00007f7abe607158 in G__getexpr () from /home/swasti/root/lib/libCint.so
#13 0x00007f7abe67faa3 in G__exec_statement () from /home/swasti/root/lib/libCint.so
#14 0x00007f7abe63484c in G__interpret_func () from /home/swasti/root/lib/libCint.so
#15 0x00007f7abe620c77 in G__getfunction () from /home/swasti/root/lib/libCint.so
#16 0x00007f7abe5faf82 in G__getitem () from /home/swasti/root/lib/libCint.so
#17 0x00007f7abe600415 in G__getexpr () from /home/swasti/root/lib/libCint.so
#18 0x00007f7abe6833c9 in G__exec_statement () from /home/swasti/root/lib/libCint.so
#19 0x00007f7abe63484c in G__interpret_func () from /home/swasti/root/lib/libCint.so
#20 0x00007f7abe620c77 in G__getfunction () from /home/swasti/root/lib/libCint.so
#21 0x00007f7abe5faf82 in G__getitem () from /home/swasti/root/lib/libCint.so
#22 0x00007f7abe600415 in G__getexpr () from /home/swasti/root/lib/libCint.so
#23 0x00007f7abe60bcfb in G__calc_internal () from /home/swasti/root/lib/libCint.so
#24 0x00007f7abe692ad9 in G__process_cmd () from /home/swasti/root/lib/libCint.so
#25 0x00007f7abfe353d0 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /home/swasti/root/lib/libCore.so
#26 0x00007f7abfe2e72b in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /home/swasti/root/lib/libCore.so
#27 0x00007f7abfd9edc4 in TApplication::ExecuteFile(char const*, int*, bool) () from /home/swasti/root/lib/libCore.so
#28 0x00007f7abfd9e302 in TApplication::ProcessLine(char const*, bool, int*) () from /home/swasti/root/lib/libCore.so
#29 0x00007f7abf9f3ecd in TRint::Run(bool) () from /home/swasti/root/lib/libRint.so
#30 0x0000000000400fdc in main ()

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
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.

#5 __memcpy_ssse3_back () at …/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:198

Root > Function BookHistograms() busy flag cleared
Function EFTdelphes1() busy flag cleared

================================================================
}[/color]

Also, it suggests to submit this report at
root.cern.ch/bugs
but I am not able to create an account there.

Please help.

Regards,
Swasti

Well, you can:

  1. Provide your code and data (minimal code fragment required to reproduce you problem).

or if your code and data are private, you can try to debug yourself:

  1. Build ROOT in debug mode (configure it with --build=debug and re-build)
  2. Run ROOT + your macro in a debugger and provide a reasonable stack trace

Otherwise - the information you provided is useless (it’s funny to see the file name and line numbers for waitpid but totally useless lines like “0x00007f7abfe6cbac in TUnixSystem::DispatchSignals(ESignals) () from /home/swasti/root/lib/libCore.so” for ROOT.

Well, you do not even need a debug mode - have a look, how it’s done usually:

en.wikipedia.org/wiki/Debugging#Techniques

Thank you for your reply.

Well, I somehow managed to avoid that error now.

I am using the simple tutorial given on the Delphes page:

[code]*****************************************
void Example1(const char *inputFile)
{
gSystem->Load(“libDelphes”);

// Create chain of root trees
TChain chain(“Delphes”);
chain.Add(inputFile);

// Create object of class ExRootTreeReader
ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
Long64_t numberOfEntries = treeReader->GetEntries();

// Get pointers to branches used in this analysis
TClonesArray *branchJet = treeReader->UseBranch(“Jet”);

// Book histograms
TH1 *histJetPT = new TH1F(“jet_pt”, “jet P_{T}”, 100, 0.0, 100.0);

// Loop over all events
for(Int_t entry = 0; entry < numberOfEntries; ++entry)
{
// Load selected branches with data from specified event
treeReader->ReadEntry(entry);

// If event contains at least 1 jet
if(branchJet->GetEntries() > 0)
{
  // Take first jet
  Jet *jet = (Jet*) branchJet->At(0);
  
  // Plot jet transverse momentum
  histJetPT->Fill(jet->PT);
  
  // Print jet transverse momentum
  cout << jet->PT << endl;
}

}

// Show resulting histograms
histJetPT->Draw();
}


[/code]

I am using this source code to analyse my tag_1_delphes_events.root file (docs.google.com/file/d/0B1oe-jB … edit?pli=1) which I generated with Madgraph+Pythia+Delphes.

When I execute the code in Delphes folder, it is able to generate the plot (though, with no data) with an error -“Cannot find tree with name Delphes in file ~/Programs/…/tag_1_delphes_events.root”. I have to edit the code for my particular analysis, but I am referring the tutorial for now. Also, it shows the same error with other source codes and data files.

Regards,
Swasti.