Changeset 2760


Ignore:
Timestamp:
01/09/04 15:02:11 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2759 r2760  
    55                                                 -*-*- END OF LINE -*-*-
    66 2004/01/09: Markus Gaug
     7
     8   * mcalib/MCalibrationCalc.cc
     9     - catch the possibility of a calibration file,
     10       unintendedly being a pedestal or cosmic file.
     11       Program now exits with an error before doing the fits
    712
    813   * mcalib/MCalibrationPix.[h,cc]
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc

    r2734 r2760  
    9292
    9393#include "MRawRunHeader.h"
    94 #include "MRawEvtData.h"       // MRawEvtData::GetNumPixels
     94#include "MRawEvtData.h"     
    9595#include "MRawEvtPixelIter.h"
    9696
     
    106106// --------------------------------------------------------------------------
    107107//
    108 // Default constructor. b is the number of slices before the maximum slice,
    109 // a the number of slices behind the maximum slice which is taken as signal.
     108// Default constructor.
    110109//
    111110MCalibrationCalc::MCalibrationCalc(const char *name, const char *title)
     
    234233    fNumHiGainSamples =  fSignals->GetNumUsedHiGainFADCSlices();
    235234    fNumLoGainSamples =  fSignals->GetNumUsedLoGainFADCSlices();
     235    fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples);
    236236
    237237    fCalibrations->InitSize(cam->GetNumPixels());   
     
    280280        MExtractedSignalPix &sig =  (*fSignals)[pixid];
    281281        MPedestalPix        &ped =  (*fPedestals)[pixid];
    282         Float_t pedrms     = ped.GetPedestalRms();
    283         Float_t sumhi      = sig.GetExtractedSignalHiGain();
     282        Float_t pedrms           = ped.GetPedestalRms()*fSqrtHiGainSamples;
     283        Float_t sumhi            = sig.GetExtractedSignalHiGain();
    284284       
    285         if (sumhi < 15.*pedrms )   // cut at 3.5 sigma
     285        //
     286        // We consider a pixel as presumably due to cosmics
     287        // if its sum of FADC slices is lower than 3 pedestal RMS
     288        //
     289        if (sumhi < 3.*pedrms ) 
    286290          cosmicpix++;
    287291     }
    288292
    289     if (cosmicpix > 100.)
     293    //
     294    // If the camera contains more than 230
     295    // (this is the number of outer pixels plus about 50 inner ones)
     296    // presumed pixels due to cosmics, then the event is discarted.
     297    // This procedure is more or less equivalent to keeping only events
     298    // with at least 350 pixels with high signals.
     299    //
     300    if (cosmicpix > 230.)
    290301      {
    291302        fCosmics++;
     
    391402
    392403  *fLog << inf << endl;
     404
     405  if (fEvents == 0)
     406    {
     407
     408      *fLog << err << GetDescriptor()
     409            << ": This run contains only cosmics or pedestals, "
     410            << "cannot find events with more than 350 illuminated pixels. " << endl;
     411      return kFALSE;
     412    }
     413 
     414  if (fEvents < fCosmics)
     415    *fLog << warn << GetDescriptor()
     416          << ": WARNING: Run contains more cosmics or pedestals than calibration events " << endl;
     417
     418
    393419  *fLog << GetDescriptor() << " Cut Histogram Edges" << endl;
    394420
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h

    r2734 r2760  
    4343  Byte_t fNumHiGainSamples;
    4444  Byte_t fNumLoGainSamples;
    45 
     45  Float_t fSqrtHiGainSamples;
     46 
    4647  Byte_t fFlags;                           // Flag for the fits used
    4748   
Note: See TracChangeset for help on using the changeset viewer.