Changeset 5111 for trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
- Timestamp:
- 09/17/04 18:40:50 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r5064 r5111 214 214 SetDebug ( kFALSE ); 215 215 SetIntensity ( kFALSE ); 216 217 SetNoStorage ( kFALSE ); 218 SetHistsStorage ( kFALSE ); 219 216 220 } 217 221 … … 983 987 984 988 } 985 986 987 989 return; 988 990 } … … 1306 1308 1307 1309 return Form("%s/%s-F1.root", (const char*)fPathOut, (const char*)fRuns->GetRunsAsFileName()); 1308 }1309 1310 Bool_t MJCalibration::IsUseBlindPixel() const1311 {1312 return TESTBIT(fDevices,kUseBlindPixel);1313 }1314 1315 Bool_t MJCalibration::IsUsePINDiode() const1316 {1317 return TESTBIT(fDevices,kUsePINDiode);1318 1310 } 1319 1311 … … 1490 1482 1491 1483 // -------------------------------------------------------------------------------- 1492 1484 1493 1485 // Setup Tasklist 1494 1486 MParList plist; … … 1546 1538 // Initialize two histogram containers which could be modified in this class 1547 1539 // 1540 MHCalibrationRelTimeCam reltimecam; 1548 1541 MHCalibrationChargeCam chargecam; 1549 1542 MHCalibrationChargeBlindCam blindcam; 1550 1543 plist.AddToList(&chargecam); 1551 1544 plist.AddToList(&blindcam); 1552 1545 if (IsRelTimes()) 1546 plist.AddToList(&reltimecam); 1553 1547 // 1554 1548 // Data Reading tasks … … 1614 1608 drawoption += "datacheck"; 1615 1609 if (fDisplayType == kFullDisplay) 1616 drawoption += " 1610 drawoption += "all"; 1617 1611 1618 1612 fillcam.SetDrawOption(drawoption.Data()); … … 1742 1736 DisplayResult(plist); 1743 1737 1744 if (!WriteResult(plist.FindObject("MGeomCam"))) 1745 return kFALSE; 1746 1738 if (!IsNoStorage()) 1739 { 1740 if (!WriteResult(plist.FindObject("MGeomCam"))) 1741 return kFALSE; 1742 } 1743 1744 if (IsHistsStorage()) 1745 { 1746 if (!WriteHists(plist)) 1747 return kFALSE; 1748 } 1749 1747 1750 *fLog << all << GetDescriptor() << ": Done." << endl; 1748 1751 … … 1759 1762 Bool_t MJCalibration::ReadCalibrationCam() 1760 1763 { 1764 1765 if (IsNoStorage()) 1766 return kFALSE; 1767 1761 1768 const TString fname = GetOutputFile(); 1762 1769 … … 1887 1894 // The following containers are written: 1888 1895 // - MStatusDisplay 1889 // - MCalibrationChargeCam or MCalibrationIntensityChargeCam 1890 // - MCalibrationBlindCam or MCalibrationIntensityBlindCam 1891 // - MCalibrationQECam or MCalibrationIntensityQECam 1896 // - MCalibrationChargeCam or MCalibrationIntensityChargeCam 1897 // - MCalibrationBlindCam or MCalibrationIntensityBlindCam 1898 // - MCalibrationQECam or MCalibrationIntensityQECam 1899 // - MCalibrationChargePINDiode 1892 1900 // - MBadPixelsCam 1901 // If the flag kRelTimes is set, then also: 1902 // - MCalibrationRelTimeCam or MCalibrationIntensityRelTimeCam 1893 1903 // 1894 1904 Bool_t MJCalibration::WriteResult(TObject *geom) … … 1926 1936 else 1927 1937 { 1938 cont.Add(&fBadPixels); 1928 1939 cont.Add(&fCalibrationCam); 1929 1940 cont.Add(&fQECam); … … 1931 1942 } 1932 1943 cont.Add(&fCalibrationPINDiode); 1933 cont.Add(&fBadPixels);1934 1944 if (IsRelTimes()) 1935 1945 cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam); 1936 1946 1937 1947 if (!geom) 1938 1948 *fLog << warn << " - WARNING - MGeomCam... not found!" << endl; 1939 1949 else 1940 1950 cont.Add(geom); 1941 1951 1942 1952 return WriteContainer(cont); 1943 1944 return kTRUE; 1953 } 1954 1955 // -------------------------------------------------------------------------- 1956 // 1957 // Write the calibration histograms into the output file GetOutputFile(), 1958 // if fOutputPath exists. 1959 // 1960 // The following containers are written: 1961 // - MHCalibrationChargeCam 1962 // - MHCalibrationChargeBlindCam 1963 // - MHCalibrationChargePINDiode 1964 // If the flag kRelTimes is set, then also: 1965 // - MHCalibrationRelTimeBlindCam 1966 // 1967 Bool_t MJCalibration::WriteHists(MParList &plist) 1968 { 1969 if (fPathOut.IsNull()) 1970 return kTRUE; 1971 1972 const TString oname(GetOutputFile()); 1973 1974 *fLog << inf << "Writing to file: " << oname << endl; 1975 1976 TFile file(oname, "UPDATE", "File created by MJCalibration", 9); 1977 if (!file.IsOpen()) 1978 { 1979 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 1980 return kFALSE; 1981 } 1982 1983 TObjArray cont; 1984 cont.Add(plist.FindObject("MHCalibrationChargeCam")); 1985 cont.Add(plist.FindObject("MHCalibrationChargeBlindCam")); 1986 cont.Add(plist.FindObject("MHCalibrationChargePINDiode")); 1987 if (IsRelTimes()) 1988 cont.Add(plist.FindObject("MHCalibrationRelTimeCam")); 1989 1990 return WriteContainer(cont); 1945 1991 } 1946 1992
Note:
See TracChangeset
for help on using the changeset viewer.