33 int main(
int argc, 
char **argv)
 
   49     JParser<> zap(
"Auxiliary program to scale ROOT histograms."\
 
   50                   "\nNote that the formula may contain method names of the specified object.");
 
   52     zap[
'f'] = 
make_field(inputFile,  
"<input file>:<object name>");
 
   54     zap[
'F'] = 
make_field(formula,    
"ROOT TFormula (may contain method names of object)");
 
   61   catch(
const exception &error) {
 
   62     FATAL(error.what() << endl);
 
   70     DEBUG(
"Input: " << *input << endl);
 
   75       ERROR(
"File: " << input->getFullFilename() << 
" not opened." << endl);
 
   79     const TRegexp regexp(input->getObjectName());
 
   81     TIter iter(dir->GetListOfKeys());
 
   83     for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
   85       const TString tag(key->GetName());
 
   87       DEBUG(
"Key: " << tag << 
" match = " << tag.Contains(regexp) << endl);
 
   91       if (tag.Contains(regexp)) {
 
   93         TObject* 
object = key->ReadObj();
 
   97           TH1& 
h1 = 
dynamic_cast<TH1&
>(*object);
 
   99           if (X != 
JRange_t()) { h1.GetXaxis()->SetRangeUser(X.getLowerLimit(), X.getUpperLimit()); }
 
  100           if (Y != 
JRange_t()) { h1.GetYaxis()->SetRangeUser(Y.getLowerLimit(), Y.getUpperLimit()); }
 
  102           double factor = 
getResult(formula, 
object);
 
  104           DEBUG(h1.GetName() << 
' ' << formula << 
' ' << factor << endl);
 
  108           out.WriteTObject(&h1);
 
Utility class to parse command line options. 
 
then for HISTOGRAM in h0 h1
 
#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. 
 
General purpose messaging. 
 
JRange< Double_t > JRange_t
 
Auxiliary class to define a range between two values. 
 
Utility class to parse command line options. 
 
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer. 
 
#define DEBUG(A)
Message macros. 
 
int main(int argc, char *argv[])