-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathntuple_dump_exporter.cxx
More file actions
32 lines (25 loc) · 948 Bytes
/
ntuple_dump_exporter.cxx
File metadata and controls
32 lines (25 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <ROOT/RNTupleExporter.hxx>
#include <ROOT/RPageStorage.hxx>
#include <ROOT/RLogger.hxx>
#include <cstdio>
using namespace ROOT::Experimental;
using namespace ROOT::Experimental::Internal;
int main(int argc, char **argv)
{
if (argc != 4) {
printf("Usage: %s <output_dir> <input_file> <ntuple_name>\n", argv[0]);
return 1;
}
const char *output_dir = argv[1];
const char *input_file = argv[2];
const char *ntuple_name = argv[3];
auto source = RPageSource::Create(ntuple_name, input_file);
ROOT::RLogScopedVerbosity verbosity(ROOT::ELogLevel::kInfo);
RNTupleExporter::RPagesOptions opts {};
opts.fOutputPath = output_dir;
// NOTE: If you want to filter out some specific columns, do something like this:
// opts.fColumnTypeFilter.fType = RNTupleExporter::EFilterType::kWhitelist;
// opts.fColumnTypeFilter.fSet.insert(EColumnType::kReal64);
RNTupleExporter::ExportPages(*source, opts);
return 0;
}