12 #include "TProfile3D.h"
29 int main(
int argc,
char **argv)
41 JParser<> zap(
"Auxiliary program to project 3D histograms.");
43 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
50 catch(
const exception &error) {
51 FATAL(error.what() << endl);
61 FATAL(
"Invalid operation: "
62 << (px ?
"" :
"no") <<
" X projection " <<
" and "
63 << (py ?
"" :
"no") <<
" Y projection " <<
" and "
64 << (pz ?
"" :
"no") <<
" Z projection " << endl);
71 DEBUG(
"Input: " << *input << endl);
76 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
80 const TRegexp regexp(input->getObjectName());
82 TIter iter(dir->GetListOfKeys());
84 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
86 const TString tag(key->GetName());
88 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
92 if (tag.Contains(regexp) &&
isTObject(key)) {
94 TH3* h3 =
dynamic_cast<TH3*
>(key->ReadObj());
99 listOfObjects.push_back(h3->ProjectionX(
MAKE_CSTRING(h3->GetName() <<
"_px")));
101 listOfObjects.push_back(h3->ProjectionY(
MAKE_CSTRING(h3->GetName() <<
"_py")));
103 listOfObjects.push_back(h3->ProjectionZ(
MAKE_CSTRING(h3->GetName() <<
"_pz")));
109 if (!listOfObjects.empty()) {
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
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
int main(int argc, char **argv)
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.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).