17 TString templateFile = gSystem->Getenv(
"VMCWORKDIR");
18 templateFile +=
"/macro/QA/run4/";
21 TFile *
f=
new TFile(fn,
"READ");
24 TFile *
f2=
new TFile(templateFile,
"READ");
27 TIter
next(f->GetListOfKeys());
31 while ( (key = (TKey*)
next()) )
33 TObject *obj = key->ReadObj();
36 if (!obj->InheritsFrom(
"TH1F"))
continue;
39 TH1F*
h = (TH1F*) obj;
40 TH1F*
h2 = (TH1F*) f2->Get(name);
42 if ( h->GetEntries()<minev )
44 cout <<
"Histogram (almost) empty : " << name <<
" \"" << h2->GetTitle() <<
"\": N = " << h->GetEntries() << endl;
49 double P = h2->KolmogorovTest(h);
51 htitile.ReplaceAll(
" ",
"");htitile.ReplaceAll(
"#",
"");htitile.ReplaceAll(
"(",
"");htitile.ReplaceAll(
")",
"");
52 htitile.ReplaceAll(
"/",
"");htitile.ReplaceAll(
"^",
"");htitile.ReplaceAll(
"[",
"");htitile.ReplaceAll(
"]",
"");
53 htitile.ReplaceAll(
":",
"");htitile.ReplaceAll(
".",
"");htitile.ReplaceAll(
"{",
"");htitile.ReplaceAll(
"}",
"");
54 cout <<
"<DartMeasurement name=\""<<htitile.Data()<<
"\" type=\"numeric/double\">";
56 cout <<
"</DartMeasurement>" << endl;
59 cout <<
"Incompatible distribution: " << name <<
" \"" << h2->GetTitle() <<
"\": P = " << P << endl;
66 if (failcount<maxfail) fTest = kTRUE;
67 cout <<
"<DartMeasurement name=\"failcount\" type=\"numeric/int\">"<<failcount<<
"</DartMeasurement>"<<endl;
72 FairSystemInfo sysInfo;
73 Float_t maxMemory=sysInfo.GetMaxMemory();
74 cout <<
"<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
76 cout <<
"</DartMeasurement>" << endl;
81 Float_t cpuUsage=ctime/
rtime;
82 cout <<
"<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
84 cout <<
"</DartMeasurement>" << endl;
87 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime
89 cout <<
"CPU usage " << cpuUsage*100. <<
"%" << endl;
90 cout <<
"Max Memory " << maxMemory <<
" MB" << endl;
94 cout <<
" Macro finished successfully" << endl;
95 cout <<
" All ok " << endl;
99 cout <<
" Test Failed" << endl;
100 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)