Print

Print


Hi Rafayel

Can you send me or point me to the recon LCIO file that you used to create the DST? 

There are a few reasons your code isn't working: 

1) You don't instantiate the HpsEvent pointer so it's pointing to junk.  So when you set the branch address, it's being set to some random spot in memory.  Instead do the following: 

HpsEvent *ev1 = new HpsEvent(); 

before you set the branch address.

2) The track index starts at 0.  So getting a track from an event as follows: 

for(int j = 0; j < n_svt_trk; j++){
 svt_tr = ev1->getTrack(j+1)
}

Will eventually cause the code to crash because the track j+1 doesn't exist.

3) Most of the tracks in the event point to NULL.  If I check for NULL tracks and skip them, everything runs fine (after the modification above were made).   I'm not sure if this is a problem with the DST maker or the recon file you used to create the DST.  I'll need to look at the recon file and generate the DST myself so I can debug it.  I haven't seen this before so I need to dig a bit to find the issue. 

Another thing, since you are linking against the HpsEvent library, you don't need to load it inside your code.  Specifically, the following line of code is unnecessary: 

gSystem->Load("../hps-dst/build/lib/libHpsEvent.so");

You do need to make sure that the library path is added to LD_LIBRARY_PATH.

--Omar Moreno



On Wed, Sep 17, 2014 at 8:01 PM, Rafayel Paremuzyan <[log in to unmask]> wrote:
Dear Omar,

I am getting a segmentation fault error when I am reading dst files, and I didn't manage to figure out
the cause.

I shrank the code to the minimum to reproduce the problem (it is attached).
Could you please take a look into it?

Some additional info that might help to find the cause of error:

The way this file produced:
A slic output file from /mss/hallb/hps/production/slic/tritrig/2pt2/
was read out with HPS_Java using HPS2014TruthReadoutToLcio.lcsim and then
reconstructed using HPS2014OfflineTruthRecon.lcsim, later with the latest version of dst (downloaded yesterday)
is converted into root file (this file is also attached).

The compile command:
g++ test3.cc -o test3.exe -Wl,--no-as-needed -L/usr/local/hps_dst/hps-dst/build/lib -lHpsEvent -I/usr/local/hps_dst/hps-dst/include/hps_event/ -I/usr/local/hps_dst/hps-dst/include/dst -I/usr/local/hps_dst/hps-dst/include/hps_event/utils `root-config --cflags` `root-config --libs`

Rafo

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1



Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1