33 typedef JRange<Double_t> JRange_t;
51 JParser<> zap(
"Auxiliary program to test contents of 3D histograms.");
53 zap[
'f'] =
make_field(inputFile,
"measurement histogram, e.g: <file name>:<object name>");
54 zap[
'x'] =
make_field(
X,
"accepted x-range values") = JRange_t();
55 zap[
'y'] =
make_field(
Y,
"accepted y-range values") = JRange_t();
56 zap[
'z'] =
make_field(
Z,
"accepted z-range values") = JRange_t();
57 zap[
'c'] =
make_field(
C,
"accepted codomain values") = JRange_t();
68 catch(
const exception &error) {
69 FATAL(error.what() << endl);
72 int number_of_failures = 0;
76 DEBUG(
"Input: " << *input << endl);
81 FATAL(
"File: " << input->getFullFilename() <<
" not opened." << endl);
84 const TRegexp regexp(input->getObjectName());
86 TIter iter(dir->GetListOfKeys());
88 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
90 const TString tag(key->GetName());
92 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
96 if (tag.Contains(regexp) &&
isTObject(key)) {
100 TH3* h3 = (
dynamic_cast<TH3*
>(p) != NULL ? dynamic_cast<TH3*>(p) : NULL);
102 for (map_type::const_iterator
i = zmap.begin();
i != zmap.end(); ++
i) {
105 const JRange_t&
range =
i->second;
107 DEBUG(
"Global test " <<
i->first <<
' ' << (range(value) ?
"passed" :
"failed") << endl);
113 int number_of_events = 0;
114 int number_of_outliers = 0;
118 for (Int_t ix = 1; ix <= h3->GetXaxis()->GetNbins(); ++ix) {
119 for (Int_t iy = 1; iy <= h3->GetYaxis()->GetNbins(); ++iy) {
120 for (Int_t iz = 1; iz <= h3->GetZaxis()->GetNbins(); ++iz) {
122 const Double_t
x = h3->GetXaxis()->GetBinCenter(ix);
123 const Double_t
y = h3->GetYaxis()->GetBinCenter(iy);
124 const Double_t z = h3->GetYaxis()->GetBinCenter(iz);
125 const Double_t
c = h3->GetBinContent(ix, iy, iz);
127 if (
X(x) == !invertX &&
133 const bool ok = (
C(c) == !invertC);
135 DEBUG(
"Test outlier " << h3->GetName() <<
" bin (" << ix <<
"," << iy <<
',' << iz <<
") " << c <<
' ' << (ok ?
"passed" :
"failed") << endl);
138 ++number_of_outliers;
147 FATAL(
"Object at " << *input <<
" is not TH3" << endl);
151 cout << (number_of_outliers > numberOfOutliers ?
RED :
GREEN);
152 NOTICE(
"Number of outliers \"" << p->GetName() <<
"\" = " << number_of_outliers <<
"/" << number_of_events << endl);
155 if (number_of_outliers > numberOfOutliers) {
156 ++number_of_failures;
162 ASSERT(number_of_failures == 0);
Utility class to parse command line options.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
static const double C
Physics constants.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Double_t getResult(const TString &text, TObject *object=NULL)
Get result of given textual formula.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
no fit printf nominal n $STRING awk v X
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
#define DEBUG(A)
Message macros.