Changeset 5111
- Timestamp:
- 09/17/04 18:40:50 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5101 r5111 19 19 20 20 -*-*- END OF LINE -*-*- 21 2004/09/17: Markus Gaug 22 23 * mjobs/MJCalibration.[h,cc] 24 - introduced two flags to avoid storage of containers or to 25 store also the histogram containers. Default is like it always 26 was. 27 28 21 29 2004/09/17: Thomas Bretz 22 30 -
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 -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r5064 r5111 116 116 Byte_t fDevices; // Bit-field for used devices for calibration 117 117 118 enum Storage_t // Possible devices for calibration 119 { 120 kNoStorage, 121 kHistsStorage 122 }; 123 124 Byte_t fStorage; // Bit-field for chosen storage type 125 118 126 enum { kRelTimes, kDataCheck, kDebug, kIntensity }; // Possible flags 119 127 … … 121 129 122 130 TString fGeometry; // Class name geometry 131 132 Bool_t IsUseBlindPixel() const { return TESTBIT(fDevices,kUseBlindPixel); } 133 Bool_t IsUsePINDiode () const { return TESTBIT(fDevices,kUsePINDiode); } 134 135 Bool_t IsRelTimes () const { return TESTBIT(fFlags,kRelTimes); } 136 Bool_t IsDataCheck () const { return TESTBIT(fFlags,kDataCheck); } 137 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); } 138 Bool_t IsIntensity () const { return TESTBIT(fFlags,kIntensity); } 139 140 Bool_t IsNoStorage () const { return TESTBIT(fStorage,kNoStorage); } 141 Bool_t IsHistsStorage () const { return TESTBIT(fStorage,kHistsStorage); } 123 142 124 143 void DisplayResult ( MParList &plist ); … … 130 149 131 150 Bool_t WriteResult ( TObject *geom ); 151 Bool_t WriteHists ( MParList &plist ); 132 152 Bool_t WriteEventloop( MEvtLoop &evtloop ) const; 133 153 Bool_t WriteTasks ( MTask *t1, MTask *t2) const; … … 152 172 MCalibrationQECam &GetQECam() { return fQECam; } 153 173 MBadPixelsCam &GetBadPixels() { return fBadPixels; } 154 155 Bool_t IsUseBlindPixel() const;156 Bool_t IsUsePINDiode () const;157 158 Bool_t IsRelTimes () const { return TESTBIT(fFlags,kRelTimes); }159 Bool_t IsDataCheck () const { return TESTBIT(fFlags,kDataCheck); }160 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); }161 Bool_t IsIntensity () const { return TESTBIT(fFlags,kIntensity); }162 174 163 175 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } … … 187 199 void SetUsePINDiode(const Bool_t b=kTRUE); 188 200 201 // Storage 202 void SetNoStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kNoStorage) : CLRBIT(fStorage,kNoStorage); } 203 void SetHistsStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kHistsStorage) : CLRBIT(fStorage,kHistsStorage); } 204 189 205 // Precessing 190 206 Bool_t ReadCalibrationCam();
Note:
See TracChangeset
for help on using the changeset viewer.