27int main(
int argc,
char **argv)
43 JParser<> zap(
"Auxiliary program to print the ranges of x, y, z and c values of 3D ROOT objects.");
45 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
46 zap[
'x'] =
make_field(x,
"x range") = JRange_t();
47 zap[
'y'] =
make_field(y,
"y range") = JRange_t();
48 zap[
'z'] =
make_field(z,
"z range") = JRange_t();
49 zap[
'c'] =
make_field(c,
"c range") = JRange_t();
54 catch(
const exception &error) {
55 FATAL(error.what() << endl);
59 JRange_t X = JRange_t::DEFAULT_RANGE();
60 JRange_t Y = JRange_t::DEFAULT_RANGE();
61 JRange_t Z = JRange_t::DEFAULT_RANGE();
62 JRange_t C = JRange_t::DEFAULT_RANGE();
64 for (vector<JRootObjectID>::const_iterator input = inputFile.begin(); input != inputFile.end(); ++input) {
66 DEBUG(
"Input: " << *input << endl);
68 TDirectory* dir = getDirectory(*input);
71 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
75 const TRegexp regexp(input->getObjectName());
77 TIter iter(dir->GetListOfKeys());
79 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
81 const TString tag(key->GetName());
83 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
87 if (tag.Contains(regexp) && isTObject(key)) {
89 TObject*
object = key->ReadObj();
93 TH3& h3 =
dynamic_cast<TH3&
>(*object);
95 X.combine(x.join(JRange_t(h3.GetXaxis()->GetXmin(), h3.GetXaxis()->GetXmax())));
96 Y.combine(y.join(JRange_t(h3.GetYaxis()->GetXmin(), h3.GetYaxis()->GetXmax())));
97 Z.combine(z.join(JRange_t(h3.GetZaxis()->GetXmin(), h3.GetZaxis()->GetXmax())));
98 C.combine(c.join(JRange_t(h3.GetMinimum(), h3.GetMaximum())));
106 cout <<
SCIENTIFIC(15,5) << X.getLowerLimit() <<
' '
107 <<
SCIENTIFIC(15,5) << Y.getLowerLimit() <<
' '
108 <<
SCIENTIFIC(15,5) << Z.getLowerLimit() <<
' '
109 <<
SCIENTIFIC(15,5) << C.getLowerLimit() <<
' '
110 <<
SCIENTIFIC(15,5) << X.getUpperLimit() <<
' '
111 <<
SCIENTIFIC(15,5) << Y.getUpperLimit() <<
' '
112 <<
SCIENTIFIC(15,5) << Z.getUpperLimit() <<
' '
113 <<
SCIENTIFIC(15,5) << C.getUpperLimit() << endl;