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;
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 pseudo container class which is a generator of indices.
A wrapper to make object instances thread private, lazily.
@ kAutoBinPTwo
Use Power(2)-based algorithm for autobinning.
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...
void EnableThreadSafety()
Enables the global mutex to make ROOT thread safe/aware.
- Date
- November 2017
- Author
- Gerardo Ganis
Definition in file mt304_fillHistos.C.