Changeset 3679


Ignore:
Timestamp:
04/08/04 18:07:14 (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/MCalibrationChargeCalc.cc

    r3678 r3679  
    571571  if (cal.GetMeanErr() < fChargeErrLimit)
    572572    {
    573       *fLog << warn << GetDesriptor() << ": Sigma of Fitted Charge: " << cal.GetMeanErr() << " is smaller than "
    574             << fChargeErrLimit << " in Pixel  " << cal.GetPixId() << endl;
     573      *fLog << warn << GetDescriptor() << ": Sigma of Fitted Charge: " << cal.GetMeanErr()
     574            << " is smaller than " << fChargeErrLimit << " in Pixel  " << cal.GetPixId() << endl;
    575575      bad.SetUncalibrated( MBadPixelsPix::kChargeErrNotValid );
    576576    }
     
    578578   if (cal.GetMean() < fChargeRelErrLimit*cal.GetMeanErr())
    579579    {
    580       *fLog << warn << GetDesriptor() << ": Fitted Charge: " << cal.GetMean() << " is smaller than "
     580      *fLog << warn << GetDescriptor() << ": Fitted Charge: " << cal.GetMean() << " is smaller than "
    581581            << fChargeRelErrLimit << "* its error: " << cal.GetMeanErr()
    582582            << " in Pixel  " << cal.GetPixId() << endl;
     
    586586  if (cal.GetSigma() < cal.GetPedRms())
    587587    {
    588       *fLog << warn << GetDesriptor() << ": Sigma of Fitted Charge: " << cal.GetSigma()
     588      *fLog << warn << GetDescriptor() << ": Sigma of Fitted Charge: " << cal.GetSigma()
    589589            << " smaller than Pedestal RMS: " << cal.GetPedRms() << " in Pixel  " << cal.GetPixId() << endl;
    590590      bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
     
    607607  if ( cal.GetAbsTimeMean() < lowerlimit)
    608608    {
    609       *fLog << warn << GetDesriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit
     609      *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit
    610610            << " extraction bin of the Pixel " << cal.GetPixId() << endl;
    611611      *fLog << cal.GetAbsTimeMean() << "   " << lowerlimit << endl;
     
    615615  if ( cal.GetAbsTimeMean() > upperlimit )
    616616    {
    617       *fLog << warn << GetDesriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit
     617      *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit
    618618            << " two extraction bins of the Pixel " << cal.GetPixId() << endl;
    619619      *fLog << cal.GetAbsTimeMean() << "   " << upperlimit << endl;
     
    670670  if (fPINDiode->GetMean() < fChargeLimit*fPINDiode->GetPedRms())
    671671    {
    672       *fLog << warn << GetDesriptor() << ": Fitted Charge is smaller than "
     672      *fLog << warn << GetDescriptor() << ": Fitted Charge is smaller than "
    673673            << fChargeLimit << " Pedestal RMS in PINDiode " << endl;
    674674      return kFALSE;
     
    677677  if (fPINDiode->GetMeanErr() < fChargeErrLimit)
    678678    {
    679       *fLog << warn << GetDesriptor() << ": Error of Fitted Charge is smaller than "
     679      *fLog << warn << GetDescriptor() << ": Error of Fitted Charge is smaller than "
    680680            << fChargeErrLimit << " in PINDiode " << endl;
    681681      return kFALSE;
     
    684684  if (fPINDiode->GetMean() < fChargeRelErrLimit*fPINDiode->GetMeanErr())
    685685    {
    686       *fLog << warn << GetDesriptor() << ": Fitted Charge is smaller than "
     686      *fLog << warn << GetDescriptor() << ": Fitted Charge is smaller than "
    687687            << fChargeRelErrLimit << "* its error in PINDiode " << endl;
    688688      return kFALSE;
     
    691691  if (fPINDiode->GetSigma() < fPINDiode->GetPedRms())
    692692    {
    693       *fLog << warn << GetDesriptor() << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl;
     693      *fLog << warn << GetDescriptor() << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl;
    694694      return kFALSE;
    695695    }
     
    702702  if (fPINDiode->GetAbsTimeMean() < lowerlimit)
    703703    {
    704       *fLog << warn << GetDesriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit
     704      *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit
    705705            << " extraction bin in PIN Diode " << endl;
    706706      *fLog << fPINDiode->GetAbsTimeMean() << "   " << lowerlimit << endl;
     
    710710  if ( fPINDiode->GetAbsTimeMean() > upperlimit )
    711711    {
    712       *fLog << warn << GetDesriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit
     712      *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit
    713713            << " two extraction bins in PIN Diode " << endl;
    714714      *fLog << fPINDiode->GetAbsTimeMean() << "   " << upperlimit << endl;
     
    754754  if (2.*(lambdacheck-lambda)/(lambdacheck+lambda) < fLambdaCheckLimit)
    755755    {
    756       *fLog << warn << GetDesriptor() << ": Lambda and Lambda-Check differ by more than "
     756      *fLog << warn << GetDescriptor() << ": Lambda and Lambda-Check differ by more than "
    757757            << fLambdaCheckLimit << " in the Blind Pixel " << endl;
    758758      return kFALSE;
     
    761761  if (lambdaerr < fLambdaErrLimit)
    762762    {
    763       *fLog << warn << GetDesriptor() << ": Error of Fitted Lambda is greater than "
     763      *fLog << warn << GetDescriptor() << ": Error of Fitted Lambda is greater than "
    764764            << fLambdaErrLimit << " in Blind Pixel " << endl;
    765765      return kFALSE;
     
    952952    }
    953953
    954   MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCam->GetAverageArea(0);
    955   MCalibrationQEPix     &qepix = (MCalibrationQEPix&)  fQECam->GetAverageArea(0); 
    956 
    957   const Float_t avphotonflux = avpix.GetPheFFactorMethod()       
    958                              / qepix.GetQEFFactor(fPulserColor)
    959                              / fQECam->GetPlexiglassQE();
    960 
    961   const Float_t avfluxrelvar = avpix.GetPheFFactorMethodRelVar()
    962                              + qepix.GetQEFFactorRelVar(fPulserColor)
    963                              + fQECam->GetPlexiglassQERelVar();
    964   //
    965   // Third loop: With the knowledge of the overall photon flux, calculate the total
    966   //             F-Factor of the whole readout per pixel and set the quantum efficiencies
    967   //             after the F-Factor method.
    968   //
    969   for (UInt_t i=0; i<npixels; i++)
    970     {
    971      
    972       MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i];
    973       MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
    974 
    975       if (!pix.IsFFactorMethodValid())
    976         {
    977           qepix.SetFFactorMethodValid(kFALSE,fPulserColor);
    978           continue;
    979         }
    980      
    981       const Float_t photons    = avphotonflux / fGeom->GetPixRatio(i);
    982       const Float_t conv       = photons      / pix.GetPheFFactorMethod();
    983 
    984       if (!pix.CalcMeanFFactor( photons , avfluxrelvar ))
    985         {
    986           pix.SetFFactorMethodValid(kFALSE);
    987           qepix.SetFFactorMethodValid(kFALSE, fPulserColor);
    988           (*fBadPixels)[i].SetUncalibrated( MBadPixelsPix::kDeviatingNumPhes );
    989         }
    990 
    991       const Float_t convrelvar = avfluxrelvar +  pix.GetPheFFactorMethodRelVar();
    992 
    993       qepix.SetQEFFactor    ( conv                    , fPulserColor );
    994       qepix.SetQEFFactorVar ( convrelvar * conv * conv, fPulserColor );     
    995     }
    996  
    997 
    998954  return kTRUE;
    999955}
     956
    1000957
    1001958// ----------------------------------------------------------------------
     
    10461003//
    10471004//
     1005void MCalibrationChargeCalc::FinalizeFFactorQECam()
     1006{
     1007
     1008  MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCam->GetAverageArea(0);
     1009  MCalibrationQEPix     &qepix = (MCalibrationQEPix&)  fQECam->GetAverageArea(0); 
     1010
     1011  const Float_t avphotonflux = avpix.GetPheFFactorMethod()       
     1012                             / qepix.GetQEFFactor(fPulserColor)
     1013                             / fQECam->GetPlexiglassQE();
     1014
     1015  const Float_t avfluxrelvar = avpix.GetPheFFactorMethodRelVar()
     1016                             + qepix.GetQEFFactorRelVar(fPulserColor)
     1017                             + fQECam->GetPlexiglassQERelVar();
     1018
     1019  const UInt_t npixels  = fGeom->GetNumPixels();
     1020
     1021  for (UInt_t i=0; i<npixels; i++)
     1022    {
     1023     
     1024      MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i];
     1025      MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
     1026
     1027      if (!pix.IsFFactorMethodValid())
     1028        {
     1029          qepix.SetFFactorMethodValid(kFALSE,fPulserColor);
     1030          continue;
     1031        }
     1032     
     1033      const Float_t photons    = avphotonflux / fGeom->GetPixRatio(i);
     1034      const Float_t conv       = photons      / pix.GetPheFFactorMethod();
     1035
     1036      if (!pix.CalcMeanFFactor( photons , avfluxrelvar ))
     1037        {
     1038          pix.SetFFactorMethodValid(kFALSE);
     1039          qepix.SetFFactorMethodValid(kFALSE, fPulserColor);
     1040          (*fBadPixels)[i].SetUncalibrated( MBadPixelsPix::kDeviatingNumPhes );
     1041        }
     1042
     1043      const Float_t convrelvar = avfluxrelvar +  pix.GetPheFFactorMethodRelVar();
     1044
     1045      qepix.SetQEFFactor    ( conv                    , fPulserColor );
     1046      qepix.SetQEFFactorVar ( convrelvar * conv * conv, fPulserColor );     
     1047      qepix.UpdateFFactorMethod();
     1048    }
     1049}
     1050
     1051// ------------------------------------------------------------------------
     1052//
     1053//
    10481054void MCalibrationChargeCalc::FinalizeBlindPixelQECam()
    10491055{
     
    10941100      qepix.SetQEBlindPixel    ( conv                    , fPulserColor );
    10951101      qepix.SetQEBlindPixelVar ( convrelvar * conv * conv, fPulserColor );     
     1102      qepix.UpdateBlindPixelMethod();
    10961103    }
    10971104}
     
    11421149      qepix.SetQEPINDiode    ( conv                    , fPulserColor );
    11431150      qepix.SetQEPINDiodeVar ( convrelvar * conv * conv, fPulserColor );     
     1151      qepix.UpdateBlindPixelMethod();
    11441152    }
    11451153}
     
    12651273  // Finalize QE Cam
    12661274  //
     1275  FinalizeFFactorQECam();
    12671276  FinalizeBlindPixelQECam();
    12681277  FinalizePINDiodeQECam();
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r3678 r3679  
    102102  Bool_t FinalizeBlindPixel();
    103103  Bool_t FinalizeFFactorMethod();
    104   void   FinalizeBadPixels(); 
     104  void   FinalizeBadPixels();
     105  void   FinalizeFFactorQECam(); 
    105106  void   FinalizeBlindPixelQECam();
    106107  void   FinalizePINDiodeQECam();
Note: See TracChangeset for help on using the changeset viewer.