Fill histograms in parallel with automatic binning.
Illustrates use of power-of-two autobin algorithm
{
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;
for (
auto workerID :
ROOT::
TSeqI(nWorkers)) {
workers.emplace_back(workItem, workerID);
}
for (auto &&worker : workers)
worker.join();
auto fh1d = h1d.Merge();
auto fh1dr = h1dr.Merge();
auto c =
new TCanvas(
"c",
"c", 800, 800);
fh1d->DrawCopy();
fh1dr->DrawCopy();
return 0;
}
R__EXTERN TStyle * gStyle
A wrapper to make object instances thread private, lazily.
@ kAutoBinPTwo
different than 1.
Random number generator class based on M.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...
- Date
- November 2017
- Author
- Gerardo Ganis
Definition in file mt304_fillHistos.C.