Changeset 4682 for trunk/MagicSoft
- Timestamp:
- 08/18/04 14:56:21 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4681 r4682 29 29 - added return value 30 30 31 32 33 2004/08/18 : Wolfgang Wittek 31 * mjobs/MJCalibration.cc: 32 - simplified FindColor by 1000% for later move to a new location 33 34 * mpedestal/MPedCalcFromLoGain.cc: 35 - output the range only if it has changed 36 37 38 39 2004/08/18: Wolfgang Wittek 34 40 35 41 * mastro/MTransCelLocCam.[h,cc] -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4670 r4682 95 95 #include <TLatex.h> 96 96 #include <TLegend.h> 97 #include <TRegexp.h> 97 98 #include <TPaveText.h> 98 99 #include <TPaveStats.h> … … 1125 1126 Bool_t MJCalibration::FindColor() 1126 1127 { 1127 1128 if (fSequence) 1129 { 1130 fColor = MCalibrationCam::kCT1; 1131 return kTRUE; 1132 } 1133 1134 const UInt_t nruns = fRuns->GetNumRuns(); 1135 1136 if (nruns == 0) 1128 if (fSequence) 1129 { 1130 fColor = MCalibrationCam::kCT1; 1131 return kTRUE; 1132 } 1133 1134 const UInt_t nruns = fRuns->GetNumRuns(); 1135 if (nruns == 0) 1136 return kFALSE; 1137 1138 fRuns->Reset(); 1139 1140 TString filenames; 1141 while (!(filenames=((MDirIter*)fRuns)->Next()).IsNull()) 1142 { 1143 MCalibrationCam::PulserColor_t newcolor = MCalibrationCam::kNONE; 1144 1145 TString number = filenames(TRegexp("[0-9]+_._.+[.]root$")); 1146 Int_t num = atoi(number.Data()); 1147 1148 if (num<gkIFAEBoxInaugurationRun) 1149 newcolor = MCalibrationCam::kCT1; 1150 1151 switch (num) 1152 { 1153 case 26402: 1154 newcolor = MCalibrationCam::kBLUE; 1155 break; 1156 1157 case 30090: 1158 case 20660: 1159 case 20661: 1160 case 26408: 1161 case 26409: 1162 case 26412: 1163 case 26568: 1164 case 26924: 1165 newcolor = MCalibrationCam::kGREEN; 1166 break; 1167 1168 case 27474: 1169 newcolor = MCalibrationCam::kNONE; 1170 *fLog << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! " << endl; 1171 return kFALSE; 1172 1173 default: 1174 if (filenames.Contains("green")) 1175 newcolor = MCalibrationCam::kGREEN; 1176 if (filenames.Contains("blue")) 1177 newcolor = MCalibrationCam::kBLUE; 1178 if (filenames.Contains("uv")) 1179 newcolor = MCalibrationCam::kUV; 1180 if (filenames.Contains("ct1")) 1181 newcolor = MCalibrationCam::kCT1; 1182 } 1183 1184 if (newcolor==MCalibrationCam::kNONE) 1185 { 1186 *fLog << err << "No color found for " << filenames << "... abort." << endl; 1187 return kFALSE; 1188 } 1189 1190 if (fColor == MCalibrationCam::kNONE) 1191 fColor = newcolor; 1192 1193 if (fColor != newcolor) 1194 { 1195 *fLog << err << "Color mismatch found in " << filenames << "... abort." << endl; 1196 return kFALSE; 1197 } 1198 } 1199 1200 *fLog << inf << "Found color: "; 1201 switch (fColor) 1202 { 1203 case MCalibrationCam::kBLUE: *fLog << "kBLUE"; break; 1204 case MCalibrationCam::kGREEN: *fLog << "kGREEN"; break; 1205 case MCalibrationCam::kUV: *fLog << "kUV"; break; 1206 case MCalibrationCam::kCT1: *fLog << "kCT1"; break; 1207 default: *fLog << "<none>"; break; 1208 } 1209 *fLog << endl; 1210 1211 if (fColor!=MCalibrationCam::kNONE) 1212 return kTRUE; 1213 1214 *fLog << "No colour found in: " << fRuns->GetRunsAsString() << "... abort." << endl; 1137 1215 return kFALSE; 1138 1139 TArrayI arr = fRuns->GetRuns();1140 1141 if (arr[nruns-1] < gkIFAEBoxInaugurationRun)1142 {1143 *fLog << "Found colour kCT1 in runs: " << fRuns->GetRunsAsString() << endl;1144 fColor = MCalibrationCam::kCT1;1145 return kTRUE;1146 }1147 1148 TString filenames;1149 ((MDirIter*)fRuns)->Reset();1150 1151 while (!(filenames=((MDirIter*)fRuns)->Next()).IsNull())1152 {1153 1154 filenames.ToLower();1155 1156 //1157 // Here starts the list of runs where the shifters did not put1158 // a colour, but which have been found out by other means.1159 // FIXME: This list has is only preliminary and has to move into the1160 // database!!1161 //1162 if (filenames.Contains("_30090_"))1163 if (fColor == MCalibrationCam::kNONE)1164 {1165 *fLog << "Found colour: kGREEN in " << filenames << endl;1166 fColor = MCalibrationCam::kGREEN;1167 }1168 else if (fColor != MCalibrationCam::kNONE)1169 {1170 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1171 return kFALSE;1172 }1173 1174 if (filenames.Contains("_27474_"))1175 if (fColor == MCalibrationCam::kNONE)1176 {1177 *fLog << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! "1178 << "Selected runs were: " << filenames << endl;1179 fColor = MCalibrationCam::kNONE;1180 return kFALSE;1181 }1182 else if (fColor != MCalibrationCam::kNONE)1183 {1184 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1185 return kFALSE;1186 }1187 1188 if (filenames.Contains("_26924_"))1189 if (fColor == MCalibrationCam::kNONE)1190 {1191 *fLog << "Found colour: kGREEN in " << filenames << endl;1192 fColor = MCalibrationCam::kGREEN;1193 }1194 else if (fColor != MCalibrationCam::kGREEN)1195 {1196 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1197 return kFALSE;1198 }1199 1200 1201 if (filenames.Contains("_26568_"))1202 if (fColor == MCalibrationCam::kNONE)1203 {1204 *fLog << "Found colour: kGREEN in " << filenames << endl;1205 fColor = MCalibrationCam::kGREEN;1206 }1207 else if (fColor != MCalibrationCam::kGREEN)1208 {1209 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1210 return kFALSE;1211 }1212 1213 if (filenames.Contains("_26412_"))1214 if (fColor == MCalibrationCam::kNONE)1215 {1216 *fLog << "Found colour: kGREEN in " << filenames << endl;1217 fColor = MCalibrationCam::kGREEN;1218 }1219 else if (fColor != MCalibrationCam::kGREEN)1220 {1221 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1222 return kFALSE;1223 }1224 1225 1226 if (filenames.Contains("_26409_"))1227 if (fColor == MCalibrationCam::kNONE)1228 {1229 *fLog << "Found colour: kGREEN in " << filenames << endl;1230 fColor = MCalibrationCam::kGREEN;1231 }1232 else if (fColor != MCalibrationCam::kGREEN)1233 {1234 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1235 return kFALSE;1236 }1237 1238 if (filenames.Contains("_26408_"))1239 if (fColor == MCalibrationCam::kNONE)1240 {1241 *fLog << "Found colour: kGREEN in " << filenames << endl;1242 fColor = MCalibrationCam::kGREEN;1243 }1244 else if (fColor != MCalibrationCam::kGREEN)1245 {1246 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1247 return kFALSE;1248 }1249 1250 1251 if (filenames.Contains("_26402_"))1252 if (fColor == MCalibrationCam::kNONE)1253 {1254 *fLog << "Found colour: kBLUE in " << filenames << endl;1255 fColor = MCalibrationCam::kBLUE;1256 }1257 else if (fColor != MCalibrationCam::kBLUE)1258 {1259 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1260 return kFALSE;1261 }1262 1263 if (filenames.Contains("_20661_"))1264 if (fColor == MCalibrationCam::kNONE)1265 {1266 *fLog << "Found colour: kGREEN in " << filenames << endl;1267 fColor = MCalibrationCam::kGREEN;1268 }1269 else if (fColor != MCalibrationCam::kGREEN)1270 {1271 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1272 return kFALSE;1273 }1274 1275 if (filenames.Contains("_20660_"))1276 if (fColor == MCalibrationCam::kNONE)1277 {1278 *fLog << "Found colour: kGREEN in " << filenames << endl;1279 fColor = MCalibrationCam::kGREEN;1280 }1281 else if (fColor != MCalibrationCam::kGREEN)1282 {1283 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1284 return kFALSE;1285 }1286 1287 //1288 // Here start the runs where the shifter put1289 // the colour.1290 //1291 if (filenames.Contains("green"))1292 if (fColor == MCalibrationCam::kNONE)1293 {1294 *fLog << "Found colour: kGREEN in " << filenames << endl;1295 fColor = MCalibrationCam::kGREEN;1296 }1297 else if (fColor != MCalibrationCam::kGREEN)1298 {1299 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1300 return kFALSE;1301 }1302 1303 if (filenames.Contains("blue"))1304 if (fColor == MCalibrationCam::kNONE)1305 {1306 *fLog << "Found colour: kBLUE in " << filenames << endl;1307 fColor = MCalibrationCam::kBLUE;1308 }1309 else if (fColor != MCalibrationCam::kBLUE)1310 {1311 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1312 return kFALSE;1313 }1314 1315 if (filenames.Contains("uv"))1316 if (fColor == MCalibrationCam::kNONE)1317 {1318 *fLog << "Found colour: kUV in " << filenames << endl;1319 fColor = MCalibrationCam::kUV;1320 }1321 else if (fColor != MCalibrationCam::kUV)1322 {1323 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1324 return kFALSE;1325 }1326 1327 if (filenames.Contains("ct1"))1328 if (fColor == MCalibrationCam::kNONE)1329 {1330 *fLog << "Found colour: kCT1 in " << filenames << endl;1331 fColor = MCalibrationCam::kCT1;1332 }1333 else if (fColor != MCalibrationCam::kCT1)1334 {1335 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1336 return kFALSE;1337 }1338 1339 }1340 1341 if (fColor == MCalibrationCam::kNONE)1342 {1343 *fLog << "No colour found in filenames of runs: " << fRuns->GetRunsAsString()1344 << "... abort" << endl;1345 return kFALSE;1346 }1347 1348 1349 return kTRUE;1350 1216 } 1351 1217 -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
r4648 r4682 401 401 fLoGainLast = TMath::Min(fLoGainLast, fRunHeader->GetNumSamplesLoGain()-1); 402 402 403 const Double_t wh = fWindowSizeHiGain; 404 const Double_t wl = fWindowSizeLoGain; 405 const Double_t fh = fHiGainFirst; 406 const Double_t fl = fLoGainFirst;; 407 403 408 fWindowSizeHiGain = TMath::Min(fWindowSizeHiGain, fHiGainLast-fHiGainFirst+1); 404 409 fWindowSizeLoGain = TMath::Min(fWindowSizeLoGain, fLoGainLast-fLoGainFirst+1); … … 406 411 SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast); 407 412 408 *fLog << inf << endl; 409 *fLog << "Taking " << Form("%2d", (int)fWindowSizeHiGain) << " HiGain from " << (int)fHiGainFirst << endl; 410 *fLog << "Taking " << Form("%2d", (int)fWindowSizeLoGain) << " LoGain from " << (int)fLoGainFirst << endl; 413 if (wh!=fWindowSizeHiGain || fh!=fHiGainFirst || wl!=fWindowSizeLoGain || fl!=fLoGainFirst) 414 { 415 *fLog << inf << endl; 416 *fLog << "Taking " << Form("%2d", (int)fWindowSizeHiGain) << " slices of Hi-Gain starting at slice " << (int)fHiGainFirst << endl; 417 *fLog << "Taking " << Form("%2d", (int)fWindowSizeLoGain) << " slices of Lo-Gain starting at slice " << (int)fLoGainFirst << endl; 418 } 411 419 412 420 if (fWindowSizeHiGain==0)
Note:
See TracChangeset
for help on using the changeset viewer.