I have a macro mini.C created using MakeClass() that contains the function Loop, which simply fills a histogram with the transverse momentum (lep_pt) for the selected .root file, then writes out the result to another .root file. I am using ATLAS OpenData, in which all the ROOT trees are named “mini”.
Now, I made a second script to loop over some of the different analysis files. Since the header files are different for data/MC in a way I can’t seem to reconcile, I initially copy the contents of the relevant header file into the file mini.h.
The loop is over a vector index of names of decay chains:
// i is the number of entries in the vector
for( int j=0; j<i; j++)
{
// Copy the relevant header file into mini.h
gSystem->Exec(TString::Format("cat %s.h > mini.h", names[j].c_str()));
// Run the macro in ROOT
gROOT->ProcessLine(".L mini.C+");
gROOT->ProcessLine("mini t");
gROOT->ProcessLine(TString::Format("t.Loop(\"%s\")",names[j].c_str()));
This executes the analysis code fine once, however upon the second running for a different decay chain I get a similar stack trace to that of the one below.
Now, I have added a gROOT->Reset()
at the end of the Loop function, but this does not seem to resolve the problem as I may have expected. It seems to run twice now, but not three times, which is very eerie! The stack trace for this analysis is the stack trace I have copied into this post, which I don’t really understand.
Any help would be greatly appreciated! The end goal is to superpose the resulting histograms from multiple .root files on to the same TCanvas.
> *** Break *** segmentation violation
> ===========================================================
> There was a crash.
> This is the entire stack trace of all threads:
> ===========================================================
> 0 0x000000324eeac82e in waitpid () from /lib64/libc.so.6
> 1 0x000000324ee3e479 in do_system () from /lib64/libc.so.6
> 2 0x00007fc629d24c5a in TUnixSystem::StackTrace() () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 3 0x00007fc629d26c2c in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 4 <signal handler called>
> 5 0x00007fc61cfeb837 in mini::Loop(std::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /afs/hep.man.ac.uk/u/eurioya/Software/mini_C.so
> 6 0x00007fc61f560080 in __cling_Un1Qu318(void*) ()
> 7 0x00007fc627206be8 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 8 0x00007fc62720ce69 in cling::Interpreter::EvaluateInternal(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 9 0x00007fc62720d035 in cling::Interpreter::process(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 10 0x00007fc6272b127b in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 11 0x00007fc6271b68ad in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 12 0x00007fc629c2e8b6 in TApplication::ProcessLine(char const*, bool, int*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 13 0x00007fc629ba5c11 in TROOT::ProcessLine(char const*, int*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 14 0x00007fc61f5721c2 in runmini(std::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()
> 15 0x00007fc61f564076 in __cling_Un1Qu316(void*) ()
> 16 0x00007fc627206be8 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 17 0x00007fc62720ce69 in cling::Interpreter::EvaluateInternal(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 18 0x00007fc62720d08f in cling::Interpreter::echo(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 19 0x00007fc6272b75f9 in cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 20 0x00007fc6272c3479 in cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 21 0x00007fc6272c450e in cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 22 0x00007fc6272b11b3 in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 23 0x00007fc6271b6cb9 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 24 0x00007fc627191af7 in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 25 0x00007fc629c2dcdd in TApplication::ExecuteFile(char const*, int*, bool) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 26 0x00007fc629c2ec9e in TApplication::ProcessLine(char const*, bool, int*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 27 0x00007fc629ba5c11 in TROOT::ProcessLine(char const*, int*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 28 0x00007fc61ec80eb6 in DivAn2() () from /afs/hep.man.ac.uk/u/eurioya/Software/DivAn2_C.so
> 29 0x00007fc629736042 in __cling_Un1Qu30(void*) ()
> 30 0x00007fc627206be8 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 31 0x00007fc62720ce69 in cling::Interpreter::EvaluateInternal(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 32 0x00007fc62720d035 in cling::Interpreter::process(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 33 0x00007fc6272b127b in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 34 0x00007fc6271b6e0d in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 35 0x00007fc627191af7 in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 36 0x00007fc629c2dcdd in TApplication::ExecuteFile(char const*, int*, bool) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 37 0x00007fc629c2ec9e in TApplication::ProcessLine(char const*, bool, int*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 38 0x00007fc62a08ded5 in TRint::ProcessLineNr(char const*, char const*, int*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRint.so
> 39 0x00007fc62a08e101 in TRint::HandleTermInput() () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRint.so
> 40 0x00007fc629d263bd in TUnixSystem::CheckDescriptors() () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 41 0x00007fc629d274ca in TUnixSystem::DispatchOneEvent(bool) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 42 0x00007fc629c6c794 in TSystem::InnerLoop() () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 43 0x00007fc629c6ad81 in TSystem::Run() () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 44 0x00007fc629c2c0df in TApplication::Run(bool) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
> 45 0x00007fc62a08f55b in TRint::Run(bool) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRint.so
> 46 0x0000000000401340 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
> 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.
> ===========================================================
> 5 0x00007fc61cfeb837 in mini::Loop(std::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /afs/hep.man.ac.uk/u/eurioya/Software/mini_C.so
> 6 0x00007fc61f560080 in __cling_Un1Qu318(void*) ()
> 7 0x00007fc627206be8 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 8 0x00007fc62720ce69 in cling::Interpreter::EvaluateInternal(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 9 0x00007fc62720d035 in cling::Interpreter::process(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> 10 0x00007fc6272b127b in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCling.so
> ===========================================================