Skip to content

Commit

Permalink
Check xcom_photoion_data.txt exists
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Mar 1, 2024
1 parent cd53c27 commit 8cf7b7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gammapkt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ void init_photoion_data() {
for (int Z = 0; Z < numb_xcom_elements; Z++) {
photoion_data[Z].reserve(100);
}
std::ifstream data_fs("xcom_photoion_data.txt");
const std::string filepath{"xcom_photoion_data.txt"};
assert_always(std::filesystem::exists(filepath));

std::ifstream data_fs(filepath);
std::string line_str;
// now read the file a second time to store the data
while (getline(data_fs, line_str)) {
Expand Down

0 comments on commit 8cf7b7c

Please sign in to comment.