Changeset 4723 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 08/24/04 18:15:29 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h
r4718 r4723 9 9 #pragma link C++ class MJPedestal+; 10 10 #pragma link C++ class MJCalibration+; 11 //#pragma link C++ class MJCalibrateSignal+;11 #pragma link C++ class MJCalibrateSignal+; 12 12 #pragma link C++ class MJExtractSignal+; 13 13 #pragma link C++ class MJExtractCalibTest+; -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4722 r4723 1266 1266 return; 1267 1267 1268 TString e1 = fEnv->GetValue( "MJCalibration.OutputPath", "");1268 TString e1 = fEnv->GetValue(Form("%s.OutputPath", fName.Data()), ""); 1269 1269 if (!e1.IsNull()) 1270 1270 { … … 1273 1273 } 1274 1274 1275 TString col = fEnv->GetValue( "MJCalibration.Color", "");1275 TString col = fEnv->GetValue(Form("%s.Color", fName.Data()), ""); 1276 1276 if (!col.IsNull()) 1277 1277 { 1278 1278 } 1279 1279 1280 TString dis = fEnv->GetValue( "MJCalibration.Display", "");1280 TString dis = fEnv->GetValue(Form("%s.Display", fName.Data()), ""); 1281 1281 if (dis.BeginsWith("Full", TString::kIgnoreCase)) 1282 1282 SetFullDisplay(); … … 1286 1286 SetNormalDisplay(); 1287 1287 1288 SetRelTimeCalibration(fEnv->GetValue( "MJCalibration.RelTimeCalibration", fRelTimes));1289 SetDataCheck(fEnv->GetValue( "MJCalibration.Datacheck", fDataCheck));1290 SetDebug(fEnv->GetValue( "MJCalibration.Debug", fDebug));1291 SetUseBlindPixel(fEnv->GetValue( "MJCalibration.UseBlindPixel", IsUseBlindPixel()));1292 SetUsePINDiode(fEnv->GetValue( "MJCalibration.UsePINDiode", IsUsePINDiode()));1293 1294 SetOverwrite(fEnv->GetValue( "MJPedestal.AllowOverwrite", fOverwrite));1295 SetInputPath(fEnv->GetValue( "MJPedestal.InputPath", fInputPath));1288 SetRelTimeCalibration(fEnv->GetValue(Form("%s.RelTimeCalibration", fName.Data()), fRelTimes)); 1289 SetDataCheck(fEnv->GetValue(Form("%s.Datacheck", fName.Data()), fDataCheck)); 1290 SetDebug(fEnv->GetValue(Form("%s.Debug", fName.Data()), fDebug)); 1291 SetUseBlindPixel(fEnv->GetValue(Form("%s.UseBlindPixel", fName.Data()), IsUseBlindPixel())); 1292 SetUsePINDiode(fEnv->GetValue(Form("%s.UsePINDiode", fName.Data()), IsUsePINDiode())); 1293 1294 SetOverwrite(fEnv->GetValue(Form("%s.AllowOverwrite", fName.Data()), fOverwrite)); 1295 SetInputPath(fEnv->GetValue(Form("%s.InputPath", fName.Data()), fInputPath)); 1296 1296 } 1297 1297 … … 1426 1426 MTaskList tlist; 1427 1427 plist.AddToList(&tlist); 1428 plist.AddToList(this); // take care of fDisplay! 1428 1429 1429 1430 MReadMarsFile read("Events"); … … 1495 1496 calcalc.SetPulserColor(fColor); 1496 1497 1497 MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode" );1498 MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel" );1499 MFillH fillcam("MHCalibrationChargeCam", "MExtractedSignalCam" );1500 MFillH filltme("MHCalibrationRelTimeCam", "MArrivalTimeCam" );1498 MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode", "FillPINDiode"); 1499 MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel", "FillBlindCam"); 1500 MFillH fillcam("MHCalibrationChargeCam", "MExtractedSignalCam", "FillChargeCam"); 1501 MFillH filltme("MHCalibrationRelTimeCam", "MArrivalTimeCam", "FillRelTime"); 1501 1502 fillpin.SetNameTab("PINDiode"); 1502 1503 fillbnd.SetNameTab("BlindPix"); … … 1566 1567 evtloop.ReadEnv(*fEnv); 1567 1568 1569 //if (!WriteEventloop(evtloop)) 1570 // return kFALSE; 1571 1572 if (!WriteTasks(taskenv.GetTask(), taskenv2.GetTask())) 1573 return kFALSE; 1574 1568 1575 // Execute first analysis 1569 1576 if (!evtloop.Eventloop()) … … 1580 1587 // the display. No idea where this comes from... 1581 1588 // 1589 // FIND THE REASON! THE NEXT CHANGE SOMEBODY DOES MIGHT RESULT 1590 // IN __YOUR__ WORKAROUN NOT WORKING IF IT IS NOT CLEANLY DONE! 1591 /* 1582 1592 if (fDisplay) 1583 1593 { … … 1607 1617 } 1608 1618 } 1609 1619 */ 1610 1620 DisplayResult(plist); 1611 1621 … … 1613 1623 return kFALSE; 1614 1624 1615 *fLog << inf<< GetDescriptor() << ": Done." << endl;1625 *fLog << all << GetDescriptor() << ": Done." << endl; 1616 1626 1617 1627 return kTRUE; … … 1716 1726 } 1717 1727 1728 Bool_t MJCalibration::WriteEventloop(MEvtLoop &evtloop) const 1729 { 1730 if (fOutputPath.IsNull()) 1731 return kTRUE; 1732 1733 const TString oname(GetOutputFile()); 1734 1735 *fLog << inf << "Writing to file: " << oname << endl; 1736 1737 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9); 1738 if (!file.IsOpen()) 1739 { 1740 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 1741 return kFALSE; 1742 } 1743 1744 if (evtloop.Write(fName)<=0) 1745 { 1746 *fLog << err << "Unable to write MEvtloop to " << oname << endl; 1747 return kFALSE; 1748 } 1749 1750 return kTRUE; 1751 } 1752 1753 Bool_t MJCalibration::WriteTasks(MTask *t1, MTask *t2) const 1754 { 1755 if (fOutputPath.IsNull()) 1756 return kTRUE; 1757 1758 const TString oname(GetOutputFile()); 1759 1760 *fLog << inf << "Writing to file: " << oname << endl; 1761 1762 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9); 1763 if (!file.IsOpen()) 1764 { 1765 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 1766 return kFALSE; 1767 } 1768 1769 if (t1->Write()<=0) 1770 { 1771 *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl; 1772 return kFALSE; 1773 } 1774 if (t2->Write()<=0) 1775 { 1776 *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl; 1777 return kFALSE; 1778 } 1779 1780 return kTRUE; 1781 } 1782 1718 1783 // -------------------------------------------------------------------------- 1719 1784 // … … 1736 1801 *fLog << inf << "Writing to file: " << oname << endl; 1737 1802 1738 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);1803 TFile file(oname, "UPDATE", "File created by MJCalibration", 9); 1739 1804 if (!file.IsOpen()) 1740 1805 { -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r4645 r4723 22 22 23 23 class TEnv; 24 class MTask; 24 25 class MRunIter; 25 26 class MSequence; … … 28 29 class MExtractor; 29 30 class MExtractTime; 31 class MEvtLoop; 30 32 31 33 class MExtractBlindPixel; … … 56 58 57 59 TString fOutputPath; // Path to the output files 60 TString fInputPath; // Path to get the data files from 58 61 59 62 TEnv *fEnv; // Input setup-file … … 89 92 90 93 Byte_t fDevices; // Bit-field for used devices for calibration 91 94 95 // Combine these options into a single bit-files (TestBit/SetBit, etc) 92 96 Bool_t fRelTimes; // Flag if relative times have to be calibrated 93 97 Bool_t fDataCheck; // Flag if the data check is run on raw data 94 98 Bool_t fDebug; // Flag if debug option is passed onto cal. classes 99 Bool_t fOverwrite; // Allow to overwite existing files 95 100 96 101 void DisplayResult ( MParList &plist ); … … 102 107 103 108 Bool_t WriteResult(); 109 Bool_t WriteEventloop(MEvtLoop &evtloop) const; 110 Bool_t WriteTasks(MTask *t1, MTask *t2) const; 104 111 void CheckEnv(); 105 112 … … 134 141 void SetSequence(MSequence *seq) { fSequence=seq; } 135 142 void SetOutputPath(const char *path="."); 143 void SetInputPath(const char *path="."); 144 void SetOverwrite(Bool_t b=kTRUE) { fOverwrite=b; } 136 145 137 146 // Displays … … 156 165 Bool_t ProcessFile(MPedestalCam &pedcam); 157 166 Bool_t Process(MPedestalCam &pedcam); 167 168 MStatusDisplay *GetDisplay() { return fDisplay; } 158 169 159 170 ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4722 r4723 440 440 441 441 } 442 443 444 Bool_t MJPedestal::WriteResult() 442 /* 443 Bool_t MJPedestal::WriteEventloop(MEvtLoop &evtloop) const 445 444 { 446 445 if (fOutputPath.IsNull()) … … 452 451 453 452 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJPedestal", 9); 453 if (!file.IsOpen()) 454 { 455 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 456 return kFALSE; 457 } 458 459 if (evtloop.Write(fName)<=0) 460 { 461 *fLog << err << "Unable to write MEvtloop to " << oname << endl; 462 return kFALSE; 463 } 464 465 return kTRUE; 466 } 467 */ 468 Bool_t MJPedestal::WriteResult() 469 { 470 if (fOutputPath.IsNull()) 471 return kTRUE; 472 473 const TString oname(GetOutputFile()); 474 475 *fLog << inf << "Writing to file: " << oname << endl; 476 477 TFile file(oname, "UPDATE", "File created by MJPedestal", 9); 454 478 if (!file.IsOpen()) 455 479 { … … 527 551 return; 528 552 529 TString e1 = fEnv->GetValue( "MJPedestal.OutputPath", "");553 TString e1 = fEnv->GetValue(Form("%s.OutputPath", fName.Data()), ""); 530 554 if (!e1.IsNull()) 531 555 { … … 534 558 } 535 559 536 SetMaxEvents(fEnv->GetValue( "MJPedestal.MaxEvents", fMaxEvents));537 SetOverwrite(fEnv->GetValue( "MJPedestal.AllowOverwrite", fOverwrite));538 539 fUseData = fEnv->GetValue( "MJPedestal.UseData", fUseData);560 SetMaxEvents(fEnv->GetValue(Form("%s.MaxEvents", fName.Data()), fMaxEvents)); 561 SetOverwrite(fEnv->GetValue(Form("%s.AllowOverwrite", fName.Data()), fOverwrite)); 562 563 fUseData = fEnv->GetValue(Form("%s.UseData", fName.Data()), fUseData); 540 564 } 541 565 … … 570 594 MTaskList tlist; 571 595 plist.AddToList(&tlist); 596 plist.AddToList(this); // take care of fDisplay! 572 597 573 598 MReadMarsFile read("Events"); … … 640 665 evtloop.ReadEnv(*fEnv); 641 666 667 // if (!WriteEventloop(evtloop)) 668 // return kFALSE; 669 642 670 // Execute first analysis 643 671 if (!evtloop.Eventloop(fMaxEvents)) … … 654 682 return kFALSE; 655 683 656 *fLog << inf<< GetDescriptor() << ": Done." << endl;684 *fLog << all << GetDescriptor() << ": Done." << endl; 657 685 658 686 return kTRUE; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r4695 r4723 17 17 class TH1D; 18 18 class MExtractor; 19 class MEvtLoop; 19 20 20 21 class MJPedestal : public MParContainer … … 39 40 40 41 TString fOutputPath; // Directory where the F0-files get stored 42 TString fInputPath; // Directory from which to read the data files 41 43 42 44 TEnv *fEnv; // Input setup-file … … 55 57 Bool_t fDataCheck; // Flag if the data check is run on raw data 56 58 Bool_t fUseData; // Use data-runs from sequence instead of pedestal runs 59 Bool_t fOverwrite; // Allow to overwite existing files 57 60 58 61 Int_t fMaxEvents; // Maximum number of events … … 60 63 Bool_t ReadPedestalCam(); 61 64 Bool_t WriteResult(); 65 //Bool_t WriteEventloop(MEvtLoop &evtloop) const; 62 66 63 67 void DisplayResult(MParList &plist); … … 86 90 void SetSequence(const MSequence *seq, Bool_t usedata=kFALSE) { fSequence = seq; } 87 91 void SetOutputPath(const char *path="."); 92 void SetInputPath(const char *path="."); 88 93 void SetEnv(const char *env); 94 void SetOverwrite(Bool_t b=kTRUE) { fOverwrite=b; } 89 95 void SetMaxEvents(Int_t max) { fMaxEvents = max; } 90 96 … … 94 100 void SetNormalDisplay() { fDisplayType = kNormalDisplay; } 95 101 102 MStatusDisplay *GetDisplay() { return fDisplay; } 103 96 104 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam) 97 105 }; -
trunk/MagicSoft/Mars/mjobs/Makefile
r4718 r4723 28 28 MJPedestal.cc \ 29 29 MJCalibration.cc \ 30 MJCalibrateSignal.cc \ 30 31 MJExtractSignal.cc \ 31 32 MJExtractCalibTest.cc
Note:
See TracChangeset
for help on using the changeset viewer.