Hmmm, I would suggest the following:
Load first your time column into an std::vector<ULong64_t>, using:
https://root.cern/doc/master/classROOT_1_1RDF_1_1RInterface.html#aa571f08b8e4d9300cacdea039a379a22
or by just doing:
vector<int> v; v.reserve(Data_A->GetEntries(); for(Long64_t i = 0; i< Data_A->GetEntries(); ++i){Data_A.GetEntry(i); v.emplace_back(time);}
or in Python:
Then follow this example:
#include <iostream>
#include <vector>
#include <numeric>
int main()
{
std::vector<int> v {4, 6, 9, 13, 18, 19, 19, 15, 10};
for(auto& r : v) std::cout << r << "\t"; std::cout << std::endl;
//Calculate now the difference between adjacent elements
std::adjacent_difference(v.begin(), v.end(), v.begin());//here, set execution policy to parallel
v.erase(v.begin()); // pop_front
for(auto& r : v) std::cout << r << "\t"; std::cout << std::endl;
//Calculate now the adjacent sum of the adjacent difference, which equals the second-adjacent difference of the first vector
std::adjacent_difference(v.begin(), v.end(), v.begin(), [](const int x, const int y) { return x+y; });//here, set execution policy to parallel
v.erase(v.begin()); // pop_front
for(auto& r : v) std::cout << r << "\t"; std::cout << std::endl;
return 0;
}
which gives what you are looking for:
4 6 9 13 18 19 19 15 10
2 3 4 5 1 0 -4 -5
5 7 9 6 1 -4 -9
You just need to set the execution policy to parallel.
Then, you can fill the histograms in parallel, see ROOT: tutorials/multicore/mt201_parallelHistoFill.C File Reference
If your dataset is too big and does not fit on RAM, you can do it in batches of 1e8 events or something like that.