Skip to content
/ mdfds Public

Implementation of a ROOT TDataSource for MDF files.

License

Notifications You must be signed in to change notification settings

eguiraud/mdfds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

A TDataSource implementation that reads MDF files.
Reference docs can be found here.

Quick introduction

This small library provides a TDataSource for MDF files, i.e. a way to allow ROOT's TDataFrame to read the MDF binary format directly. This lets users access the high-level declarative syntax of TDataFrame (including lazy evaluation and multi-thread execution of the analysis) with minimal effort.

A small example usage:

// Build a TDataFrame that reads an MDF file -- a list of multiple files is also supported
// As this TDF has a THltVertexReportsDecoder, it will provide a "HltVertexReports" column/MDF bank
// Obviously more decoders could be added in case more types of banks/column need to be read
auto tdf = MakeMDFDataFrame<THltVertexReportsDecoder>({"file.mdf"});

// Define a column "z" that extracts the "z" position of vertices from the "HltVertexReports" column
auto getZ = [](THltVertexReports &vr) { return std::move(vr.z); };
auto tdfWithZ = tdf.Define("z", getZ, {"HltVertexReports"});

// Book the filling of a histogram
auto zHisto = tdf.Histo1D("z");

// Also save z in a TTree
tdf.Snapshot("tree", "output.root", {"z"});

// Draw histogram
zHisto->DrawClone();

About

Implementation of a ROOT TDataSource for MDF files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages