Skip to content

Commit

Permalink
Change ROOTFrame{Writer,Reader} to ROOT{Writer,Reader} when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Feb 6, 2024
1 parent f2805f4 commit a6c7b8c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions standalone/lcio2edm4hep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
#include <IOIMPL/LCFactory.h>
#include <UTIL/CheckCollections.h>

#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99)
#include "podio/ROOTReader.h"
#else
#include "podio/ROOTFrameWriter.h"
#endif

#include <fstream>
#include <iostream>
Expand Down Expand Up @@ -156,7 +160,11 @@ int main(int argc, char* argv[])
std::cout << "Number of events in file: " << lcreader->getNumberOfEvents() << '\n';
std::cout << "Number of runs in file: " << lcreader->getNumberOfRuns() << '\n';

#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99)
podio::ROOTReader edmreader;
#else
podio::ROOTFrameWriter writer(args.outputFile);
#endif

for (auto j = 0u; j < lcreader->getNumberOfRuns(); ++j) {
if (j % 1 == 0) {
Expand Down
8 changes: 8 additions & 0 deletions tests/compare_contents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#include "ObjectMapping.h"
#include "ComparisonUtils.h"

#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99)
#include "podio/ROOTReader.h"
#else
#include "podio/ROOTFrameReader.h"
#endif
#include "podio/Frame.h"

#include <IOIMPL/LCFactory.h>
Expand All @@ -22,7 +26,11 @@ int main(int argc, char* argv[])
auto lcreader = IOIMPL::LCFactory::getInstance()->createLCReader();
lcreader->open(argv[1]);

#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99)
auto edmreader = podio::ROOTReader();
#else
auto edmreader = podio::ROOTFrameReader();
#endif
edmreader.openFile(argv[2]);

// loop going over every name of the lcio collection and checking if a
Expand Down

0 comments on commit a6c7b8c

Please sign in to comment.