AliPhysics  63e47e1 (63e47e1)
CheckQAFile.C
Go to the documentation of this file.
1 
18 void CheckQAFile(const char* filename, const char* type="")
19 {
20  int ret = 0;
21  TFile* file = TFile::Open(filename, "READ");
22  if (!file) {
23  Error("CheckQAFile", "No such file %s", filename);
24  exit(1);
25  }
26  TString check = Form("Forward%s",type);
27  TString check2;
28  TString check3;
29  TObject* forward1 = file->Get(check);
30  if (!forward1) {
31  check2 = Form("Forward%sSums",type);
32  forward1 = file->Get(Form("Forward%sSums",type));
33  if (!forward1) {
34  check3 = "ForwardSums";
35  forward1 = file->Get(check3);
36  if (!forward1) {
37  Error("CheckQAFile", "No %s, %s, or %s object found in %s",
38  check.Data(),check2.Data(),
39  check3.Data(), filename);
40  ret |= 2;
41  }
42  }
43  }
44  check = Form("Forward%sResults", type);
45  TObject* forward2 = file->Get(check);
46  if (!forward2) {
47  check2 = Form("forward%sResults",type);
48  forward2 = file->Get(check2);
49  if (!forward2) {
50  check3 = "ForwardResults";
51  forward2 = file->Get(check3);
52  if (!forward2) {
53  Error("CheckQAFile", "No %s, %s, or %s object found in %s",
54  check.Data(), check2.Data(),
55  check3.Data(), filename);
56  file->ls();
57  ret |= 4;
58  }
59  }
60  }
61  file->Close();
62  exit(ret);
63 }
64 //
65 // EOF
66 //
const char * filename
Definition: TestFCM.C:1
TFile * file
TList with histograms for a given trigger.
void CheckQAFile(const char *filename, const char *type="")
Definition: CheckQAFile.C:18