12 bool check_pid(
TString fn=
"pid_plot.root",
TString fn2=
"pid_target.root",
double minP = 0.03,
int minev = 3,
int maxfail=3)
15 TString templateFile = gSystem->Getenv(
"VMCWORKDIR");
16 templateFile +=
"/macro/run/";
19 TFile *
f=
new TFile(fn,
"READ");
22 TFile *
f2=
new TFile(templateFile,
"READ");
25 TIter
next(f->GetListOfKeys());
29 while ( (key = (TKey*)
next()) )
31 TObject *obj = key->ReadObj();
34 if (!obj->InheritsFrom(
"TH1F"))
continue;
37 TH1F*
h = (TH1F*) obj;
38 TH1F*
h2 = (TH1F*) f2->Get(name);
40 if ( h->GetEntries()<minev )
42 cout <<
"Histogram (almost) empty : " << name <<
" \"" << h2->GetTitle() <<
"\": N = " << h->GetEntries() << endl;
47 double P = h2->KolmogorovTest(h);
48 cout <<
"<DartMeasurement name=\""<<h2->GetTitle()<<
"\" type=\"numeric/double\">";
50 cout <<
"</DartMeasurement>" << endl;
53 cout <<
"Incompatible distribution: " << name <<
" \"" << h2->GetTitle() <<
"\": P = " << P << endl;
60 if (failcount<maxfail) fTest = kTRUE;
61 cout <<
"<DartMeasurement name=\"failcount\" type=\"numeric/int\">"<<failcount<<
"</DartMeasurement>"<<endl;
65 cout <<
" Test passed" << endl;
66 cout <<
" All ok " << endl;
68 cout <<
" Test Failed" << endl;
69 cout <<
" Not Ok " << endl;
bool check_pid(TString fn="pid_plot.root", TString fn2="pid_target.root", double minP=0.03, int minev=3, int maxfail=3)