Changeset 5030 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 09/15/04 14:53:06 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r4906 r5030 54 54 #include "MPedestalCam.h" 55 55 #include "MBadPixelsCam.h" 56 57 #include "MCalibrationChargePINDiode.h" 58 56 59 #include "MCalibrationQECam.h" 60 #include "MCalibrationBlindCam.h" 57 61 #include "MCalibrationChargeCam.h" 58 62 #include "MCalibrationRelTimeCam.h" 59 63 /* 64 #include "MCalibrationIntensityQECam.h" 65 #include "MCalibrationIntensityBlindCam.h" 66 #include "MCalibrationIntensityChargeCam.h" 67 #include "MCalibrationIntensityRelTimeCam.h" 68 */ 60 69 #include "MReadReports.h" 61 70 #include "MReadMarsFile.h" … … 114 123 } 115 124 116 Bool_t MJCalibrateSignal::ReadCalibration(MCalibrationCam &calcam, 117 MCalibrationCam &qecam, 118 MCalibrationCam &tmcam, 119 MBadPixelsCam &badpix, MTask* &ext1, MTask* &ext2, TString &geom) const 125 Bool_t MJCalibrateSignal::ReadCalibration(TObjArray &l, MBadPixelsCam &cam, MTask* &ext1, MTask* &ext2, TString &geom) const 120 126 { 121 127 const TString fname = Form("%s/calib%06d.root", fPathIn.Data(), fSequence.GetSequence()); 122 128 129 *fLog << inf << "Reading from file: " << fname << endl; 130 123 131 TFile file(fname, "READ"); 124 132 if (!file.IsOpen()) … … 128 136 } 129 137 130 if (calcam.Read("MCalibrationChargeCam")<=0)131 {132 *fLog << err << dbginf << "ERROR - Unable to read MCalibrationChargeCam from file " << fname << endl;133 return kFALSE;134 }135 if (qecam.Read("MCalibrationQECam")<=0)136 {137 *fLog << err << dbginf << "ERROR - Unable to read MCalibrationQECam from file " << fname << endl;138 return kFALSE;139 }140 if (tmcam.Read("MCalibrationRelTimeCam")<=0)141 {142 *fLog << err << dbginf << "ERROR - Unable to read MCalibrationRelTimeCam from file " << fname << endl;143 return kFALSE;144 }145 if (badpix.Read("MBadPixelsCam")<=0)146 {147 *fLog << err << dbginf << "ERROR - Unable to read MBadPixelsCam from file " << fname << endl;148 return kFALSE;149 }150 151 138 TObject *o = file.Get("ExtractSignal"); 152 139 if (o && !o->InheritsFrom(MExtractor::Class())) … … 178 165 geom = o ? o->ClassName() : ""; 179 166 180 return kTRUE; 167 TObjArray cont(l); 168 cont.Add(&cam); 169 return ReadContainer(cont); 181 170 } 182 171 … … 219 208 220 209 // Read File 221 MCalibrationChargeCam calcam; 222 MCalibrationQECam qecam; 223 MCalibrationRelTimeCam tmcam; 224 MBadPixelsCam badpix; 210 /* 211 MCalibrationIntensityChargeCam calcam; 212 MCalibrationIntensityQECam qecam; 213 MCalibrationIntensityBlindCam bndcam; 214 MCalibrationIntensityRelTimeCam tmcam; 215 */ 216 MCalibrationChargeCam calcam; 217 MCalibrationQECam qecam; 218 MCalibrationBlindCam bndcam; 219 MCalibrationChargePINDiode pind; 220 MCalibrationRelTimeCam tmcam; 221 MBadPixelsCam badpix; 225 222 226 223 MTask *extractor1=0; … … 228 225 TString geom; 229 226 230 if (!ReadCalibration(calcam, qecam, tmcam, badpix, extractor1, extractor2, geom)) 231 return kFALSE; 227 TObjArray calibcont; 228 calibcont.Add(&calcam); 229 calibcont.Add(&qecam); 230 calibcont.Add(&bndcam); 231 calibcont.Add(&pind); 232 calibcont.Add(&tmcam); 233 234 if (!ReadCalibration(calibcont, badpix, extractor1, extractor2, geom)) 235 return kFALSE; 236 237 badpix.Print(); 232 238 233 239 *fLog << all; … … 261 267 MParList plist; 262 268 plist.AddToList(this); // take care of fDisplay! 263 plist.AddToList(&calcam);264 plist.AddToList(&qecam);265 plist.AddToList(&tmcam);266 269 plist.AddToList(&badcam); 267 270 plist.AddToList(&pedcam); 271 plist.AddToList(&calibcont); 268 272 269 273 // Setup Tasklist -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h
r4906 r5030 7 7 8 8 class TEnv; 9 class TList; 9 10 10 11 class MTask; … … 14 15 class MPedestalCam; 15 16 class MBadPixelsCam; 16 class MCalibrationCam;17 class MCalibrationQECam;18 class MCalibrationRelTimeCam;19 class MCalibrationChargeCam;20 17 21 18 class MJCalibrateSignal : public MJob … … 23 20 private: 24 21 Bool_t WriteResult(); 25 Bool_t ReadCalibration(MCalibrationCam &calcam, 26 MCalibrationCam &qecam, MCalibrationCam &tmcam, 27 MBadPixelsCam &badpix, MTask* &ext1, MTask* &ext2, 28 TString &geom) const; 22 Bool_t ReadCalibration(TObjArray &o, MBadPixelsCam &bpix, 23 MTask* &ext1, MTask* &ext2, TString &geom) const; 29 24 30 25 public: -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r5028 r5030 1453 1453 1454 1454 SetRelTimeCalibration(GetEnv("RelTimeCalibration", IsRelTimes())); 1455 SetIntensity(GetEnv("IntensityCalibration", IsIntensity())); 1455 1456 SetDataCheck(GetEnv("Datacheck", IsDataCheck())); 1456 1457 SetDebug(GetEnv("Debug", IsDebug())); 1457 SetIntensity(GetEnv("Intensity", IsIntensity()));1458 1458 1459 1459 SetUseBlindPixel(GetEnv("UseBlindPixel", IsUseBlindPixel())); … … 1491 1491 if (run < gkSecondBlindPixelInstallation) 1492 1492 { 1493 1494 1493 MCalibrationBlindCamOneOldStyle blindresults; 1495 1494 if (IsIntensity()) … … 1505 1504 else if (run < gkThirdBlindPixelInstallation) 1506 1505 { 1507 1508 1506 MCalibrationBlindCamTwoNewStyle blindresults; 1509 1507 … … 2031 2029 *fLog << inf << "ok." << endl; 2032 2030 2031 TObjArray cont; 2033 2032 if (IsIntensity()) 2034 { 2035 *fLog << inf << " - MBadPixelsIntensityCam..." << flush; 2036 if (fIntensBadCam.Write()<=0) 2037 { 2038 *fLog << err << "Unable to write MBadPixelsIntensityCam to " << oname << endl; 2039 return kFALSE; 2040 } 2041 *fLog << inf << "ok." << endl; 2042 2043 *fLog << inf << " - MCalibrationIntensityChargeCam..." << flush; 2044 if (fIntensCalibCam.Write()<=0) 2045 { 2046 *fLog << err << "Unable to write MCalibrationIntensityChargeCam to " << oname << endl; 2047 return kFALSE; 2048 } 2049 *fLog << inf << "ok." << endl; 2050 2051 *fLog << inf << " - MCalibrationIntensityQECam..." << flush; 2052 if (fIntensQECam.Write()<=0) 2053 { 2054 *fLog << err << "Unable to write MCalibrationIntensityQECam to " << oname << endl; 2055 return kFALSE; 2056 } 2057 *fLog << inf << "ok." << endl; 2058 *fLog << inf << " - MCalibrationIntensityBlindCam..." << flush; 2059 if (fIntensBlindCam.Write()<=0) 2060 { 2061 *fLog << err << "Unable to write MCalibrationIntensityBlindCam to " << oname << endl; 2062 return kFALSE; 2063 } 2064 *fLog << inf << "ok." << endl; 2065 } 2033 { 2034 cont.Add(&fIntensBadCam); 2035 cont.Add(&fIntensCalibCam); 2036 cont.Add(&fIntensQECam); 2037 cont.Add(&fIntensBlindCam); 2038 } 2066 2039 else 2067 { 2068 *fLog << inf << " - MCalibrationChargeCam..." << flush; 2069 if (fCalibrationCam.Write()<=0) 2070 { 2071 *fLog << err << "Unable to write MCalibrationChargeCam to " << oname << endl; 2072 return kFALSE; 2073 } 2074 *fLog << inf << "ok." << endl; 2075 2076 *fLog << inf << " - MCalibrationQECam..." << flush; 2077 if (fQECam.Write()<=0) 2078 { 2079 *fLog << err << "Unable to write MCalibrationQECam to " << oname << endl; 2080 return kFALSE; 2081 } 2082 *fLog << inf << "ok." << endl; 2083 2084 *fLog << inf << " - MCalibrationBlindCam..." << flush; 2085 if (fCalibrationBlindCam.Write()<=0) 2086 { 2087 *fLog << err << "Unable to write MCalibrationBlindCam to " << oname << endl; 2088 return kFALSE; 2089 } 2090 *fLog << inf << "ok." << endl; 2091 } 2092 2093 *fLog << inf << " - MCalibrationChargePINDiode..." << flush; 2094 if (fCalibrationPINDiode.Write()<=0) 2095 { 2096 *fLog << err << "Unable to write MCalibrationChargePINDiode to " << oname << endl; 2097 return kFALSE; 2098 } 2099 *fLog << inf << "ok." << endl; 2100 2101 *fLog << inf << " - MBadPixelsCam..." << flush; 2102 if (fBadPixels.Write()<=0) 2103 { 2104 *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl; 2105 return kFALSE; 2106 } 2107 *fLog << inf << "ok." << endl; 2040 { 2041 cont.Add(&fCalibrationCam); 2042 cont.Add(&fQECam); 2043 cont.Add(&fCalibrationBlindCam); 2044 } 2045 cont.Add(&fCalibrationPINDiode); 2046 cont.Add(&fBadPixels); 2047 if (IsRelTimes()) 2048 cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam); 2108 2049 2109 2050 if (!geom) 2110 *fLog << warn << " - WARNING: MGeomCam... not found!" << endl; 2111 { 2112 *fLog << inf << " - MGeomCam..." << flush; 2113 if (geom->Write()<=0) 2114 { 2115 *fLog << err << "Unable to write MGeomCam to " << oname << endl; 2116 return kFALSE; 2117 } 2118 *fLog << inf << "ok." << endl; 2119 } 2120 2121 if (IsRelTimes()) 2122 { 2123 if (IsIntensity()) 2124 { 2125 *fLog << inf << " - MCalibrationIntensityRelTimeCam..." << flush; 2126 if (fIntensRelTimeCam.Write()<=0) 2127 { 2128 *fLog << err << "Unable to write MCalibrationIntensityRelTimeCam to " << oname << endl; 2129 return kFALSE; 2130 } 2131 *fLog << inf << "ok." << endl; 2132 } 2133 else 2134 { 2135 *fLog << inf << " - MCalibrationRelTimeCam..." << flush; 2136 if (fRelTimeCam.Write()<=0) 2137 { 2138 *fLog << err << "Unable to write MCalibrationRelTimeCam to " << oname << endl; 2139 return kFALSE; 2140 } 2141 *fLog << inf << "ok." << endl; 2142 } 2143 2144 } 2051 *fLog << warn << " - WARNING - MGeomCam... not found!" << endl; 2052 else 2053 cont.Add(geom); 2054 2055 return WriteContainer(cont); 2145 2056 2146 2057 return kTRUE; 2147 2148 2058 } 2149 2059 -
trunk/MagicSoft/Mars/mjobs/MJob.cc
r4760 r5030 33 33 34 34 #include <TEnv.h> 35 #include <TFile.h> 35 36 #include <TSystem.h> 37 38 #include "MIter.h" 36 39 37 40 #include "MLog.h" … … 169 172 return loop.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug) ? kTRUE : kFALSE; 170 173 } 174 175 Bool_t MJob::WriteContainer(TCollection &list) const 176 { 177 if (!gFile) 178 { 179 *fLog << err << dbginf << "ERROR - No file open (gFile==0)" << endl; 180 return kFALSE; 181 } 182 183 MIter Next(&list); 184 MParContainer *o=0; 185 while ((o=Next())) 186 { 187 *fLog << inf << " - Writing " << o->GetDescriptor() << "..." << flush; 188 if (o->Write()<=0) 189 { 190 *fLog << err << dbginf << "ERROR - Writing " << o->GetDescriptor() << " to file " << gFile->GetName() << endl; 191 return kFALSE; 192 } 193 *fLog << "done." << endl; 194 } 195 return kTRUE; 196 } 197 198 Bool_t MJob::ReadContainer(TCollection &list) const 199 { 200 if (!gFile) 201 { 202 *fLog << err << dbginf << "ERROR - No file open (gFile==0)" << endl; 203 return kFALSE; 204 } 205 206 MIter Next(&list); 207 MParContainer *o=0; 208 while ((o=Next())) 209 { 210 *fLog << inf << " - Reading " << o->GetDescriptor() << "..." << flush; 211 if (o->Read(o->GetName())<=0) 212 { 213 *fLog << err << dbginf << "ERROR - Writing " << o->GetDescriptor() << " to file " << gFile->GetName() << endl; 214 return kFALSE; 215 } 216 *fLog << "done." << endl; 217 } 218 return kTRUE; 219 } -
trunk/MagicSoft/Mars/mjobs/MJob.h
r4760 r5030 38 38 virtual Bool_t CheckEnvLocal() { return kTRUE; } 39 39 40 Bool_t WriteContainer(TCollection &list) const; 41 Bool_t ReadContainer(TCollection &list) const; 42 40 43 public: 41 44 MJob(const char *name=NULL, const char *title=NULL);
Note:
See TracChangeset
for help on using the changeset viewer.