7 #include "TObjString.h"
14 #include "JCompareHistograms/JTestDictionary.hh"
28 TIter iter(dir->GetListOfKeys());
30 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
34 dir->cd(key->GetName());
35 TDirectory *subdir = gDirectory;
40 const TString fullPath(dir->GetPath());
41 TObjArray* t = fullPath.Tokenize(
":");
42 v.push_back(TString(((TObjString *)(t->At(1)))->String() +
"/" + (TString)key->GetName()));
53 int main(
int argc,
char** argv) {
63 zap[
's'] =
make_field(steeringFile ,
"ASCII file with list of histograms and tests");
66 zap[
'o'] =
make_field(output,
"output file root") =
"zebramantis.root";
67 zap[
't'] =
make_field(ascii ,
"output file txt" ) =
"zebramantis.txt";
70 catch(
const exception &error) {
71 ERROR(error.what() << endl);
74 TFile* f1 = TFile::Open(file1.c_str());
75 TFile* f2 = TFile::Open(file2.c_str());
77 TFile out(output.c_str(),
"recreate");
86 TH1::AddDirectory(kFALSE);
87 TH2::AddDirectory(kFALSE);
89 std::ifstream infile(steeringFile);
103 while (
getline(infile, line)) {
105 istringstream iss(line);
106 iss >> name >> testID;
108 const TRegexp regexp(name);
110 if (((*key).Index(regexp) != -1) && (f2->Get(*key))) {
115 d[testID]->read(iss);
116 d[testID]->test(obj1,obj2);
119 (
r->passed ? npassed++ : nfailed++);
123 string path =
MAKE_STRING(Key.substr (Key.find (
'/') + 1 , Key.rfind (
'/')));
125 d[testID]->write(cout);
126 d[testID]->write(results);
127 d[testID]->save(&out, path);
132 infile.seekg(0, ios::beg);
135 results <<
WHITE <<
"PASSED: " << npassed <<
" " <<
" FAILED: " << nfailed <<
" FAILURE FRACTION: " << float (nfailed)/(nfailed+npassed) << endl;
Utility class to parse command line options.
#define MAKE_STRING(A)
Make string.
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Utility class to parse command line options.
void readDir(TDirectory *dir, vector< TString > &v)
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.
int main(int argc, char *argv[])