Significance test applied to 2D histograms.  
 More...
#include <JTestSignificance_2D.hh>
 | 
|   | JTestSignificance_2D () | 
|   | Default constructor.  More...
  | 
|   | 
| std::istream &  | read (std::istream &in) override | 
|   | Read test parameters from input.  More...
  | 
|   | 
| std::ostream &  | write (std::ostream &out, std::string delimiter=" ", bool onlyFailures=false) const override | 
|   | Write test result to output.  More...
  | 
|   | 
| void  | test (TObject *o1, TObject *o2) override | 
|   | Applies Significance test for two ROOT TH1 histograms.  More...
  | 
|   | 
| virtual void  | save (TFile *f, std::string path, bool onlyFailures=false) override | 
|   | Writes the test result to root file.  More...
  | 
|   | 
| void  | clear () override | 
|   | Clear results.  More...
  | 
|   | 
| std::string  | getName () override | 
|   | Get test name.  More...
  | 
|   | 
| std::string  | getParameter () override | 
|   | Get parameter name.  More...
  | 
|   | 
| template<class T >  | 
| JTestResult  | JSignificanceTest (T *h1, T *h2, double threshold, double K, std::string testName, std::string parameterName) | 
|   | Significance test for histograms.  More...
  | 
|   | 
 | 
| double  | threshold | 
|   | threshold p-value to decide if test is passed.  More...
  | 
|   | 
| double  | K | 
|   | normalization factor between histograms.  More...
  | 
|   | 
| const std::string  | name = "Significance_2D" | 
|   | test name.  More...
  | 
|   | 
| const std::string  | parameter = "Significance" | 
|   | test name.  More...
  | 
|   | 
Significance test applied to 2D histograms. 
- Author
 - bofearraigh 
 
- 
rgruiz 
 
Definition at line 17 of file JTestSignificance_2D.hh.
 
  
  
      
        
          | JTestSignificance_2D::JTestSignificance_2D  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
  
  
      
        
          | std::istream& JTestSignificance_2D::read  | 
          ( | 
          std::istream &  | 
          in | ) | 
           | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
Read test parameters from input. 
- Parameters
 - 
  
  
 
- Returns
 - input stream 
 
Implements JTest_t.
Definition at line 34 of file JTestSignificance_2D.hh.
double threshold
threshold p-value to decide if test is passed. 
 
double K
normalization factor between histograms. 
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
 
 
 
 
  
  
      
        
          | std::ostream& JTestSignificance_2D::write  | 
          ( | 
          std::ostream &  | 
          out,  | 
         
        
           | 
           | 
          std::string  | 
          delimiter = " ",  | 
         
        
           | 
           | 
          bool  | 
          onlyFailures = false  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
Write test result to output. 
- Parameters
 - 
  
    | out | output stream  | 
    | delimiter | field delimiter  | 
    | onlyFailures | If true, write only failures.  | 
  
   
- Returns
 - output stream 
 
Implements JTest_t.
Definition at line 46 of file JTestSignificance_2D.hh.
   50           out << std::scientific << std::setprecision(2) << (
r->passed ? 
JPP::GREEN : 
JPP::RED) << 
r->print(delimiter) << std::endl;
 
   52         out << std::scientific << std::setprecision(2) << (
r->passed ? 
JPP::GREEN : 
JPP::RED) << 
r->print(delimiter) << std::endl;
 
std::vector< JTestResult > results
 
 
 
 
Applies Significance test for two ROOT TH1 histograms. 
- Parameters
 - 
  
    | o1 | First histogram  | 
    | o2 | Second histogram  | 
  
   
Implements JTest_t.
Definition at line 64 of file JTestSignificance_2D.hh.
   68     if (!(dynamic_cast<TH2*>(o1) == NULL) && !(dynamic_cast<TH2*>(o2) == NULL)) {
 
   70       TH2D* 
h1 =  
dynamic_cast<TH2D*
>(o1);
 
   71       TH2D* h2 =  
dynamic_cast<TH2D*
>(o2);
 
   73       if (h1 -> GetNbinsX() != h2 -> GetNbinsX() || h1 -> GetNbinsY() != h2 -> GetNbinsY())
 
   74         ERROR(
"Histograms with different bining. The objects: " << h1 -> GetName() << 
" can not be compared." << endl);
 
   77         K = h2->GetEntries()/h1->GetEntries();
 
double threshold
threshold p-value to decide if test is passed. 
 
double K
normalization factor between histograms. 
 
std::vector< JTestResult > results
 
then for HISTOGRAM in h0 h1
 
const std::string name
test name. 
 
Structure containing the result of the test. 
 
const std::string parameter
test name. 
 
 
 
 
  
  
      
        
          | virtual void JTestSignificance_2D::save  | 
          ( | 
          TFile *  | 
          f,  | 
         
        
           | 
           | 
          std::string  | 
          path,  | 
         
        
           | 
           | 
          bool  | 
          onlyFailures = false  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
Writes the test result to root file. 
- Parameters
 - 
  
    | f | A ROOT file  | 
    | path | Path in root file.  | 
    | onlyFailures | If true, write only failures.  | 
  
   
Implements JTest_t.
Definition at line 91 of file JTestSignificance_2D.hh.
   99           if (
f -> GetDirectory(
path.c_str())==0) 
f->mkdir(
path.c_str());
 
  104         if (
f -> GetDirectory(
path.c_str())==0) 
f->mkdir(
path.c_str());
 
std::vector< JTestResult > results
 
do set_array DAQHEADER JPrintDAQHeader f
 
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
 
 
 
 
  
  
      
        
          | void JTestSignificance_2D::clear  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
 
  
  
      
        
          | std::string JTestSignificance_2D::getName  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
 
  
  
      
        
          | std::string JTestSignificance_2D::getParameter  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
 
template<class T > 
  
  
      
        
          | JTestResult JTestSignificance_t::JSignificanceTest  | 
          ( | 
          T *  | 
          h1,  | 
         
        
           | 
           | 
          T *  | 
          h2,  | 
         
        
           | 
           | 
          double  | 
          threshold,  | 
         
        
           | 
           | 
          double  | 
          K,  | 
         
        
           | 
           | 
          std::string  | 
          testName,  | 
         
        
           | 
           | 
          std::string  | 
          parameterName  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlineinherited   | 
  
 
Significance test for histograms. 
 
- Parameters
 - 
  
    | h1 | First object  | 
    | h2 | Second object  | 
    | threshold |  | 
    | K | Normalisation parameter  | 
    | parameterName | Name of the parameter used to test the histograms  | 
    | testName | Name of the test used to compare the histograms | 
  
   
- Returns
 - Test result. 
 
Definition at line 51 of file JTestSignificance_t.hh.
   56     if(
h1 -> GetNbinsX() != h2 -> GetNbinsX())
 
   57       ERROR(
"Histograms with different bining. The objects: " << 
h1 -> GetName() << 
" can not be compared." << endl);
 
   60     T* h3 = (
T*)
h1->Clone(
h1->GetName()==h2->GetName() ?
 
   68     for (
int i=0 ; i < 
h1->GetNbinsX() ; ++i){
 
   69       for (
int j=0 ; 
j< 
h1->GetNbinsY() ; ++
j){
 
   70         for (
int k=0 ; 
k< 
h1->GetNbinsY() ; ++
k){
 
   72           double a = 
h1->GetBinContent(i+1,
j+1,
k+1);
 
   73           double b = h2->GetBinContent(i+1,
j+1,
k+1);
 
   76             S += fabs((a - 
K*b)/sqrt(a + 
K*
K*b));
 
   82     S /= (
h1->GetNbinsX()*
h1->GetNbinsY()*
h1->GetNbinsZ());
 
   86     (
S < threshold ? passed = 
false : passed = 
true);
 
   90     h3->SetTitle(title.getTitle().c_str());
 
   93                    string (
h1->GetDirectory()->GetPath()).append(
h1->GetName()),
 
   94                    string (h2->GetDirectory()->GetPath()).append(h2->GetName()),
 
   95                    h1->GetDirectory()->GetFile()->GetName(),
 
   96                    h2->GetDirectory()->GetFile()->GetName(),
 
   97                    parameterName, 
S , threshold, h3, passed);
 
static const uint32_t K[64]
 
Class dedicated to standardize the title of the graphical objects produced by the JTest_t() derived c...
 
then fatal No sound hydrophone file $HYDROPHONE_TXT fi JGraph f $HYDROPHONE_TXT o $HYDROPHONE_ROOT sort gr k
 
#define MAKE_CSTRING(A)
Make C-string. 
 
then for HISTOGRAM in h0 h1
 
Structure containing the result of the test. 
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
do set_variable SIGMA_NS set_variable OUTLIERS set_variable OUTPUT_FILE matrix[${ALPHA_DEG}\deg\] root $JPP JMatrixNZ a $DETECTOR f $INPUT_FILE o $OUTPUT_FILE S
 
std::string to_string(const T &value)
Convert value to string. 
 
 
 
 
  
  
      
        
          | double JTestSignificance_2D::threshold | 
         
       
   | 
  
private   | 
  
 
 
  
  
      
        
          | double JTestSignificance_2D::K | 
         
       
   | 
  
private   | 
  
 
 
  
  
      
        
          | const std::string JTestSignificance_2D::name = "Significance_2D" | 
         
       
   | 
  
private   | 
  
 
 
  
  
      
        
          | const std::string JTestSignificance_2D::parameter = "Significance" | 
         
       
   | 
  
private   | 
  
 
 
Buffer to store results of multiple tests. 
Definition at line 251 of file JTest_t.hh.
 
 
The documentation for this class was generated from the following file: