Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
JCOMPAREHISTOGRAMS::JTest_t Class Referenceabstract

Interface to read input and write output for TObject tests. More...

#include <JTest_t.hh>

Inheritance diagram for JCOMPAREHISTOGRAMS::JTest_t:
JCOMPAREHISTOGRAMS::JTestChi2_1D JCOMPAREHISTOGRAMS::JTestChi2_2D JCOMPAREHISTOGRAMS::JTestChi2_Bin JCOMPAREHISTOGRAMS::JTestChi2R_1D JCOMPAREHISTOGRAMS::JTestChi2R_2D JCOMPAREHISTOGRAMS::JTestIdentical_1D JCOMPAREHISTOGRAMS::JTestIdentical_2D JCOMPAREHISTOGRAMS::JTestIdentical_3D JCOMPAREHISTOGRAMS::JTestKolmogorov_1D JCOMPAREHISTOGRAMS::JTestKolmogorov_2D JCOMPAREHISTOGRAMS::JTestKolmogorovSlice JCOMPAREHISTOGRAMS::JTestRuns_1D JCOMPAREHISTOGRAMS::JTestRuns_2D JCOMPAREHISTOGRAMS::JTestSignificance_1D JCOMPAREHISTOGRAMS::JTestSignificance_2D JCOMPAREHISTOGRAMS::JTestZero

Public Member Functions

 JTest_t (const std::string &name, const std::string &type)
 Constructor. More...
 
virtual std::istream & read (std::istream &in)=0
 Read test parameters from input. More...
 
std::ostream & write (std::ostream &out, const char delimiter= ' ', const bool onlyFailures=false) const
 Write test result to output. More...
 
virtual void test (TObject *o1, TObject *o2)=0
 Tests compatibility between two TObjects. More...
 
virtual void save (TFile *f, const std::string &path, const bool onlyFailures=false)
 Writes the test result to root file. More...
 
virtual void clear ()
 Clear results. More...
 
const std::string & getTestName ()
 Get test name. More...
 
const std::string & getResultType ()
 Get result type. More...
 

Public Attributes

std::vector< JTestResultresults
 Buffer to store results of multiple tests.*/. More...
 

Protected Attributes

const std::string testName
 test name More...
 
const std::string resultType
 result type More...
 

Detailed Description

Interface to read input and write output for TObject tests.


This is an abstract class from which the different tests are derived.
All tests have in common the methods from this interface.
For each test, the parameters are passed through an istream, and parsed by the read() method.
For each test, the different results are stored in the results buffer.
The write() method is used to print a message with the result of the test.
The save() method is used to save a graphical output with the test results into a .root file.
The clear() method clears the results buffer. For a list of available tests see JTestDictionary()

Definition at line 46 of file JTest_t.hh.

Constructor & Destructor Documentation

JCOMPAREHISTOGRAMS::JTest_t::JTest_t ( const std::string &  name,
const std::string &  type 
)
inline

Constructor.

Parameters
nametest name
typeresult type

Definition at line 57 of file JTest_t.hh.

58  :
59  testName (name),
60  resultType(type)
61  {}
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
const std::string resultType
result type
Definition: JTest_t.hh:167
const std::string testName
test name
Definition: JTest_t.hh:166

Member Function Documentation

virtual std::istream& JCOMPAREHISTOGRAMS::JTest_t::read ( std::istream &  in)
pure virtual
std::ostream& JCOMPAREHISTOGRAMS::JTest_t::write ( std::ostream &  out,
const char  delimiter = ' ',
const bool  onlyFailures = false 
) const
inline

Write test result to output.

Parameters
outoutput stream
delimiterfield delimiter
onlyFailuresif true, write only failures.
Returns
output stream

Definition at line 81 of file JTest_t.hh.

83  {
84 
85  for (std::vector<JTestResult>::const_iterator r = results.begin() ; r != results.end() ; ++r) {
86 
87  if (onlyFailures && r->passed) {
88  continue;
89  }
90 
91  print(out, *r, delimiter, true);
92  }
93 
94  return out;
95  }
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter= ' ', const bool useColors=true)
Print test summary.
data_type r[M+1]
Definition: JPolint.hh:742
std::vector< JTestResult > results
Buffer to store results of multiple tests.*/.
Definition: JTest_t.hh:162
virtual void JCOMPAREHISTOGRAMS::JTest_t::test ( TObject o1,
TObject o2 
)
pure virtual
virtual void JCOMPAREHISTOGRAMS::JTest_t::save ( TFile *  f,
const std::string &  path,
const bool  onlyFailures = false 
)
inlinevirtual

Writes the test result to root file.

Parameters
fA ROOT file
pathPath in root file.
onlyFailuresIf true, write only failures.

Definition at line 113 of file JTest_t.hh.

115  {
116 
117  using namespace std;
118 
119  if (f -> GetDirectory(path.c_str())==0) {
120  f->mkdir(path.c_str());
121  }
122 
123  f->cd(path.c_str());
124 
125  for (vector<JTestResult>::const_iterator r = results.begin() ; r != results.end() ; ++r){
126 
127  if (!onlyFailures || !r->passed){
128  r->obj->Write();
129  }
130  }
131  }
then JMuonPostfit f
data_type r[M+1]
Definition: JPolint.hh:742
std::vector< JTestResult > results
Buffer to store results of multiple tests.*/.
Definition: JTest_t.hh:162
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null)&';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null)&';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
virtual void JCOMPAREHISTOGRAMS::JTest_t::clear ( )
inlinevirtual

Clear results.

Definition at line 137 of file JTest_t.hh.

137  {
138  results.clear();
139  }
std::vector< JTestResult > results
Buffer to store results of multiple tests.*/.
Definition: JTest_t.hh:162
const std::string& JCOMPAREHISTOGRAMS::JTest_t::getTestName ( )
inline

Get test name.

Returns
test name

Definition at line 147 of file JTest_t.hh.

147  {
148  return testName;
149  }
const std::string testName
test name
Definition: JTest_t.hh:166
const std::string& JCOMPAREHISTOGRAMS::JTest_t::getResultType ( )
inline

Get result type.

Returns
result type

Definition at line 157 of file JTest_t.hh.

157  {
158  return resultType;
159  }
const std::string resultType
result type
Definition: JTest_t.hh:167

Member Data Documentation

std::vector<JTestResult> JCOMPAREHISTOGRAMS::JTest_t::results

Buffer to store results of multiple tests.*/.

Definition at line 162 of file JTest_t.hh.

const std::string JCOMPAREHISTOGRAMS::JTest_t::testName
protected

test name

Definition at line 166 of file JTest_t.hh.

const std::string JCOMPAREHISTOGRAMS::JTest_t::resultType
protected

result type

Definition at line 167 of file JTest_t.hh.


The documentation for this class was generated from the following file: