Modern Particle & Nuclear Physics Data Analysis with ROOT RDataFrame
RAD completely overhauls the traditional ROOT event loop using an AnalysisManager orchestrator.
The framework easily adapts to any data source using specialized data streams:
ePICReaction for Podio/EDM4hep, HepMCElectro for HepMC3).
#include "AnalysisManager.h"
#include "HepMCElectro.h"
#include "KinematicsProcElectro.h"
void CombiJpsi() {
using namespace rad;
ROOT::EnableImplicitMT(8);
// 1. Initialize the Orchestrator
AnalysisManager<HepMCElectro, KinematicsProcElectro> mgr{
"Jpsi_Analysis", "hepmc3_tree", "data.root"
};
mgr.SetOutputDir("output");
auto& reaction = mgr.Reaction();
reaction.SetupMC();
// 2. Define Particles & Combinatorics
reaction.SetBeamElectronIndex(0);
reaction.SetParticleIndex("ele", 4);
reaction.SetParticleIndex("pos", 5);
reaction.MakeCombinations();
mgr.AddStream(MC());
// 3. The Topology Recipe (Injected to all CPU threads)
auto topology_recipe = [](KinematicsProcElectro& p) {
p.Creator().Sum("Jpsi", {{"ele", "pos"}});
p.Mass("MassJ", {"Jpsi"});
};
// 4. The Histogram Recipe
auto histogram_recipe = [](histo::Histogrammer& h) {
h.Create("MassJ", "Invariant Mass; Mass [GeV]", 100, 2.0, 4.0, "MassJ");
};
// 5. Configure & Execute Lazy Event Loop
mgr.ConfigureKinematics(topology_recipe);
mgr.ConfigureHistograms(histogram_recipe);
mgr.Snapshot();
mgr.Run();
}
Standard workflow for combinatorial analysis using the Recipe pattern.