16 TimerRAII(
const char *meta): fMeta(meta) {
21 std::cout << fMeta <<
" - real time elapsed " << fTimer.RealTime() <<
"s" << std::endl;
25 Int_t mp102_readNtuplesFillHistosAndFit()
32 TChain inputChain(
"multiCore");
33 inputChain.Add(
"mp101_multiCore_*.root");
34 TH1F outHisto(
"outHisto",
"Random Numbers", 128, -4, 4);
36 TimerRAII
t(
"Sequential read and fit");
37 inputChain.Draw(
"r >> outHisto");
47 const auto nFiles = inputChain.GetListOfFiles()->GetEntries();
53 auto partialHisto =
new TH1F(
"outHistoMP",
"Random Numbers", 128, -4, 4);
54 while (reader.Next()) {
55 partialHisto->Fill(*randomRV);
65 TimerRAII
t(
"Parallel execution");
66 TH1F *sumHistogram = workers.ProcTree(inputChain, workItem,
"multiCore");
67 sumHistogram->
Fit(
"gaus", 0);
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
1-D histogram with a float per channel (see TH1 documentation)}
This class provides a simple interface to execute the same task multiple times in parallel...
A chain is a collection of files containg TTree objects.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.