2 * this macros connects to ALIEN and searches for TOFQA.root
3 * files in the provided search dir. the files are merged in
4 * a single local TOFQA.root file.
5 * the output file can be used both to check QA histos merged
6 * over more files and to use them to provide reference QA
7 * histos merged over more runs (the starting reference histos
8 * will be histo from MC production/reconstruction process).
11 MergeQAHistos(const Char_t *searchDir = "/alice/sim/PDC_09/LHC09a4/80050", Int_t maxFiles = kMaxInt)
14 const Char_t *fileName = "TOFQA.root";
16 TGrid *gGrid = TGrid::Connect("alien");
17 if (!gGrid || !gGrid->IsConnected()) {
18 AliError("cannot connect to ALIEN");
22 TGridResult *gr = gGrid->Query(searchDir, fileName);
23 if (gr->GetEntries() < 1) {
24 printf("less than one input files: abort\n");
27 printf("%d files found\n", gr->GetEntries());
30 merger.OutputFile(fileName);
32 Int_t mergedFiles = 0;
33 Int_t nFiles = gr->GetEntries();
34 for (Int_t i = 0; i < nFiles && i < maxFiles; i++) {
36 if (merger.AddFile(gr->GetKey(i, "turl")))
42 printf("merged %d files\n", mergedFiles);
43 printf("output written on %s\n", fileName);