20int df015_LazyDataSource()
26 auto fileName =
"df014_CsvDataSource_MuRun2010B.csv";
30 std::string px1Name =
"px1";
31 auto px1 = csv_tdf.Take<
double>(px1Name);
32 std::string py1Name =
"py1";
33 auto py1 = csv_tdf.Take<
double>(py1Name);
37 auto tdf =
MakeLazyDataFrame(std::make_pair(px1Name, px1), std::make_pair(py1Name, py1));
40 auto ptFormula = [](
double px,
double py) {
return sqrt(px * px + py * py); };
41 auto pt_h = tdf.Define(
"pt", ptFormula, {
"px1",
"py1"})
42 .Histo1D<double>({
"pt",
"Muon p_{T};p_{T} [GeV/c];", 128, 0, 128},
"pt");
RDataFrame MakeLazyDataFrame(std::pair< std::string, RResultPtr< std::vector< ColumnTypes > > > &&... colNameProxyPairs)
Factory method to create a Lazy RDataFrame.
RDataFrame MakeCsvDataFrame(std::string_view fileName, bool readHeaders=true, char delimiter=',', Long64_t linesChunkSize=-1LL)
Factory method to create a CSV RDataFrame.