#include <JTestChi2_t.hh>
Definition at line 15 of file JTestChi2_t.hh.
 
  
  
      
        
          | JTestChi2_t::JTestChi2_t  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
  
  
      
        
          | JTestResult JTestChi2_t::JChi2Test  | 
          ( | 
          TH1 *  | 
          h1,  | 
         
        
           | 
           | 
          TH1 *  | 
          h2,  | 
         
        
           | 
           | 
          double  | 
          threshold  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Definition at line 33 of file JTestChi2_t.hh.
   37     if(
h1 -> GetNbinsX() != h2 -> GetNbinsX())
 
   38       ERROR(
"Histograms with different bining. The objects: " << 
h1 -> GetName() << 
" can not be compared." << endl);
 
   40     double chi2   = 
h1 -> Chi2Test (h2 , 
"WW");
 
   42     double M = 
h1->Integral();
 
   43     double N = h2->Integral();
 
   45     TH2D* h3 = (TH2D*)
h1->Clone(
h1->GetName()==h2->GetName() ?
 
   51     for (
int i=1 ; i < 
h1->GetNbinsX() ; ++i){
 
   53       double m = 
h1->GetBinContent(i);
 
   54       double n = h2->GetBinContent(i);
 
   57         double c = (M*n - N*m)/sqrt((n+m)*(N*
M));       
 
   58         h3->SetBinContent(i,c);
 
   65                             " HA: " << 
h1->GetUniqueID() << 
" " << 
h1->GetName() <<
 
   66                             " HB: " << h2->GetUniqueID() << 
" " << h2->GetName() <<
 
   67                             " Threshold: " << threshold << 
" Result: " << chi2 << 
" " << (r.
passed ? 
"PASSED" : 
"FAILED"));
 
   72     h3->SetTitle(title.getTitle().c_str());
 
#define MAKE_CSTRING(A)
Make C-string. 
 
then for HISTOGRAM in h0 h1
 
#define MAKE_STRING(A)
Make string. 
 
alias put_queue eval echo n
 
std::string to_string(const T &value)
Convert value to string. 
 
then usage $script[input file[working directory[option]]] nWhere option can be N
 
 
 
 
  
  
      
        
          | JTestResult JTestChi2_t::JChi2TestBin_2D  | 
          ( | 
          TH2 *  | 
          h1,  | 
         
        
           | 
           | 
          TH2 *  | 
          h2,  | 
         
        
           | 
           | 
          double  | 
          outliersThreshold,  | 
         
        
           | 
           | 
          double  | 
          chi2Threshold  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Definition at line 89 of file JTestChi2_t.hh.
   91     int nx1 = 
h1->GetNbinsX();
 
   92     int nx2 = h2->GetNbinsX();      
 
   93     int ny1 = 
h1->GetNbinsY();
 
   94     int ny2 = h2->GetNbinsY();
 
   96     double M = 
h1->Integral();
 
   97     double N = h2->Integral();
 
   99     if(nx1 != nx2 || ny1 != ny2 || M == 0 || N == 0)
 
  100       ERROR(
"Histograms with different binning. The objects: " << 
h1->GetName() << 
" can not be compared." << endl);
 
  102     TH2D* h3 = (TH2D*)
h1->Clone(
h1->GetName()==h2->GetName() ?
 
  112     for (
int i=1 ; i<nx1 ; ++i){
 
  113       for (
int j=1 ; 
j<ny1 ; ++
j){
 
  115         double m = 
h1 -> GetBinContent(i,
j);
 
  116         double n = h2 -> GetBinContent(i,
j);
 
  117         double chi2 = (n-m*N/
M)/sqrt(m*N/M);
 
  118         (fabs(chi2) > chi2Threshold ? outliers+=1./(nx1*ny1) : outliers+=0 );
 
  119         h3->SetBinContent(i,
j,chi2);
 
  123     (outliers > outliersThreshold ? r.
passed = 
false : r.
passed = 
true);
 
  126                             " HA: " << 
h1->GetUniqueID() << 
" " << 
h1->GetName() <<
 
  127                             " HB: " << h2->GetUniqueID() << 
" " << h2->GetName() <<
 
  128                             " Threshold: " << outliersThreshold << 
" Result: " << outliers << 
" " << (r.
passed ? 
"PASSED" : 
"FAILED"));
 
  132     h3->SetTitle(title.getTitle().c_str());
 
#define MAKE_CSTRING(A)
Make C-string. 
 
then for HISTOGRAM in h0 h1
 
#define MAKE_STRING(A)
Make string. 
 
alias put_queue eval echo n
 
std::string to_string(const T &value)
Convert value to string. 
 
then usage $script[input file[working directory[option]]] nWhere option can be N
 
 
 
 
The documentation for this class was generated from the following file: