Fill histograms in parallel with automatic binning.
Illustrates use of power-of-two autobin algorithm
#include <thread>
#include <iostream>
{
auto workItem = [&](
UInt_t workerID) {
auto wh1d = h1d.Get();
auto wh1dr = h1dr.Get();
for (
UInt_t i = 0; i < nNumbers; ++i) {
}
};
std::vector<std::thread> workers;
workers.emplace_back(workItem, workerID);
}
for (auto &&worker : workers)
worker.join();
auto fh1d = h1d.Merge();
auto fh1dr = h1dr.Merge();
fh1d->DrawCopy();
fh1dr->DrawCopy();
return 0;
}
- Author
- Gerardo Ganis
Definition in file mt304_fillHistos.C.