Ignore:
Timestamp:
12/11/03 14:10:12 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCalibrationBlindPix.cc

    r2603 r2642  
    7878Bool_t MCalibrationBlindPix::FitCharge()
    7979{
     80
    8081  if (!fHist->FitSinglePhe())
    8182    return kFALSE;
  • trunk/MagicSoft/Mars/manalysis/MCalibrationBlindPix.h

    r2627 r2642  
    5555  Bool_t FillRChargevsTime(Float_t rq, Int_t t) { return fHist->FillBlindPixelChargevsN(rq,t); }   
    5656 
    57   Bool_t IsValid()                { return fLambda > 0. || fErrLambda > 0.; }
     57  Bool_t IsFitOK()                              { return fHist->IsFitOK(); }
    5858 
    5959  Bool_t FitCharge();
  • trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc

    r2634 r2642  
    220220    }
    221221
    222     fNumHiGainSamples =  fRunHeader->GetNumSamplesHiGain();
    223     fNumLoGainSamples =  fRunHeader->GetNumSamplesLoGain();
     222    //    fNumHiGainSamples =  fRunHeader->GetNumSamplesHiGain();
     223    //    fNumLoGainSamples =  fRunHeader->GetNumSamplesLoGain();
     224    fNumHiGainSamples =  6;
     225    fNumLoGainSamples =  6;
    224226
    225227    //
     
    281283        Float_t pedrms = ped.GetPedestalRms();
    282284       
    283         if ((float)sum < ((pedes*fNumHiGainSamples)+(30.*pedrms)) )
     285        if ((float)sum < ((pedes*fNumHiGainSamples)+(2.*fNumHiGainSamples*pedrms)) )
    284286           cosmicpix++;
    285287     }
     
    305307        MExtractedSignalPix &sig =  (*fSignals)[pixid];
    306308
    307         Float_t sum    = sig.GetExtractedSignal();
     309        Float_t sumhi  = sig.GetExtractedSignalHiGain();
     310        Float_t sumlo  = sig.GetExtractedSignalLoGain();
    308311        Bool_t  logain = sig.IsLoGainUsed();
    309312
     
    322325          case gkCalibrationBlindPixelId:
    323326
    324             if (!blindpixel.FillCharge(sum))
     327            if (!blindpixel.FillCharge(sumhi))
    325328              *fLog << warn <<
    326                 "Overflow or Underflow occurred filling Blind Pixel sum = " << sum << endl;
     329                "Overflow or Underflow occurred filling Blind Pixel sum = " << sumhi << endl;
    327330
    328331            if (!blindpixel.FillTime((int)mid))
     
    330333                "Overflow or Underflow occurred filling Blind Pixel time = " << (int)mid << endl;
    331334           
    332             if (!blindpixel.FillRChargevsTime(sum,fEvents))
     335            if (!blindpixel.FillRChargevsTime(sumhi,fEvents))
    333336              *fLog << warn <<
    334337                "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl;
    335338           
    336339          case gkCalibrationPINDiodeId:
    337             if (!pindiode.FillCharge(sum))
     340            if (!pindiode.FillCharge(sumhi))
    338341              *fLog << warn <<
    339                 "Overflow or Underflow occurred filling HCharge: means = " << sum << endl;
     342                "Overflow or Underflow occurred filling HCharge: means = " << sumhi << endl;
    340343            if (!pindiode.FillTime((int)mid))
    341344              *fLog << warn <<
    342345                "Overflow or Underflow occurred filling HTime: time = " << (int)mid << endl;
    343             if (!pindiode.FillRChargevsTime(sum,fEvents))
     346            if (!pindiode.FillRChargevsTime(sumhi,fEvents))
    344347              *fLog << warn <<
    345348                "Overflow or Underflow occurred filling HChargevsN: eventnr = " << fEvents << endl;
    346349
    347350          default:
     351
     352            pix.SetChargesInGraph(sumhi,sumlo);
    348353
    349354            if (logain)
    350355              {
    351356               
    352                 if (!pix.FillChargeLoGain(sum))
     357                if (!pix.FillChargeLoGain(sumlo))
    353358                  *fLog << warn << "Could not fill Lo Gain Charge of pixel: " << pixid
    354                         << " signal = " << sum << endl;
     359                        << " signal = " << sumlo << endl;
    355360
    356361                if (!pix.FillTimeLoGain((int)mid))
     
    361366                // Fill the reduced charge into the control histo for better visibility
    362367                //
    363                 if (!pix.FillRChargevsTimeLoGain(sum,fEvents))
     368                if (!pix.FillRChargevsTimeLoGain(sumlo,fEvents))
    364369                  *fLog << warn << "Could not fill Lo Gain Charge vs. EvtNr of pixel: "
    365                         << pixid << " signal = " << sum  << " event Nr: " << fEvents << endl;
     370                        << pixid << " signal = " << sumlo  << " event Nr: " << fEvents << endl;
    366371               
    367372              }
    368373            else
    369374              {
    370                 if (!pix.FillChargeHiGain(sum))
     375                if (!pix.FillChargeHiGain(sumhi))
    371376                  *fLog << warn << "Could not fill Hi Gain Charge of pixel: " << pixid
    372                         << " signal = " << sum << endl;
     377                        << " signal = " << sumhi << endl;
    373378               
    374379                if (!pix.FillTimeHiGain((int)mid))
     
    376381                        << pixid << " time = " << (int)mid << endl;
    377382               
    378                 if (!pix.FillRChargevsTimeHiGain(sum,fEvents))
     383                if (!pix.FillRChargevsTimeHiGain(sumhi,fEvents))
    379384                  *fLog << warn << "Could not fill Hi Gain Charge vs. EvtNr of pixel: "
    380                         << pixid << " signal = " << sum  << " event Nr: " << fEvents << endl;
     385                        << pixid << " signal = " << sumhi  << " event Nr: " << fEvents << endl;
    381386              }
    382387           
  • trunk/MagicSoft/Mars/manalysis/MCalibrationCam.cc

    r2631 r2642  
    1313! * in supporting documentation. It is provided "as is" without express
    1414! * or implied warranty.
     15
    1516! *
    1617!
     
    372373          *fLog << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms()
    373374                << " Reduced Charge: " << pix->GetCharge() << " +- "
    374                 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigma() << endl;
     375                << pix->GetSigmaCharge() << " Reduced Sigma: " << TMath::Sqrt(pix->GetRSigmaSquare()) << endl;
    375376          id++;
    376377        }
     
    392393          *fLog << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms()
    393394                << " Reduced Charge: " << pix->GetCharge() << " +- "
    394                 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigma() << endl;
     395                << pix->GetSigmaCharge() << " Reduced Sigma: " << TMath::Sqrt(pix->GetRSigmaSquare()) << endl;
    395396          id++;
    396397        }
     
    437438      break;
    438439    case 10:
    439       val = (*this)[idx].GetRSigma();
     440      val = TMath::Sqrt((*this)[idx].GetRSigmaSquare());
    440441      break;
    441442    case 15:
    442       val = (*this)[idx].GetSigmaCharge()/(*this)[idx].GetCharge();
     443      val = ((*this)[idx].GetSigmaCharge()/(*this)[idx].GetCharge())*
     444            ((*this)[idx].GetSigmaCharge()/(*this)[idx].GetCharge());
    443445      break;
    444446    case 11:
     
    482484Bool_t MCalibrationCam::CalcNrPhotInnerPixel()
    483485{
    484   if (!fBlindPixel->IsValid())
     486  if (!fBlindPixel->IsFitOK())
    485487    return kFALSE;
    486488 
     
    561563  return kTRUE;
    562564}
     565
     566
     567Bool_t MCalibrationCam::GetConversionFactorPINDiode(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma)
     568{
     569
     570  return kTRUE;
     571
     572}
     573
     574Bool_t MCalibrationCam::GetConversionFactorCombined(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma)
     575{
     576
     577  return kTRUE;
     578
     579}
  • trunk/MagicSoft/Mars/manalysis/MCalibrationCam.h

    r2627 r2642  
    9191  Bool_t GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
    9292  Bool_t GetConversionFactorBlindPixel(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
     93  Bool_t GetConversionFactorPINDiode(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
     94  Bool_t GetConversionFactorCombined(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
    9395 
    9496  ClassDef(MCalibrationCam, 1)  // Storage Container for all calibration information of the camera
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc

    r2634 r2642  
    5050      fSigmaCharge(-1.),
    5151      fErrSigmaCharge(-1.),
    52       fRSigma(-1.),
     52      fRSigmaSquare(-1.),
    5353      fChargeProb(-1.),
    5454      fPed(-1.),
     
    6161      fConversionFFactorMethod(-1.),
    6262      fHiGainSaturation(kFALSE),
    63       fLoGainPedRms(4.)
     63      fElectronicPedRms(3.67)
    6464{
    6565
     
    140140
    141141      if (fHiGainSaturation)
    142         fRSigma = (fSigmaCharge*fSigmaCharge) - (fLoGainPedRms*fLoGainPedRms);
     142        {
     143
     144          Float_t logainrms = fElectronicPedRms + (TMath::Sqrt(fPedRms*fPedRms - fElectronicPedRms*fElectronicPedRms));
     145          if (logainrms > 0.)
     146            fRSigmaSquare = (fSigmaCharge*fSigmaCharge) - (logainrms*logainrms);
     147          else
     148            fRSigmaSquare =  fSigmaCharge*fSigmaCharge;
     149
     150        }
    143151      else
    144         fRSigma = (fSigmaCharge*fSigmaCharge) - (fPedRms*fPedRms);
    145 
    146     if (fRSigma > 0. )
     152        fRSigmaSquare = (fSigmaCharge*fSigmaCharge) - (fPedRms*fPedRms);
     153
     154    if (fRSigmaSquare > 0. )
    147155      {
    148        fPheFFactorMethod =  fFactor * fCharge*fCharge / fRSigma;
    149        fConversionFFactorMethod = fPheFFactorMethod /   fCharge ;
     156       fPheFFactorMethod         =  fFactor * fCharge*fCharge / fRSigmaSquare;
     157       fConversionFFactorMethod  = fPheFFactorMethod /   fCharge ;
    150158      }
    151159    else
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h

    r2631 r2642  
    1818  Float_t fSigmaCharge;         // The sigma of the mean charge after the fit
    1919  Float_t fErrSigmaCharge;      // The error of the sigma of the mean charge after the fit
    20   Float_t fRSigma;              // The reduced squares of sigmas after the fit
     20  Float_t fRSigmaSquare;        // The reduced squares of sigmas after the fit
    2121  Float_t fChargeProb;          // The probability of the fit function
    2222
     
    3434  Bool_t fHiGainSaturation;     // Is Lo-Gain used at all?
    3535
    36   Float_t fLoGainPedRms;
     36  Float_t fElectronicPedRms;
    3737
    3838  MHCalibrationPixel *fHist;    //! Pointer to the histograms performing the fits, etc. 
     
    4646
    4747  Float_t GetCharge()         const    { return fCharge;         }
    48   Float_t GetRSigma()         const    { return fRSigma;         }
     48  Float_t GetRSigmaSquare()   const    { return fRSigmaSquare;   }
    4949   
    5050  Float_t GetErrCharge()      const    { return fErrCharge;      }
     
    6262  void SetPedestal(Float_t ped, Float_t pedrms);
    6363  void SetHiGainSaturation()                 { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); }
     64
     65  void   SetChargesInGraph(Float_t qhi,Float_t qlo) { fHist->SetPointInGraph(qhi,qlo); }
    6466
    6567  Bool_t FillChargeHiGain(Float_t q)   { return fHist->FillChargeHiGain(q); }
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc

    r2640 r2642  
    246246
    247247
    248     fSignals->SetNumUsedFADCSlices(fNumHiGainSamples);
     248    fSignals->SetNumUsedFADCSlices(fNumHiGainSamples,fNumLoGainSamples);
    249249    fSignals->SetReadyToSave();
    250250
  • trunk/MagicSoft/Mars/manalysis/MExtractedSignalCam.h

    r2640 r2642  
    3232    Byte_t GetNumUsedHiGainFADCSlices()    { return fNumUsedHiGainFADCSlices; }
    3333    Byte_t GetNumUsedLoGainFADCSlices()    { return fNumUsedLoGainFADCSlices; }
    34     SetNumUsedHiGainFADCSlices(Byte_t numh, Byte_t numl)   
     34    void   SetNumUsedHiGainFADCSlices(Byte_t numh, Byte_t numl)   
    3535                                           {
    3636                                             fNumUsedHiGainFADCSlices = numh;
Note: See TracChangeset for help on using the changeset viewer.