16 TString templateFile = gSystem->Getenv(
"VMCWORKDIR");
17 templateFile +=
"/macro/QA/run3/";
20 TFile *
f=
new TFile(fn,
"READ");
23 TFile *
f2=
new TFile(templateFile,
"READ");
26 TIter
next(f->GetListOfKeys());
30 while ( (key = (TKey*)
next()) )
32 TObject *
obj = key->ReadObj();
35 if (!obj->InheritsFrom(
"TH1F"))
continue;
38 TH1F*
h = (TH1F*) obj;
39 TH1F*
h2 = (TH1F*) f2->Get(name);
41 if ( h->GetEntries()<minev )
43 cout <<
"Histogram (almost) empty : " << name <<
" \"" << h2->GetTitle() <<
"\": N = " << h->GetEntries() << endl;
48 double P = h2->KolmogorovTest(h);
50 htitile.ReplaceAll(
" ",
"");htitile.ReplaceAll(
"#",
"");htitile.ReplaceAll(
"(",
"");htitile.ReplaceAll(
")",
"");
51 htitile.ReplaceAll(
"/",
"");htitile.ReplaceAll(
"^",
"");htitile.ReplaceAll(
"[",
"");htitile.ReplaceAll(
"]",
"");
52 htitile.ReplaceAll(
":",
"");htitile.ReplaceAll(
".",
"");htitile.ReplaceAll(
"{",
"");htitile.ReplaceAll(
"}",
"");
53 cout <<
"<DartMeasurement name=\""<<htitile.Data()<<
"\" type=\"numeric/double\">";
55 cout <<
"</DartMeasurement>" << endl;
58 cout <<
"Incompatible distribution: " << name <<
" \"" << h2->GetTitle() <<
"\": P = " << P << endl;
65 if (failcount<maxfail) fTest = kTRUE;
66 cout <<
"<DartMeasurement name=\"failcount\" type=\"numeric/int\">"<<failcount<<
"</DartMeasurement>"<<endl;
71 FairSystemInfo sysInfo;
72 Float_t maxMemory=sysInfo.GetMaxMemory();
73 cout <<
"<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
75 cout <<
"</DartMeasurement>" << endl;
80 Float_t cpuUsage=ctime/
rtime;
81 cout <<
"<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
83 cout <<
"</DartMeasurement>" << endl;
86 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime
88 cout <<
"CPU usage " << cpuUsage*100. <<
"%" << endl;
89 cout <<
"Max Memory " << maxMemory <<
" MB" << endl;
93 cout <<
" Macro finished successfully" << endl;
94 cout <<
" All ok " << endl;
98 cout <<
" Test Failed" << endl;
99 cout <<
" Not Ok " << endl;
bool check_complete(TString fn="output_ana.root", TString fn2="ana_target.root", double minP=0.03, int minev=3, int maxfail=3)