#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 | comp_recoqa (TString fn="QA_histograms.root", TString fn2="QA_histograms_test.root", double minP=0.03, int minev=3, int maxfail=3) |
|
bool comp_recoqa |
( |
TString |
fn = "QA_histograms.root" , |
|
|
TString |
fn2 = "QA_histograms_test.root" , |
|
|
double |
minP = 0.03 , |
|
|
int |
minev = 3 , |
|
|
int |
maxfail = 3 |
|
) |
| |
Definition at line 12 of file outdated/run/comp_recoqa.C.
References c1, f, f2, h, h2, name, next, P, and TString.
16 TCanvas *
c1 =
new TCanvas();
19 TString templateFile = gSystem->Getenv(
"VMCWORKDIR");
20 templateFile +=
"/macro/run/";
23 TFile *
f=
new TFile(fn,
"READ");
26 TFile *
f2=
new TFile(templateFile,
"READ");
29 TIter
next(f->GetListOfKeys());
33 while ( (key = (TKey*)
next()) )
36 TObject *obj = key->ReadObj();
39 if (!obj->InheritsFrom(
"TH1F"))
continue;
42 TH1F*
h = (TH1F*) obj;
43 TH1F*
h2 = (TH1F*) f2->Get(name);
47 if ( h->GetMaximum()< h2->GetMaximum())
49 h2->Draw(); h->Draw(
"same");
53 h->Draw(); h2->Draw(
"same");
55 if ( h->GetEntries()<minev )
57 cout <<
"Histogram (almost) empty : " << name <<
" \"" << h2->GetTitle() <<
"\": N = " << h->GetEntries() << endl;
62 double P = h2->KolmogorovTest(h);
65 cout <<
"Incompatible distribution: " << name <<
" \"" << h2->GetTitle() <<
"\": P = " << P << endl;
72 if (failcount<maxfail) fTest = kTRUE;
77 cout <<
" Test passed" << endl;
78 cout <<
" All ok " << endl;
80 cout <<
" Test Failed" << endl;
81 cout <<
" Not Ok " << endl;