31 int main(
int argc, 
char **argv)
 
   36   typedef JRange<double>  JRange_t;
 
   47     JParser<> zap(
"Auxiliary program to make cumulative ROOT histogram.");
 
   49     zap[
'f'] = 
make_field(inputFile,  
"<input file>:<object name>");
 
   51     zap[
'x'] = 
make_field(X,          
"accepted x-range values")     = JRange_t();
 
   52     zap[
'R'] = 
make_field(reverse,    
"sum right to left instead of left to right");
 
   53     zap[
'N'] = 
make_field(normalise,  
"normalise histogram contents");
 
   58   catch(
const exception &error) {
 
   59     FATAL(error.what() << endl);
 
   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.Index(regexp) << 
" (-1 /= OK)" << endl);
 
   88       if (tag.Index(regexp) != -1) {
 
   90         TObject* 
object = key->ReadObj();
 
   94           TH1& h1 = 
dynamic_cast<TH1&
>(*object);
 
  100             for (Int_t i = 0; i <= h1.GetXaxis()->GetNbins() + 1; ++i) {
 
  102               if (X(h1.GetBinCenter(i))) {
 
  103                 W += h1.GetBinContent(i);
 
  106               h1.SetBinContent(i, W);
 
  111             for (Int_t i = h1.GetXaxis()->GetNbins() + 1; i >= 0; --i) {
 
  113               if (X(h1.GetBinCenter(i))) {
 
  114                 W += h1.GetBinContent(i);
 
  117               h1.SetBinContent(i, W);
 
  121           NOTICE(setw(24) << left << h1.GetName() << 
' ' << 
SCIENTIFIC(12,3) << W << endl);
 
  123           if (normalise && W != 0.0) {
 
  127           out.WriteTObject(&h1);
 
Utility class to parse command line options. 
 
I/O formatting auxiliaries. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
General purpose messaging. 
 
Auxiliary class to define a range between two values. 
 
Utility class to parse command line options. 
 
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer. 
 
Auxiliary data structure for floating point format specification. 
 
#define DEBUG(A)
Message macros. 
 
int main(int argc, char *argv[])