Changeset 4722 for trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
- Timestamp:
- 08/24/04 14:51:17 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4695 r4722 91 91 MJPedestal::MJPedestal(const char *name, const char *title) 92 92 : fEnv(0), fRuns(0), fSequence(0), fExtractor(NULL), fDisplayType(kNormalDisplay), 93 fDataCheck(kFALSE), fUseData(kFALSE), f MaxEvents(0)93 fDataCheck(kFALSE), fUseData(kFALSE), fOverwrite(kFALSE), fMaxEvents(0) 94 94 { 95 95 fName = name ? name : "MJPedestal"; … … 451 451 *fLog << inf << "Writing to file: " << oname << endl; 452 452 453 TFile file(oname, "RECREATE"); 453 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJPedestal", 9); 454 if (!file.IsOpen()) 455 { 456 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 457 return kFALSE; 458 } 454 459 455 460 if (fDisplay && fDisplay->Write()<=0) … … 481 486 } 482 487 488 // -------------------------------------------------------------------------- 489 // 490 // Set the path from which the sequence files are read 491 // 492 void MJPedestal::SetInputPath(const char *path) 493 { 494 fInputPath = path; 495 if (fInputPath.EndsWith("/")) 496 fInputPath = fInputPath(0, fInputPath.Length()-1); 497 } 498 483 499 void MJPedestal::SetEnv(const char *env) 484 500 { … … 496 512 } 497 513 514 // -------------------------------------------------------------------------- 515 // 516 // MJPedestsl allows to setup several option by a resource file: 517 // MJPedestal.OutputPath: path 518 // MJPedestal.MaxEvents: 1000 519 // MJPedestal.AllowOverwrite: yes, no 520 // MJPedestal.UseData: yes, no (use DatRuns from sequence instead of PedRuns) 521 // 522 // For more details see the class description and the corresponding Getters 523 // 498 524 void MJPedestal::CheckEnv() 499 525 { … … 508 534 } 509 535 510 fMaxEvents = fEnv->GetValue("MJPedestal.MaxEvents", fMaxEvents); 511 fUseData = fEnv->GetValue("MJPedestal.UseData", fUseData); 536 SetMaxEvents(fEnv->GetValue("MJPedestal.MaxEvents", fMaxEvents)); 537 SetOverwrite(fEnv->GetValue("MJPedestal.AllowOverwrite", fOverwrite)); 538 539 fUseData = fEnv->GetValue("MJPedestal.UseData", fUseData); 512 540 } 513 541 … … 548 576 MDirIter iter; 549 577 if (fSequence) 550 fUseData ? fSequence->SetupDatRuns(iter) : fSequence->SetupPedRuns(iter); 578 { 579 const Int_t n = fUseData ? fSequence->SetupDatRuns(iter, fInputPath) : fSequence->SetupPedRuns(iter, fInputPath); 580 if (n==0) 581 { 582 *fLog << err << "ERROR - No input files of sequence found!" << endl; 583 return kFALSE; 584 } 585 } 551 586 552 587 if (fDataCheck)
Note:
See TracChangeset
for help on using the changeset viewer.