GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » The problem when accessing FairLinks in PndEmcPoints (script corrupts when using the PndEmcPoint::GetLinksWithType(int))
The problem when accessing FairLinks in PndEmcPoints [message #22964] Wed, 26 September 2018 13:21 Go to next message
Dong Liu is currently offline  Dong Liu
Messages: 3
Registered: September 2018
occasional visitor
From: 210.45.78*
Dear colleagues,

I am trying to do some simulation on the PndEMC. When I try to access the related MCTrack information of a EmcPoint, there are some problem!

When I use the code:

PndEmcPoint* point = (PndEmcPoint*)fPointArray->At(i);
std::set<FairLink> links = point->GetLinks();

where, "i" is the index of the EmcPoint in the related TCloneArray, "ioman" is the FairRooManager.
The script works fine. However, when I use

point->GetLinksWithType(ioman->GetBranchId("MCTrack"));

The script corrupts. The crash information can be found below. I also attached the full code and the root file.

Any ideas on the crash?

Thank you!

Dong

crash information

Processing ReadLink.C...
[INFO ] The input consists out of the following trees and files:
[INFO ] - cbmsim
[INFO ] - sim_ScanMom3.root
[INFO ] Object EmcPoint describing the branch in the folder structure was found
[INFO ] Object MCTrack describing the branch in the folder structure was found
maxEvtNo 100
points is 4367
branch id 0

*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/Users/danny/software/panda/FairRootInstall/lib/libBase.17.10.2.dylib] FairMultiLinkedData::GetLinksWithType(int) const (no debug info)
[/Users/danny/software/panda/FairRootInstall/lib/libBase.17.10.2.dylib] FairMultiLinkedData_Interface::GetLinksWithType(int) const (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] cling::MetaParser::isMetaCommand(cling::MetaSema::ActionResult&, cling::Value*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*, bool) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCling.so] TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libCore.6.10.so] TApplication::ExecuteFile(char const*, int*, bool) (no debug info)
[/Users/danny/software/panda/external/lib/root/libRint.6.10.so] TRint::ProcessLineNr(char const*, char const*, int*) (no debug info)
[/Users/danny/software/panda/external/lib/root/libRint.6.10.so] TRint::Run(bool) (no debug info)
[/Users/danny/software/panda/external/bin/root.exe] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)


Re: The problem when accessing FairLinks in PndEmcPoints [message #22965 is a reply to message #22964] Thu, 27 September 2018 11:25 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *dip0.t-ipconnect.de
Dear Dong,

please try to replace ioman->GetBranchId("MCTrack") with 0 as it is done in the next line of your code. I guess that it does not crash in that case.

The reason for the crash is, that the FairRootManager has not loaded the list of generated branches. Therefore no Id for "MCTrack" is returned.
Only if you use FairRunAna the branch list is populated in the FairRootManager.

Cheers,

Tobias
Re: The problem when accessing FairLinks in PndEmcPoints [message #22969 is a reply to message #22965] Thu, 27 September 2018 11:48 Go to previous messageGo to next message
Dong Liu is currently offline  Dong Liu
Messages: 3
Registered: September 2018
occasional visitor
From: 210.45.78*
Dear Tobias,

I also tried to replace ioman->GetBranchId("MCTrack") with 0, it also corrupts.
And I try to output the "ioman->GetBranchId("MCTrack")", It is 0 as expected.

Maybe there is other reason for the crash.

Thank you all the same!

Best regards,

Dong
Re: The problem when accessing FairLinks in PndEmcPoints [message #23014 is a reply to message #22969] Wed, 03 October 2018 09:20 Go to previous message
Dong Liu is currently offline  Dong Liu
Messages: 3
Registered: September 2018
occasional visitor
From: 210.45.78*
Dear Tobias,

I check my code again, and read the source code of FairMultiLinkedData.
I find the reason is that there is no instance of FairLinkManager in my code.
When I create a FairRunAna in my code, the instance of FairLinkManager is created automatically.
Then, the crash disappears.

Best regards,
Dong
Previous Topic: X edition of the School ESC (Efficient Scientific Computing) Bertinoro - Italy 22 - 27 October 2018
Next Topic: Failed FairSoft (for analysis) Installation on Ubuntu 18.04 LTS
Goto Forum:
  


Current Time: Fri Apr 19 18:13:43 CEST 2024

Total time taken to generate the page: 0.00820 seconds