HEP-FCC / FCCAnalyses

Common analysis framework for the Future Circular Collider
https://hep-fcc.github.io/FCCAnalyses/
24 stars 120 forks source link

Crash when tree not found #398

Open amagnan opened 2 months ago

amagnan commented 2 months ago

Hello, I had a crash in this line because I have files that somehow don't have trees inside, and this seems not protected at the moment: https://github.com/HEP-FCC/FCCAnalyses/blob/fa672d4326bcf2f43252d3554a138b53dcba15a4/python/process.py#L26

I protected it and then it crashed properly later on from the run_fccanalysis.py . I guess it should crash properly here first then...

Also, I have a large signal production with some input parameters from a text file, and some time one of the production fails for different reasons, but I don't really care to use a few points here and there. So, it would be nice that the program does not exit entirely, but simply goes to the next file when one of the input file is not found or the tree does not exist. Or, even better, that there is a flag to decide whether the user wants to exit on this type of errors or not ?

kjvbrt commented 2 months ago

Thanks you @amagnan for the reporting.

This PR should fix the issue: https://github.com/HEP-FCC/FCCAnalyses/pull/402

For now it hard stops the execution of the script, let me know if that would not work for you :)