35int main(
int argc,
char **argv)
48 JParser<> zap(
"General purpose plot program to draw ROOT objects.");
50 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
52 zap[
'w'] =
make_field(canvas,
"size of canvas <nx>x<ny> [pixels]") =
JCanvas(500, 500);
53 zap[
'B'] =
make_field(batch,
"batch processing");
58 catch(
const exception &error) {
59 FATAL(error.what() << endl);
63 gROOT->SetBatch(batch);
65 TApplication* tp =
new TApplication(
"user", NULL, NULL);
66 TCanvas* cv =
new TCanvas(
"c1",
"c1", canvas.
x, canvas.
y);
69 ((TRootCanvas *) cv->GetCanvasImp())->Connect(
"CloseWindow()",
"TApplication", tp,
"Terminate()");
72 cv->SetFillStyle(4000);
73 cv->SetFillColor(kWhite);
77 for (vector<JRootObjectID>::const_iterator input = inputFile.begin(); input != inputFile.end(); ++input) {
79 DEBUG(
"Input: " << *input << endl);
81 TDirectory* dir = getDirectory(*input);
84 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
88 const TRegexp regexp(input->getObjectName());
90 TIter iter(dir->GetListOfKeys());
92 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
94 const TString tag(key->GetName());
96 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
100 if (tag.Contains(regexp) && isTObject(key)) {
104 if (
dynamic_cast<TText*
> (p) ||
105 dynamic_cast<TLine*
> (p) ||
106 dynamic_cast<TEllipse*
>(p) ||
107 dynamic_cast<TBox*
> (p)) {
109 DEBUG(
"Add object: " << tag <<
" with name <" << p->GetName() <<
">" << endl);