Changeset 2728 for trunk/MagicSoft/Mars/readraw.cc
- Timestamp:
- 12/20/03 13:46:17 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/readraw.cc
r2580 r2728 54 54 gLog << " readraw [-h] [-?] [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl; 55 55 gLog << " input file: Magic DAQ binary file." << endl; 56 gLog << " -a0: Do not use Ansii codes." << endl;57 56 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; 60 60 } 61 61 … … 73 73 StartUpMessage(); 74 74 75 //76 75 // Evaluate arguments 77 //78 76 MArgs arg(argc, argv); 79 77 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) 81 81 { 82 82 Usage(); … … 84 84 } 85 85 86 // 87 // Set verbosity to highest level. 88 // 86 // Set verbosity 89 87 gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2); 90 88 91 if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0) 89 // Set color usage 90 if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a")) 92 91 gLog.SetNoColors(); 93 92 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; 103 104 } 104 105 … … 128 129 // open the file 129 130 // 130 gLog << " Open the file '" << kNamein << "'" << endl;131 gLog << inf << " Open the file '" << kNamein << "'" << endl; 131 132 TFile input(kNamein, "READ"); 132 133 … … 137 138 TTree *runtree = (TTree*)input.Get("RunHeaders"); 138 139 if (!runtree) 139 gLog << " WARNING: This file has NOTree 'RunHeaders'" << endl << endl;140 gLog << warn << " WARNING - This file has no Tree 'RunHeaders'" << endl << endl; 140 141 else 141 142 { … … 151 152 // open the DataTree and read in 152 153 // 153 gLog << " Check the Tree 'Events'" << endl ;154 gLog << inf << " Check the Tree 'Events'" << endl ; 154 155 TTree *evttree = (TTree*)input.Get("Events") ; 155 156 if (!evttree) 156 157 { 157 gLog << "Tree 'Events' not found in file... exit!" << endl;158 gLog << err << "Tree 'Events' not found in file... exit!" << endl; 158 159 return -1; 159 160 } … … 184 185 const Int_t nent = (Int_t)evttree->GetEntries(); 185 186 186 gLog << endl;187 187 gLog << " Entries in Tree Data: " << dec << nent << endl; 188 188 gLog << endl; … … 190 190 for (Int_t i = 0; i<nent; i++) 191 191 { 192 gLog << "Entry: " << i << endl;192 gLog << all << "Entry: " << i << endl; 193 193 194 194 //
Note:
See TracChangeset
for help on using the changeset viewer.