Parallel fill of a histogram This tutorial shows how a histogram can be filled in parallel with a multiprocess approach.
Int_t mp201_parallelHistoFill()
{
auto fillRandomHisto = [](int seed = 0) {
auto h =
new TH1F(
"myHist",
"Filled in parallel", 128, -8, 8);
h->Fill(rndm.Gaus(0, 1));
}
};
auto sumRandomHisto = pool.MapReduce(fillRandomHisto, seeds, redfunc);
sumRandomHisto->Draw();
return 0;
}
Merge collection of TObjects.
This class provides a simple interface to execute the same task multiple times in parallel,...
A pseudo container class which is a generator of indices.
1-D histogram with a float per channel (see TH1 documentation)}
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
Random number generator class based on M.
- Date
- January 2016
- Author
- Danilo Piparo
Definition in file mp201_parallelHistoFill.C.