project8 / katydid

Project 8 data analysis package
Other
5 stars 4 forks source link

Crash when saving an empty Graph 2D #75

Closed guiguem closed 8 years ago

guiguem commented 8 years ago

After the two cuts on points during the track processing, if there is no more points, Katydid crashes when attempting to create a TGraph2D (see attachment). KTcrash.txt

nsoblath commented 8 years ago

@guiguem: can you please also attach the configuration file you were using?

guiguem commented 8 years ago

The data file is rid000001097-2016.09.13.22.55.32.411.MAT AlgorithmOptimization copy.txt

evzayas commented 8 years ago

This should probably be handled in the writer, since a sparse waterfall plot with 0 points is a bogus track but still an important possible output of the track processing analysis. In this commit from last week on the Event Viewer branch, I simply had it throw a warning instead of trying to create the empty TGraph. Does this seem like a reasonable fix?

guiguem commented 8 years ago

For what my opinion worths, that sounds reasonable... I added this piece of code in my branch, and fixed my problem...

nsoblath commented 8 years ago

Which piece of code? Can you push that change to GitHub? If it's fixing a bug that's relevant outside of your branch I will probably cherry pick it into a hotfix.

evzayas commented 8 years ago

Mathieu is talking about adding these lines in KTROOTTreeTypeWriterEventAnalysis.cc around 300, before the TGraph2D is initialized:

if( points.size() == 0 )
{
    KTWARN(publog, "The Sparse Waterfall Plot has no points! Will not write it");
    return;
}
nsoblath commented 8 years ago

This has been fixed in the update I just made (commit 2ae94b1). It has been merged into develop and included in the release version 2.6.3.