Ignore:
Timestamp:
12/20/03 13:46:17 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/readraw.cc

    r2580 r2728  
    5454    gLog << "   readraw [-h] [-?] [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl;
    5555    gLog << "     input file:   Magic DAQ binary file." << endl;
    56     gLog << "     -a0: Do not use Ansii codes." << endl;
    5756    gLog << "     -vn: Verbosity level n [default=2]" << endl;
    58     gLog << "     -d1: print data in decimal values" << endl;
    59     gLog << "     -?/-h: This help" << endl << endl;
     57    gLog << "     -d, --dec: print data in decimal values" << endl;
     58    gLog << "     -a, --no-colors: Do not use Ansii color codes" << endl;
     59    gLog << "     -?,-h,--help: This help" << endl << endl;
    6060}
    6161
     
    7373    StartUpMessage();
    7474
    75     //
    7675    // Evaluate arguments
    77     //
    7876    MArgs arg(argc, argv);
    7977
    80     if (arg.HasOption("-?") || arg.HasOption("-h"))
     78    // check for the right usage of the program
     79    if (arg.HasOption("-?") || arg.HasOption("-h") || arg.HasOption("--help") ||
     80        arg.GetNumArguments()!=1)
    8181    {
    8282        Usage();
     
    8484    }
    8585
    86     //
    87     // Set verbosity to highest level.
    88     //
     86    // Set verbosity
    8987    gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
    9088
    91     if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0)
     89    // Set color usage
     90    if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a"))
    9291        gLog.SetNoColors();
    9392
    94     const bool kDecimal = arg.HasOption("-d") && arg.GetIntAndRemove("-d")==1;
    95 
    96     //
    97     // check for the right usage of the program
    98     //
    99     if (arg.GetNumArguments()!=1)
    100     {
    101         Usage();
    102         return -1;
     93    // Set usage of decimal values
     94    const bool kDecimal = arg.HasOnlyAndRemove("-d") || arg.HasOnlyAndRemove("--dec");
     95
     96    //
     97    // check for unidentified options
     98    //
     99    if (arg.GetNumOptions()>0)
     100    {
     101        gLog << warn << "WARNING - unknown commandline options..." << endl;
     102        arg.Print("options");
     103        gLog << endl;
    103104    }
    104105
     
    128129    //  open the file
    129130    //
    130     gLog << " Open the file '" << kNamein << "'" << endl;
     131    gLog << inf << " Open the file '" << kNamein << "'" << endl;
    131132    TFile input(kNamein, "READ");
    132133
     
    137138    TTree *runtree = (TTree*)input.Get("RunHeaders");
    138139    if (!runtree)
    139         gLog << " WARNING: This file has NO Tree 'RunHeaders'" << endl << endl;
     140        gLog << warn << " WARNING - This file has no Tree 'RunHeaders'" << endl << endl;
    140141    else
    141142    {
     
    151152    // open the DataTree and read in
    152153    //
    153     gLog << " Check the Tree 'Events'" << endl ;
     154    gLog << inf << " Check the Tree 'Events'" << endl ;
    154155    TTree *evttree = (TTree*)input.Get("Events") ;
    155156    if (!evttree)
    156157    {
    157         gLog << "Tree 'Events' not found in file... exit!" << endl;
     158        gLog << err << "Tree 'Events' not found in file... exit!" << endl;
    158159        return -1;
    159160    }
     
    184185    const Int_t nent = (Int_t)evttree->GetEntries();
    185186
    186     gLog << endl;
    187187    gLog << " Entries in Tree Data: " << dec << nent << endl;
    188188    gLog << endl;
     
    190190    for (Int_t i = 0; i<nent; i++)
    191191    {
    192         gLog << "Entry: " << i << endl;
     192        gLog << all << "Entry: " << i << endl;
    193193
    194194        //
Note: See TracChangeset for help on using the changeset viewer.