8 #include "TApplication.h"
28 int main(
int argc,
char **argv)
44 JParser<> zap(
"Auxiliary program to print the ranges of x, y, z and c values of 3D ROOT objects.");
46 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
55 catch(
const exception &error) {
56 FATAL(error.what() << endl);
60 JRange_t X = JRange_t::DEFAULT_RANGE();
61 JRange_t Y = JRange_t::DEFAULT_RANGE();
62 JRange_t Z = JRange_t::DEFAULT_RANGE();
67 DEBUG(
"Input: " << *input << endl);
72 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
76 const TRegexp regexp(input->getObjectName());
78 TIter iter(dir->GetListOfKeys());
80 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
82 const TString tag(key->GetName());
84 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
88 if (tag.Contains(regexp) &&
isTObject(key)) {
90 TObject*
object = key->ReadObj();
94 TH3& h3 =
dynamic_cast<TH3&
>(*object);
96 X.
combine(
x.join(
JRange_t(h3.GetXaxis()->GetXmin(), h3.GetXaxis()->GetXmax())));
97 Y.
combine(
y.join(
JRange_t(h3.GetYaxis()->GetXmin(), h3.GetYaxis()->GetXmax())));
99 C.combine(c.
join(
JRange_t(h3.GetMinimum(), h3.GetMaximum())));
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
I/O formatting auxiliaries.
Auxiliary class to define a range between two values.
Utility class to parse command line options.
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
static const double C
Physics constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Type definition of range.
Auxiliary data structure for floating point format specification.