diff --git a/src/services/io/podio/JEventSourcePODIO.cc b/src/services/io/podio/JEventSourcePODIO.cc index faf3f4ba3..ee4351a6f 100644 --- a/src/services/io/podio/JEventSourcePODIO.cc +++ b/src/services/io/podio/JEventSourcePODIO.cc @@ -14,16 +14,12 @@ #include #include #include -#include #include -#include #include #include #include #include -#include #include -#include #include #include #include @@ -131,17 +127,6 @@ void JEventSourcePODIO::Open() { // Open primary events file try { - // Verify file exists - if( ! std::filesystem::exists(GetResourceName()) ){ - // Here we go against the standard practice of throwing an error and print - // the message and exit immediately. This is because we want the last message - // on the screen to be that the file doesn't exist. - auto mess = fmt::format(fmt::emphasis::bold | fg(fmt::color::red),"ERROR: "); - mess += fmt::format(fmt::emphasis::bold, "file: {} does not exist!", GetResourceName()); - std::cerr << std::endl << std::endl << mess << std::endl << std::endl; - std::_Exit(EXIT_FAILURE); - } - m_reader.openFile( GetResourceName() ); auto version = m_reader.currentFileVersion(); @@ -267,7 +252,7 @@ double JEventSourceGeneratorT::CheckOpenable(std::string reso // PODIO FrameReader segfaults on legacy input files, so we use ROOT to validate beforehand. Of course, // we can't validate if ROOT can't read the file. - std::unique_ptr file = std::make_unique(resource_name.c_str()); + std::unique_ptr file = std::unique_ptr{TFile::Open(resource_name.c_str())}; if (!file || file->IsZombie()) return 0.0; // We test the format the same way that PODIO's python API does. See python/podio/reading.py