RDataframe, it is possible to pass non-column argument to lambda function? example: c++ container

Hi @SiewYan,
welcome back to the ROOT forum :smiley: Please check this post about code formatting on the forum.

Lambda functions can capture variables:

// create map object
std::map<int, std::vector<std::pair<int, int>>> json = Helper::parseJSONAsMap(cfg.jsonFile);

// capture it and use it in the lambda function
auto isPassJSON = [&json](unsigned& run , unsigned& luminosityBlock)
{
    return Helper::isRunLumiInJSON( m_json , run, luminosityBlock );
};

// use `isPassJSON` as usual, only listing the columns it acts on
df.Define("passJSON", isPassJSON, {“run” , “luminosityBlock” } );

Hope this helps!
Enrico