Changeset 3084 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 02/10/04 22:45:23 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
r3075 r3084 43 43 // Optionally exclude pixels from calibration 44 44 // 45 // Process: Optionally, a cut on cosmics can be performed 46 // 47 // Every MCalibrationPix holds a histogram class, 45 // Process: Every MCalibrationPix holds a histogram class, 48 46 // MHCalibrationPixel which itself hold histograms of type: 49 47 // HCharge(npix) (distribution of summed FADC time slice … … 144 142 145 143 SETBIT(fFlags, kUseBlindPixelFit); 146 SETBIT(fFlags, kUseCosmicsRejection);147 144 SETBIT(fFlags, kUseQualityChecks); 148 145 SETBIT(fFlags, kHiLoGainCalibration); … … 156 153 157 154 fEvents = 0; 158 fCosmics = 0;159 155 160 156 fNumHiGainSamples = 0; … … 391 387 MRawEvtPixelIter pixel(fRawEvt); 392 388 393 //394 // Perform cosmics cut395 //396 if (TESTBIT(fFlags,kUseCosmicsRejection))397 {398 399 Int_t cosmicpix = 0;400 401 //402 // Create a first loop to sort out the cosmics ...403 //404 // This is a very primitive check for the number of cosmicpixs405 // The cut will be applied in the fit, but for the blind pixel,406 // we need to remove this event407 //408 // FIXME: In the future need a much more sophisticated one!!!409 //410 411 while (pixel.Next())412 {413 414 const UInt_t pixid = pixel.GetPixelId();415 416 MExtractedSignalPix &sig = (*fSignals)[pixid];417 MPedestalPix &ped = (*fPedestals)[pixid];418 Float_t pedrms = ped.GetPedestalRms()*fSqrtHiGainSamples;419 Float_t sumhi = sig.GetExtractedSignalHiGain();420 421 //422 // We consider a pixel as presumably due to cosmics423 // if its sum of FADC slices is lower than 3 pedestal RMS424 //425 if (sumhi < 3.*pedrms )426 cosmicpix++;427 }428 429 //430 // If the camera contains more than 230431 // (this is the number of outer pixels plus about 50 inner ones)432 // presumed pixels due to cosmics, then the event is discarted.433 // This procedure is more or less equivalent to keeping only events434 // with at least 350 pixels with high signals.435 //436 if (cosmicpix > 230.)437 {438 fCosmics++;439 return kCONTINUE;440 }441 442 pixel.Reset();443 }444 445 389 fEvents++; 446 390 447 // Float_t referencetime = 0.;448 449 391 // 450 392 // Create a (second) loop to do fill the calibration histograms … … 624 566 { 625 567 *fLog << err << GetDescriptor() 626 << ": This run contains only cosmics or pedestals, " 627 << "cannot find events with more than 350 illuminated pixels. " << endl; 568 << ": This run contains no calibration data! " << endl; 628 569 return kFALSE; 629 570 } 630 571 631 if (fEvents < fCosmics)632 *fLog << warn << GetDescriptor()633 << ": WARNING: Run contains more cosmics or pedestals than calibration events " << endl;634 635 636 572 *fLog << inf << GetDescriptor() << ": Cut Histogram Edges" << endl; 637 573 … … 784 720 fCalibrations->SetReadyToSave(); 785 721 786 if (GetNumExecutions()==0)787 return kTRUE;788 789 *fLog << inf << endl;790 *fLog << dec << setfill(' ') << fCosmics << " Events presumably cosmics" << endl;791 792 722 return kTRUE; 793 723 } 724 794 725 795 726 Bool_t MCalibrationCalc::CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal, const Float_t ped) const -
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h
r3056 r3084 54 54 55 55 Int_t fEvents; // Number of events 56 Int_t fCosmics; // Number of events due to supposed cosmics57 56 58 57 Byte_t fNumHiGainSamples; … … 67 66 68 67 enum { kUseBlindPixelFit, kUsePinDiodeFit, 69 kUse CosmicsRejection, kUseQualityChecks,68 kUseQualityChecks, 70 69 kHiLoGainCalibration, 71 70 kHiGainOverFlow, kLoGainOverFlow }; … … 96 95 void SkipPinDiodeFit(Bool_t b=kTRUE) 97 96 {b ? CLRBIT(fFlags, kUsePinDiodeFit) : SETBIT(fFlags, kUsePinDiodeFit);} 98 void SkipCosmicsRejection(Bool_t b=kTRUE)99 {b ? CLRBIT(fFlags, kUseCosmicsRejection) : SETBIT(fFlags, kUseCosmicsRejection);}100 97 void SkipQualityChecks(Bool_t b=kTRUE) 101 98 {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
Note:
See TracChangeset
for help on using the changeset viewer.