Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow xrootd files as inputs to eicrecon #1690

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/services/io/podio/JEventSourcePODIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,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();
Expand Down Expand Up @@ -267,7 +256,7 @@ double JEventSourceGeneratorT<JEventSourcePODIO>::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<TFile> file = std::make_unique<TFile>(resource_name.c_str());
std::unique_ptr<TFile> file = std::unique_ptr<TFile>{TFile::Open(resource_name.c_str())};
simonge marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
Loading