Changeset 5860 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 01/16/05 17:37:14 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r5854 r5860 143 143 // 144 144 MCalibrateData::MCalibrateData(CalibrationMode_t calmode,const char *name, const char *title) 145 : fGeomCam(NULL), fBadPixels(NULL), fCalibrations(NULL), 145 : fGeomCam(NULL), fBadPixels(NULL), fCalibrations(NULL), fCalibUpdate(NULL), 146 146 fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL), 147 147 fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.) … … 232 232 return kFALSE; 233 233 } 234 235 SetCalibUpdate( fCalibrations ); 234 236 } 235 237 … … 433 435 Bool_t MCalibrateData::UpdateConversionFactors() 434 436 { 437 438 *fLog << inf << GetDescriptor() 439 << ": Updating Conversion Factors... " << endl; 440 435 441 // 436 442 // For the moment, we use only a dummy zenith for the calibration: … … 452 458 Float_t calibQEVar = 0.; 453 459 460 Float_t calibUpdate = 1.; 461 454 462 if(fCalibrationMode!=kNone) 455 463 { 456 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCalibrations)[pixidx];457 458 hiloconv = pix.GetConversionHiLo ();459 hiloconverr= pix.GetConversionHiLoErr();460 461 464 if ((*fBadPixels)[pixidx].IsUnsuitable()) 462 465 { … … 465 468 } 466 469 470 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCalibrations)[pixidx]; 471 MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCalibrations->GetAverageArea(0); 472 473 hiloconv = pix.GetConversionHiLo (); 474 hiloconverr= pix.GetConversionHiLoErr(); 475 467 476 calibConv = pix.GetMeanConvFADC2Phe(); 468 477 calibConvVar = pix.GetMeanConvFADC2PheVar(); … … 471 480 MCalibrationQEPix &qe = (MCalibrationQEPix&) (*fQEs)[pixidx]; 472 481 482 if (fCalibUpdate) 483 { 484 MCalibrationChargePix &upix = (MCalibrationChargePix&)(*fCalibUpdate)[pixidx]; 485 // 486 // Correct for the possible change in amplification of the individual pixels chain 487 // 488 const Float_t pixmean = upix.GetConvertedMean(); 489 calibUpdate = (pixmean == 0.) ? 1. : pix.GetConvertedMean() / pixmean; 490 // 491 // Correct for global shifts in light emission 492 // 493 MCalibrationChargePix &ugpix = (MCalibrationChargePix&)fCalibUpdate->GetAverageArea(0); 494 MBadPixelsPix &ubad = (MBadPixelsPix&) fCalibUpdate->GetAverageBadArea(0); 495 496 // if (ubad.IsUnsuitable()) 497 // *fLog << err << "Average Area is unsuitable!!!!" << endl; 498 499 const Float_t globmean = avpix.GetConvertedMean(); 500 calibUpdate = (globmean == 0.) ? 1. : ugpix.GetConvertedMean() / globmean; 501 } 502 473 503 switch(fCalibrationMode) 474 504 { 475 505 case kFlatCharge: 476 506 { 477 MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCalibrations->GetAverageArea(0);478 calibConv = avpix.GetMean() / (pix.GetMean() * fGeomCam->GetPixRatio(pixidx));507 calibConv = avpix.GetConvertedMean() 508 / (pix.GetConvertedMean() * fGeomCam->GetPixRatio(pixidx)); 479 509 calibConvVar = (avpix.GetMeanRelVar() + pix.GetMeanRelVar()) * calibConv * calibConv; 480 510 if (pix.IsFFactorMethodValid()) … … 531 561 hiloconv = 1.; 532 562 hiloconverr = 0.; 563 calibUpdate = 1.; 533 564 break; 534 565 } /* switch calibration mode */ … … 551 582 } 552 583 553 calibConv *= fRenormFactor ;584 calibConv *= fRenormFactor * calibUpdate; 554 585 555 586 fHiLoConv [pixidx] = hiloconv;
Note:
See TracChangeset
for help on using the changeset viewer.