30 static std::string tutname =
"mp104_processH1: ";
31 static std::string logfile =
"mp104_processH1.log";
34 const char *fh1[] = {
"http://root.cern.ch/files/h1/dstarmb.root",
"http://root.cern.ch/files/h1/dstarp1a.root",
35 "http://root.cern.ch/files/h1/dstarp1b.root",
"http://root.cern.ch/files/h1/dstarp2.root"};
46 std::vector<std::string> files;
47 for (
int i = 0; i < 4; i++) {
48 files.push_back(fh1[i]);
56 std::cout << tutname <<
"processing the H1 dataset with a lambda \n";
58 auto hListFun = pool.Process(files, doH1,
"h42");
61 if (checkH1(hListFun) < 0)
return -1;
64 if (
doFit(hListFun, logfile.c_str()) < 0)
return -1;
72 selectorPath +=
"/tree/h1analysisTreeReader.C+";
73 std::cout << tutname <<
"processing the H1 dataset with selector '" << selectorPath <<
"'\n";
78 auto hListSel = pool.Process(files, *sel,
"h42");
82 if (checkH1(hListSel) < 0)
return -1;
85 if (
doFit(hListSel, logfile.c_str()) < 0)
return -1;
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void doFit(int n, const char *fitter)
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
Lambdas used to check and fit the result of the H1 analysis.
This class provides an interface to process a TTree dataset in parallel with multi-process technology...
R__EXTERN TSystem * gSystem
static TSelector * GetSelector(const char *filename)
The code in filename is loaded (interpreted or compiled, see below), filename must contain a valid cl...
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...