Skip to content

Commit

Permalink
Merge branch 'main' into pr/BTOF-digitization-clusterization
Browse files Browse the repository at this point in the history
  • Loading branch information
ssedd1123 authored Dec 20, 2024
2 parents 2aab59b + 78b4c5d commit d1218e0
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/services/io/podio/JEventSourcePODIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
#include <JANA/Utils/JTypeInfo.h>
#include <TFile.h>
#include <TObject.h>
#include <fmt/color.h>
#include <fmt/core.h>
#include <fmt/format.h>
#include <podio/CollectionBase.h>
#include <podio/Frame.h>
#include <podio/podioVersion.h>
#include <algorithm>
#include <cstdlib>
#include <exception>
#include <filesystem>
#include <iostream>
#include <map>
#include <utility>
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -267,7 +252,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())};
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

0 comments on commit d1218e0

Please sign in to comment.