Changeset 6685
- Timestamp:
- 02/28/05 17:54:50 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r6683 r6685 149 149 const Axis_t MHCalibrationPulseTimeCam::fgHiGainLast = 19.5; 150 150 const Float_t MHCalibrationPulseTimeCam::fgProbLimit = 0.0001; 151 const Float_t MHCalibrationPulseTimeCam::fgLowerSignalLimit = 100.;151 const Int_t MHCalibrationPulseTimeCam::fgLowerSignalLimit = 100; 152 152 const TString MHCalibrationPulseTimeCam::gsHistName = "PulseTime"; 153 153 const TString MHCalibrationPulseTimeCam::gsHistTitle = "Extracted Times"; … … 348 348 continue; 349 349 350 const Float_t sighi = pix.GetExtractedSignalHiGain(); 351 352 if (sighi < fLowerSignalLimit) 350 Byte_t *start = pixel.GetHiGainSamples(); 351 Byte_t *end = start + pixel.GetNumHiGainSamples(); 352 Byte_t *p = start; 353 Byte_t max = 0; 354 Int_t maxpos = 0; 355 356 while (p < end) 357 { 358 if (*p++ > max) 359 maxpos = p-start-1; 360 } 361 362 start = pixel.GetLoGainSamples(); 363 end = start + pixel.GetNumLoGainSamples(); 364 p = start; 365 366 while (p < end) 367 { 368 if (*p++ > max) 369 maxpos = p-start+pixel.GetNumHiGainSamples() - 1; 370 } 371 372 if ((Int_t)max < fLowerSignalLimit) 353 373 continue; 354 374 355 const Byte_t slicehi = pixel.GetMaxHiGainSample(); 356 const Byte_t slicelo = pixel.GetMaxLoGainSample(); 357 358 Float_t time = 0.; 359 360 if (slicehi > slicelo) 361 time = (Float_t)pixel.GetIdxMaxHiGainSample(); 362 else 363 time = (Float_t)pixel.GetIdxMaxLoGainSample(); 364 375 const Float_t time = (Float_t)maxpos; 365 376 histhi.FillHist(time); 366 377 … … 423 434 *fLog << endl; 424 435 425 MCalibrationCam *pulsecam = fIntensCam ? fIntensCam->GetCam() : fCam; 426 MBadPixelsCam *badcam = fIntensBad ? fIntensBad->GetCam() : fBadPixels; 427 436 MCalibrationCam *calcam = fIntensCam ? fIntensCam->GetCam() : fCam; 428 437 // 429 438 // Perform the fitting for the High Gain (done in MHCalibrationCam) 430 439 // 431 FitHiGainArrays(*pulsecam, *badcam, 432 MBadPixelsPix::kHiGainNotFitted, 433 MBadPixelsPix::kHiGainOscillating); 440 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 441 { 442 443 MHCalibrationPix &hist = (*this)[i]; 444 445 if (hist.IsExcluded()) 446 continue; 447 448 MCalibrationPix &pix = (*calcam)[i]; 449 CalcHists(hist,pix); 450 } 451 452 if (!IsAverageing()) 453 return kTRUE; 454 455 for (Int_t j=0; j<fAverageHiGainAreas->GetSize(); j++) 456 { 457 458 MHCalibrationPix &hist = GetAverageHiGainArea(j); 459 MCalibrationPix &pix = calcam->GetAverageArea(j); 460 CalcHists(hist,pix); 461 } 462 463 for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++) 464 { 465 MHCalibrationPix &hist = GetAverageHiGainSector(j); 466 MCalibrationPix &pix = calcam->GetAverageSector(j); 467 CalcHists(hist,pix); 468 } 434 469 435 470 return kTRUE; 436 471 } 472 473 void MHCalibrationPulseTimeCam::CalcHists(MHCalibrationPix &hist, MCalibrationPix &pix) 474 { 475 476 477 if (hist.IsEmpty() || hist.IsOnlyOverflow() || hist.IsOnlyUnderflow()) 478 { 479 *fLog << warn << GetDescriptor() 480 << ": Only overflow or underflow in hi-gain pixel: " << pix.GetPixId() << endl; 481 return; 482 } 483 484 hist.BypassFit(); 485 486 pix.SetHiGainMean ( hist.GetMean() ); 487 pix.SetHiGainMeanVar ( hist.GetMeanErr() * hist.GetMeanErr() ); 488 pix.SetHiGainRms ( hist.GetHistRms() ); 489 pix.SetHiGainSigma ( hist.GetSigma() ); 490 pix.SetHiGainSigmaVar ( hist.GetSigmaErr()* hist.GetSigmaErr() ); 491 492 if (IsDebug()) 493 { 494 *fLog << dbginf << GetDescriptor() << ": ID " << GetName() 495 << " Mean: " << hist.GetMean () 496 << " MeanErr: " << hist.GetMeanErr () 497 << " MeanSigma: " << hist.GetSigma () 498 << " MeanSigmaErr: " << hist.GetSigmaErr() 499 << " Prob: " << hist.GetProb () 500 << endl; 501 } 502 return; 503 } 504 437 505 438 506 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.h
r6597 r6685 21 21 private: 22 22 23 static const Float_tfgLowerSignalLimit; //! Default for fLowerSignalLimit23 static const Int_t fgLowerSignalLimit; //! Default for fLowerSignalLimit 24 24 25 25 static const Int_t fgHiGainNbins; //! Nr. bins of HiGain Histograms (now set to: 550 ) … … 35 35 static const TString gsHistYTitle; //! Default Histogram y-axis titles 36 36 37 Float_tfLowerSignalLimit; // Lower signal limit for pulse time extraction37 Int_t fLowerSignalLimit; // Lower signal limit for pulse time extraction 38 38 39 39 TString fReferenceFile; // File name containing the reference values … … 55 55 void DrawDataCheckPixel(MHCalibrationPix &pix, const Float_t refline); 56 56 void DisplayRefLines ( const TH1F *hist, const Float_t refline) const; 57 void CalcHists (MHCalibrationPix &hist, MCalibrationPix &pix); 57 58 58 59 Int_t ReadEnv ( const TEnv &env, TString prefix, Bool_t print); … … 70 71 71 72 void SetReferenceFile ( const TString ref=fgReferenceFile ) { fReferenceFile = ref; } 72 void SetLowerSignalLimit( const Float_tlim=fgLowerSignalLimit ) { fLowerSignalLimit = lim; }73 void SetLowerSignalLimit( const Int_t lim=fgLowerSignalLimit ) { fLowerSignalLimit = lim; } 73 74 74 75 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }
Note:
See TracChangeset
for help on using the changeset viewer.