Parallel fill of a histogram.
This tutorial shows how a histogram can be filled in parallel with a multiprocess approach.
Int_t mtbb201_parallelHistoFill()
{
ROOT::TThreadExecutor pool(poolSize);
auto fillRandomHisto = [](int seed = 0) {
auto h =
new TH1F(
"myHist",
"Filled in parallel", 128, -8, 8);
}
};
auto sumRandomHisto = pool.MapReduce(fillRandomHisto, seeds, redfunc);
sumRandomHisto->Draw();
return 0;
}
- Author
- Danilo Piparo.
Definition in file mtbb201_parallelHistoFill.C.