#include "TString.h"
#include "TFile.h"
#include "TCanvas.h"
#include "TKey.h"
#include <iostream>
#include "TH1F.h"
#include "TRandom.h"
Go to the source code of this file.
|
bool | check_complete (TString fn="output_ana.root", TString fn2="ana_target.root", double minP=0.03, int minev=3, int maxfail=3) |
|
bool check_complete |
( |
TString |
fn = "output_ana.root" , |
|
|
TString |
fn2 = "ana_target.root" , |
|
|
double |
minP = 0.03 , |
|
|
int |
minev = 3 , |
|
|
int |
maxfail = 3 |
|
) |
| |
Definition at line 12 of file outdated/run/check_complete.C.
References exit(), f, f2, h, h2, name, next, obj, P, and TString.
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;