DUNE / larnd-sim

Simulation framework for a pixelated Liquid Argon TPC
Apache License 2.0
10 stars 27 forks source link

Check if input file and output file exist at the start of simulation #144

Closed sam-fogarty closed 1 year ago

sam-fogarty commented 1 year ago

A decent number of lines of code will run (including the quenching and drifting stages in the case of the output file), before the input and output files are initially opened. This means that the simulation will halt if the input file doesn't exist, or if the output file already exists. I've found this a little annoying, as it looks like the simulation starts just for it to later halt because I forgot to delete the output file (this happens when rerunning the simulation multiple times for testing purposes). So I've added two checks at the beginning of the simulation. These will halt the simulation immediately if the input file doesn't exist or if the output file exists already. This way the simulation will not actually start until these checks are passed.