Ignore:
Timestamp:
02/10/04 22:45:23 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc

    r3075 r3084  
    4343//               Optionally exclude pixels from calibration               
    4444//
    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,
    4846//               MHCalibrationPixel which itself hold histograms of type:
    4947//               HCharge(npix) (distribution of summed FADC time slice
     
    144142 
    145143    SETBIT(fFlags, kUseBlindPixelFit);
    146     SETBIT(fFlags, kUseCosmicsRejection);
    147144    SETBIT(fFlags, kUseQualityChecks);
    148145    SETBIT(fFlags, kHiLoGainCalibration);
     
    156153
    157154    fEvents            = 0;
    158     fCosmics           = 0;
    159155
    160156    fNumHiGainSamples  = 0;
     
    391387  MRawEvtPixelIter pixel(fRawEvt);
    392388 
    393   //
    394   // Perform cosmics cut
    395   //
    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 cosmicpixs
    405       // The cut will be applied in the fit, but for the blind pixel,
    406       // we need to remove this event
    407       //
    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 cosmics
    423           // if its sum of FADC slices is lower than 3 pedestal RMS
    424           //
    425           if (sumhi < 3.*pedrms ) 
    426             cosmicpix++;
    427         }
    428      
    429       //
    430       // If the camera contains more than 230
    431       // (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 events
    434       // 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  
    445389  fEvents++;
    446390
    447   //  Float_t referencetime = 0.;
    448  
    449391  //
    450392  // Create a (second) loop to do fill the calibration histograms
     
    624566    {
    625567      *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;
    628569      return kFALSE;
    629570    }
    630571 
    631   if (fEvents < fCosmics)
    632     *fLog << warn << GetDescriptor()
    633           << ": WARNING: Run contains more cosmics or pedestals than calibration events " << endl;
    634 
    635 
    636572  *fLog << inf << GetDescriptor() << ": Cut Histogram Edges" << endl;
    637573
     
    784720  fCalibrations->SetReadyToSave();
    785721 
    786   if (GetNumExecutions()==0)
    787     return kTRUE;
    788  
    789   *fLog << inf << endl;
    790   *fLog << dec << setfill(' ') << fCosmics << " Events presumably cosmics" << endl;
    791 
    792722  return kTRUE;
    793723}
     724
    794725
    795726Bool_t MCalibrationCalc::CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal, const Float_t ped) const
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h

    r3056 r3084  
    5454
    5555  Int_t fEvents;                           // Number of events 
    56   Int_t fCosmics;                          // Number of events due to supposed cosmics
    5756 
    5857  Byte_t fNumHiGainSamples;
     
    6766
    6867  enum  { kUseBlindPixelFit, kUsePinDiodeFit,
    69           kUseCosmicsRejection, kUseQualityChecks,
     68          kUseQualityChecks,
    7069          kHiLoGainCalibration,
    7170          kHiGainOverFlow, kLoGainOverFlow  };
     
    9695  void SkipPinDiodeFit(Bool_t b=kTRUE)
    9796      {b ? CLRBIT(fFlags, kUsePinDiodeFit) : SETBIT(fFlags, kUsePinDiodeFit);}
    98   void SkipCosmicsRejection(Bool_t b=kTRUE)
    99       {b ? CLRBIT(fFlags, kUseCosmicsRejection) : SETBIT(fFlags, kUseCosmicsRejection);}
    10097  void SkipQualityChecks(Bool_t b=kTRUE)
    10198      {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
Note: See TracChangeset for help on using the changeset viewer.