From: rpreghen Date: Wed, 17 Jun 2009 14:51:01 +0000 (+0000) Subject: added macros to merge QA histos and added merged QA histo set X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=f5731d663d827cfd680b217cfc4bc9dffdefe6c6;p=u%2Fmrichter%2FAliRoot.git added macros to merge QA histos and added merged QA histo set --- diff --git a/TOF/MergeQAHistos.C b/TOF/MergeQAHistos.C new file mode 100644 index 00000000000..b9f25c6490c --- /dev/null +++ b/TOF/MergeQAHistos.C @@ -0,0 +1,45 @@ +/* + * this macros connects to ALIEN and searches for TOFQA.root + * files in the provided search dir. the files are merged in + * a single local TOFQA.root file. + * the output file can be used both to check QA histos merged + * over more files and to use them to provide reference QA + * histos merged over more runs (the starting reference histos + * will be histo from MC production/reconstruction process). + */ + +MergeQAHistos(const Char_t *searchDir = "/alice/sim/PDC_09/LHC09a4/80050", Int_t maxFiles = kMaxInt) +{ + + const Char_t *fileName = "TOFQA.root"; + + TGrid *gGrid = TGrid::Connect("alien"); + if (!gGrid || !gGrid->IsConnected()) { + AliError("cannot connect to ALIEN"); + return; + } + + TGridResult *gr = gGrid->Query(searchDir, fileName); + if (gr->GetEntries() < 1) { + printf("less than one input files: abort\n"); + return; + } + printf("%d files found\n", gr->GetEntries()); + + TFileMerger merger; + merger.OutputFile(fileName); + + Int_t mergedFiles = 0; + Int_t nFiles = gr->GetEntries(); + for (Int_t i = 0; i < nFiles && i < maxFiles; i++) { + + if (merger.AddFile(gr->GetKey(i, "turl"))) + mergedFiles++; + + } + + merger.Merge(); + printf("merged %d files\n", mergedFiles); + printf("output written on %s\n", fileName); +} + diff --git a/TOF/data/TOFQA.LHC09a4.80050.root b/TOF/data/TOFQA.LHC09a4.80050.root new file mode 100644 index 00000000000..89a84227d2f Binary files /dev/null and b/TOF/data/TOFQA.LHC09a4.80050.root differ