]>
Commit | Line | Data |
---|---|---|
5c75ba4f | 1 | /** |
2 | * @file CheckQAFile.C | |
3 | * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk> | |
4 | * @date Fri Jan 6 11:39:22 2012 | |
5 | * | |
6 | * @brief Script to check a QA file | |
7 | * | |
bd6f5206 | 8 | * @ingroup pwglf_forward_qa_scripts |
5c75ba4f | 9 | */ |
10 | /** | |
11 | * Script to check a QA file. Note that this terminates the ROOT session. | |
12 | * | |
13 | * @param filename File to read | |
14 | * | |
bd6f5206 | 15 | * @ingroup pwglf_forward_qa_scripts |
5c75ba4f | 16 | */ |
5cd23d34 | 17 | void CheckQAFile(const char* filename, const char* type="") |
5c75ba4f | 18 | { |
19 | int ret = 0; | |
20 | TFile* file = TFile::Open(filename, "READ"); | |
21 | if (!file) { | |
22 | Error("CheckQAFile", "No such file %s", filename); | |
23 | exit(1); | |
24 | } | |
5cd23d34 | 25 | TString check = Form("Forward%s",type); |
26 | TString check2; | |
27 | TObject* forward1 = file->Get(check); | |
5c75ba4f | 28 | if (!forward1) { |
5cd23d34 | 29 | check2 = Form("Forward%sSums",type); |
30 | forward1 = file->Get(Form("Forward%sSums",type)); | |
31 | if (!forward1) { | |
32 | Error("CheckQAFile", "No %s or %s object found in %s", | |
33 | check.Data(),check2.Data(), filename); | |
34 | ret |= 2; | |
35 | } | |
5c75ba4f | 36 | } |
5cd23d34 | 37 | check = Form("Forward%sResults", type); |
38 | TObject* forward2 = file->Get(check); | |
5c75ba4f | 39 | if (!forward2) { |
5cd23d34 | 40 | check2 = Form("forward%sResults",type); |
41 | forward2 = file->Get(check2); | |
42 | if (!forward2) { | |
43 | Error("CheckQAFile", "No %s or %s object found in %s", | |
44 | check.Data(), check2.Data(), filename); | |
45 | file->ls(); | |
46 | ret |= 4; | |
47 | } | |
5c75ba4f | 48 | } |
49 | file->Close(); | |
50 | exit(ret); | |
51 | } | |
52 | // | |
53 | // EOF | |
54 | // |