Changeset 3336 for trunk/MagicSoft
- Timestamp:
- 02/26/04 17:22:46 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3335 r3336 9 9 * macros/dohtml.C 10 10 - included the path msignals/ 11 11 12 12 13 … … 25 26 26 27 28 27 29 2004/02/26: Thomas Bretz 28 30 … … 84 86 * mfbase/Makefile, mfbase/FBaseLinkDef.h, mfbase/FBaseIncl.h: 85 87 - added 88 89 * merpp.cc: 90 - implemented control of gDebug (root debugging) 91 92 * mfileio/MWriteAsciiFile.[h,cc], mfileio/MWriteFile.[h,cc], 93 mfileio/MWriteRootFile.[h,cc]: 94 - implemented CheckAndWrite return value 95 96 * mfileio/MWriteRootFile.cc: 97 - fixed updating already existing branches (eg concatenating report 98 files) 86 99 87 100 -
trunk/MagicSoft/Mars/macros/dohtml.C
r3335 r3336 42 42 TString sourcedir; 43 43 sourcedir += "manalysis:"; 44 sourcedir += "mastro:"; 44 45 sourcedir += "mbase:"; 45 46 sourcedir += "mcamera:"; 46 47 sourcedir += "mcalib:"; 47 48 sourcedir += "mdata:"; 49 sourcedir += "mfbase:"; 48 50 sourcedir += "mfileio:"; 49 51 sourcedir += "mfilter:"; … … 99 101 html.Convert("pedphotcalc.C", "MARS - Example to use MPedPhotCalc"); 100 102 } 101 102 103 -
trunk/MagicSoft/Mars/macros/rootlogon.C
r3308 r3336 99 99 gInterpreter->AddIncludePath(dir+"macros"); 100 100 gInterpreter->AddIncludePath(dir+"manalysis"); 101 gInterpreter->AddIncludePath(dir+"m signal");101 gInterpreter->AddIncludePath(dir+"mastro"); 102 102 gInterpreter->AddIncludePath(dir+"mbase"); 103 103 gInterpreter->AddIncludePath(dir+"mcamera"); 104 104 gInterpreter->AddIncludePath(dir+"mcalib"); 105 105 gInterpreter->AddIncludePath(dir+"mdata"); 106 gInterpreter->AddIncludePath(dir+"mfbase"); 106 107 gInterpreter->AddIncludePath(dir+"mfileio"); 107 108 gInterpreter->AddIncludePath(dir+"mfilter"); … … 120 121 gInterpreter->AddIncludePath(dir+"mreflector"); 121 122 gInterpreter->AddIncludePath(dir+"mreport"); 123 gInterpreter->AddIncludePath(dir+"msignal"); 122 124 gInterpreter->AddIncludePath(dir+"mtools"); 123 125 -
trunk/MagicSoft/Mars/merpp.cc
r3328 r3336 67 67 gLog << " inputfile.txt: Magic DC currents file." << endl; 68 68 gLog << " ouputfile.root: Merpped root file." << endl; 69 gLog << " -c# :Compression level #=1..9 [default=2]" << endl;70 gLog << " -v# :Verbosity level # [default=2]" << endl;71 gLog << " -u, --update :Update file" << endl;72 gLog << " -a, --no-colors :Do not use Ansii color codes" << endl;69 gLog << " -c# Compression level #=1..9 [default=2]" << endl; 70 gLog << " -v# Verbosity level # [default=2]" << endl; 71 gLog << " -u, --update Update file" << endl; 72 gLog << " -a, --no-colors Do not use Ansii color codes" << endl; 73 73 gLog << " --sql=mysql://user:password@url Insert run into database <raw data only>" << endl; 74 gLog << " --start=yyyy-mm-dd/hh:mm:ss.mmm: Start event time for merpping report files" << endl; 75 gLog << " --stop=yyyy-mm-dd/hh:mm:ss.mmm: Stop event time for merpping report files" << endl; 76 gLog << " --run=#: Only data corresponding to this run number" << endl; 77 gLog << " -?, -h, --help: This help" << endl << endl; 74 gLog << " --start=yyyy-mm-dd/hh:mm:ss.mmm Start event time for merpping report files" << endl; 75 gLog << " --stop=yyyy-mm-dd/hh:mm:ss.mmm Stop event time for merpping report files" << endl; 76 gLog << " --run=# Only data corresponding to this run number" << endl; 77 gLog << " --debug[=n] Enable root debugging (Default: gDebug=1)" << endl; 78 gLog << " -?, -h, --help This help" << endl << endl; 78 79 gLog << " REMARK: At the moment you can process a .raw _or_ a .rep file, only!" << endl << endl; 79 80 } … … 114 115 115 116 gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2); 117 118 gDebug = arg.HasOption("--debug=") ? arg.GetIntAndRemove("--debug=") : 0; 119 if (gDebug==0 && arg.HasOnlyAndRemove("--debug")) 120 gDebug=1; 116 121 117 122 MTime kTimeStart(AnalyseTime(arg.GetStringAndRemove("--start="))); -
trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.cc
r3238 r3336 188 188 // a warning message is print. 189 189 // 190 voidMWriteAsciiFile::CheckAndWrite() const190 Bool_t MWriteAsciiFile::CheckAndWrite() const 191 191 { 192 192 Bool_t written = kFALSE; … … 219 219 } 220 220 221 if (!written) 222 return; 223 224 *fOut << endl; 225 226 if (num!=0) 227 *fLog << warn << "Warning - given number of objects doesn't fit number of written objects." << endl; 221 if (written) 222 { 223 *fOut << endl; 224 225 if (num!=0) 226 *fLog << warn << "Warning - given number of objects doesn't fit number of written objects." << endl; 227 } 228 return kTRUE; 228 229 } 229 230 -
trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.h
r1664 r3336 21 21 TObjArray fAutoDel; //! List of object to be deleted in the destructor 22 22 23 virtual voidCheckAndWrite() const;23 virtual Bool_t CheckAndWrite() const; 24 24 virtual Bool_t IsFileOpen() const; 25 25 virtual Bool_t GetContainer(MParList *pList); -
trunk/MagicSoft/Mars/mfileio/MWriteFile.cc
r2958 r3336 78 78 // write the container if it is already in changed state 79 79 // 80 CheckAndWrite(); 81 82 return kTRUE; 80 return CheckAndWrite(); 83 81 } 84 82 … … 90 88 Bool_t MWriteFile::ReInit(MParList *pList) 91 89 { 92 CheckAndWrite(); 93 return kTRUE; 90 return CheckAndWrite(); 94 91 } 95 92 … … 101 98 Int_t MWriteFile::Process() 102 99 { 103 CheckAndWrite(); 104 return kTRUE; 100 return CheckAndWrite(); 105 101 } 106 102 … … 115 111 // check if the container changed state is set 116 112 // 117 CheckAndWrite(); 118 return kTRUE; 113 return CheckAndWrite(); 119 114 } -
trunk/MagicSoft/Mars/mfileio/MWriteFile.h
r2959 r3336 15 15 16 16 virtual Bool_t IsFileOpen() const = 0; 17 virtual voidCheckAndWrite() const = 0;17 virtual Bool_t CheckAndWrite() const = 0; 18 18 virtual Bool_t GetContainer(MParList *pList) = 0; 19 19 virtual const char *GetFileName() const = 0; -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r3199 r3336 338 338 entry->SetTree(tree); 339 339 340 TString branchname(cname); 341 branchname.Append("."); 342 340 343 // 341 344 // Try to get the branch from the file. 342 345 // If the branch already exists the user specified one branch twice. 343 346 // 344 TBranch *branch = tree->GetBranch( cname);347 TBranch *branch = tree->GetBranch(branchname); 345 348 if (branch) 346 349 { 347 *fLog << err << "Branch '" << cname << "' already existing." << endl;348 return kFALSE;349 } 350 351 //352 // Create a new branch in the actual tree. The branch has the name353 // container name. The type of the container is given by the354 // ClassName entry in the container. The Address is the address of a355 // pointer to the container (gotten from the branch entry). As356 // Basket size we specify a (more or less) common default value.357 // The containers should be written in Splitlevel=1358 //359 *fLog << inf << "Creating Branch " << cname << " of " << cont->ClassName() << "... " << flush;360 361 TString branchname(cname);362 branchname.Append("."); 363 branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress());364 365 //366 // If the branch couldn't be created we have a problem.367 //368 if (!branch)369 {370 *fLog<< endl;371 *fLog << err << "Unable to create branch '" << cname << "'." << endl;372 return kFALSE;373 } 374 375 *fLog << "done." << endl;350 *fLog << inf << "Branch '" << cname << "' already existing... updating." << endl; 351 branch->SetAddress(entry->GetAddress()); 352 } 353 else 354 { 355 // 356 // Create a new branch in the actual tree. The branch has the name 357 // container name. The type of the container is given by the 358 // ClassName entry in the container. The Address is the address of a 359 // pointer to the container (gotten from the branch entry). As 360 // Basket size we specify a (more or less) common default value. 361 // The containers should be written in Splitlevel=1 362 // 363 *fLog << inf << "Creating Branch " << cname << " of " << cont->ClassName(); 364 *fLog << " in tree " << tree->GetName() << "... " << flush; 365 366 branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress()); 367 // 368 // If the branch couldn't be created we have a problem. 369 // 370 if (!branch) 371 { 372 *fLog << endl; 373 *fLog << err << "Unable to create branch '" << cname << "'." << endl; 374 return kFALSE; 375 } 376 377 *fLog << "done." << endl; 378 } 376 379 377 380 // … … 398 401 // has the write flag, all containers in this tree are filled! 399 402 // 400 voidMWriteRootFile::CheckAndWrite() const403 Bool_t MWriteRootFile::CheckAndWrite() const 401 404 { 402 405 TObject *obj; … … 423 426 b->GetTree()->SetBit(kFillTree); 424 427 else 425 b->GetBranch()->Fill(); 428 { 429 if (!b->GetBranch()->Fill()) 430 { 431 *fLog << err << "ERROR - Zero bytes written to branch '" << b->GetBranch()->GetName() << "'... abort." << endl; 432 return kFALSE; 433 } 434 } 426 435 } 427 436 … … 445 454 // of written/filled entries. 446 455 // 447 t->Fill();448 456 t->ResetBit(kFillTree); 449 } 457 if (!t->Fill()) 458 { 459 *fLog << err << "ERROR - Zero bytes written to tree '" << t->GetName() << "'... abort." << endl; 460 return kFALSE; 461 } 462 } 463 return kTRUE; 450 464 } 451 465 -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
r2604 r3336 75 75 //UInt_t fNumEvents; //! Number of events written in a run 76 76 77 voidCheckAndWrite() const;77 Bool_t CheckAndWrite() const; 78 78 Bool_t IsFileOpen() const; 79 79 Bool_t GetContainer(MParList *pList);
Note:
See TracChangeset
for help on using the changeset viewer.