Changeset 7288 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 08/17/05 17:36:32 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc
r7190 r7288 93 93 fIntensBad(NULL), 94 94 fChargeCalc(NULL), fRelTimeCalc(NULL), fCalibrate(NULL), 95 fNumCam(0), fNumEvents(0), fUpdateWithFFactorMethod(kTRUE), fUpdateNumPhes(kTRUE) 95 fNumCam(0), fNumEvents(0), fUpdateWithFFactorMethod(kTRUE), fUpdateNumPhes(kTRUE), 96 fNumFails(0) 96 97 { 97 98 … … 252 253 } 253 254 255 fNumFails = 0; 256 254 257 return kTRUE; 258 } 259 260 // -------------------------------------------------------------------------- 261 // 262 // Set fNumEvents=0 263 // 264 // This is necessary because the calibration histograms do reset themself 265 // if ReInit is called, so they are empty. MCalibCalcFromPast errornously 266 // ignores how many events are in the histograms but count the number 267 // itself. 268 // 269 Bool_t MCalibCalcFromPast::ReInit(MParList *pList) 270 { 271 if (fNumEvents>0) 272 *fLog << inf << fNumEvents << " calibration events at the end of the last file have been skipped." << endl; 273 274 fNumEvents = 0; 275 276 return kTRUE; 255 277 } 256 278 … … 288 310 if (fChargeCalc) 289 311 { 290 if (!fChargeCalc->Finalize()) 291 return kERROR; 292 293 if (fUpdateNumPhes) 312 if (!fChargeCalc->Finalize()) 313 { 314 fNumFails++; 315 *fLog << warn << "WARNING - Finalization of charges failed the " << fNumFails << " time..." << endl; 316 } 317 318 if (fUpdateNumPhes) 294 319 { 295 320 MCalibrationChargePix &avpix =(MCalibrationChargePix&)fIntensCharge->GetCam()->GetAverageArea(0); … … 336 361 // - MHCalibrationCam::ResetHists() 337 362 // 338 Bool_t MCalibCalcFromPast::Finalize(const char* name) 339 { 340 341 MHCalibrationCam *hist = (MHCalibrationCam*)fParList->FindObject(name); 342 if (hist) 343 { 344 hist->Finalize(); 345 hist->ResetHists(); 346 return kTRUE; 347 } 348 349 return kFALSE; 350 363 Bool_t MCalibCalcFromPast::Finalize(const char* name, Bool_t finalize) 364 { 365 MHCalibrationCam *hist = (MHCalibrationCam*)fParList->FindObject(name, "MHCalibrationCam"); 366 if (!hist) 367 return kFALSE; 368 369 if (finalize) 370 hist->Finalize(); 371 372 hist->ResetHists(); 373 return kTRUE; 351 374 } 352 375 … … 398 421 Int_t MCalibCalcFromPast::PostProcess() 399 422 { 400 *fLog << inf << "Number of Calibration Cams: " << fNumCam << endl; 401 return kTRUE; 402 423 if (GetNumExecutions()==0) 424 return kTRUE; 425 426 // Now we reset all histograms to make sure that the PostProcess 427 // of the following tasks doesn't try to finalize a partly empty 428 // histogram! 429 Finalize("MHCalibrationChargeCam", kFALSE); 430 Finalize("MHCalibrationChargeBlindCam", kFALSE); 431 Finalize("MHCalibrationRelTimeCam", kFALSE); 432 433 if (fChargeCalc) 434 fChargeCalc->ResetNumProcessed(); 435 436 if (fNumCam==0) 437 return kTRUE; 438 439 *fLog << inf << endl; 440 *fLog << GetDescriptor() << " execution statistics:" << endl; 441 *fLog << " " << setw(7) << fNumFails << " (" << Form("%5.1f", 100.*fNumFails/fNumCam) << "%) updates failed." << endl; 442 *fLog << endl; 443 444 return kTRUE; 403 445 } 404 446 … … 468 510 } 469 511 470 471 472 512 return rc; 473 513 } -
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.h
r7189 r7288 59 59 TArrayF fPhesVar; 60 60 61 Int_t fNumFails; //! How often got the update skipped? 62 61 63 // MTask 62 64 Int_t PreProcess(MParList *pList); 63 65 Int_t Process(); 64 Int_t PostProcess(); 66 Int_t PostProcess(); 67 Bool_t ReInit(MParList *pList); 65 68 66 69 // MCalibCalcFromPast 67 70 Bool_t ReInitialize(); 68 Bool_t Finalize(const char* name );71 Bool_t Finalize(const char* name, Bool_t finalize=kTRUE); 69 72 70 73 Bool_t UpdateMeanPhes(); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r7189 r7288 183 183 void Clear(const Option_t *o=""); 184 184 185 void ResetNumProcessed() { fNumProcessed=0; } 186 185 187 Int_t Finalize(); 186 188
Note:
See TracChangeset
for help on using the changeset viewer.