Changeset 8147 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
10/23/06 13:27:21 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc

    r7903 r8147  
    152152    if (n!=GetSize())
    153153    {
    154         *fLog << warn << "MBadPixelsCam::Merge: Size mismatch... ignored." << endl;
     154        *fLog << warn << "MBadPixelsCam::Merge: Size mismatch (" << n << "," << GetSize() << ")... ignored." << endl;
    155155        return;
    156156    }
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc

    r8140 r8147  
    294294  *fLog << inf << GetDescriptor() << ": Finalize calibration histograms: " << flush;
    295295
     296  // This fills the IntensityCam which are newly created by
     297  // ReInitialize with the result of the last calib cycle
    296298  if (Finalize("MHCalibrationChargeCam"))      *fLog << "MHCalibrationChargeCam..." << flush;
    297299  if (Finalize("MHCalibrationChargeBlindCam")) *fLog << "MHCalibrationChargeBlindCam..." << flush;
     
    305307  if (fChargeCalc)
    306308    {
     309        // Finalized Pedestals, Charges, Bad Pixels and all QE cams
    307310        if (!fChargeCalc->Finalize())
    308311        {
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r8142 r8147  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.169 2006-10-20 18:50:35 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.170 2006-10-23 12:27:21 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    732732    // the real number might change from event to event.
    733733    // (up to 50%!)
     734
    734735  fNumHiGainSamples  =  fSignal->GetNumUsedHiGainFADCSlices();
    735736  fNumLoGainSamples  =  fSignal->GetNumUsedLoGainFADCSlices();
     
    10031004    return kFALSE;
    10041005
     1006  const TString desc = Form("%7s%4d: ", what, cal.GetPixId());
     1007
    10051008  if (cal.GetMean() < fChargeLimit*cal.GetPedRms())
    10061009    {
    1007       *fLog << warn
     1010      *fLog << warn << desc
    10081011            << Form("Fitted Charge: %5.2f < %2.1f",cal.GetMean(),fChargeLimit)
    1009             << Form(" * Pedestal RMS %5.2f in %s%3i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
     1012            << Form(" * Pedestal RMS %5.2f",cal.GetPedRms()) << endl;
    10101013      bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal);
    10111014    }
     
    10131016   if (cal.GetMean() < fChargeRelErrLimit*cal.GetMeanErr())
    10141017    {
    1015       *fLog << warn
     1018      *fLog << warn << desc
    10161019            << Form("Fitted Charge: %4.2f < %2.1f",cal.GetMean(),fChargeRelErrLimit)
    1017             << Form(" * its error %4.2f in %s%3i",cal.GetMeanErr(),what,cal.GetPixId()) << endl;
     1020            << Form(" * its error %4.2f",cal.GetMeanErr()) << endl;
    10181021      bad.SetUncalibrated( MBadPixelsPix::kChargeRelErrNotValid );
    10191022    }
     
    10211024  if (cal.GetSigma() < cal.GetPedRms())
    10221025    {
    1023       *fLog << warn << "Sigma of Fitted Charge: "
     1026      *fLog << warn << desc << "Sigma of Fitted Charge: "
    10241027            << Form("%6.2f <",cal.GetSigma()) << " Ped. RMS="
    1025             << Form("%5.2f", cal.GetPedRms()) << " in " << what
    1026             << Form("%3i",cal.GetPixId()) << endl;
     1028            << Form("%5.2f", cal.GetPedRms()) << endl;
    10271029      bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
    10281030      return kFALSE;
     
    10311033  if (!cal.CalcReducedSigma())
    10321034    {
    1033       *fLog << warn << "Could not calculate the reduced sigma in " << what
    1034             << ":                        " << Form("%4i",cal.GetPixId())
    1035             << endl;
     1035      *fLog << warn << desc << "Could not calculate the reduced sigma" << endl;
    10361036      bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
    10371037      return kFALSE;
     
    10401040  if (!cal.CalcFFactor())
    10411041    {
    1042       *fLog << warn << "Could not calculate the F-Factor in " << what
    1043             << ":                             " << Form("%4i",cal.GetPixId())
    1044             << endl;
     1042      *fLog << warn << desc << "Could not calculate the F-Factor"<< endl;
    10451043      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
    10461044      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
     
    10581056  if (!cal.CalcConvFFactor())
    10591057    {
    1060       *fLog << warn << "Could not calculate the Conv. FADC counts to Phes in ";
    1061       *fLog << what << ":           " << Form("%4i", cal.GetPixId()) << endl;
     1058      *fLog << warn << desc << "Could not calculate the Conv. FADC counts to Phes"<< endl;
    10621059      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
    10631060      return kFALSE;
     
    10691066  if (!fExtractor)
    10701067    {
    1071       *fLog << err << "Extractor resolution has been chosen, but not extractor is set. Cannot calibrate" << endl;
     1068      *fLog << err << "Extractor resolution has been chosen, but not extractor is set. Cannot calibrate." << endl;
    10721069      return kFALSE;
    10731070    }
     
    10831080  if (resinfadc > 3.0*cal.GetPedRms() )
    10841081    {
    1085       *fLog << warn << " Extractor Resolution: " << resinfadc << " bigger than 3 Pedestal RMS "
    1086             << cal.GetPedRms() << endl;
     1082      *fLog << warn << desc << "Extractor Resolution " << Form("%5.2f", resinfadc) << " bigger than 3 Pedestal RMS "
     1083            << Form("%4.2f", cal.GetPedRms()) << endl;
    10871084      resinfadc = 3.0*cal.GetPedRms();
    10881085    }
     
    10901087  if (!cal.CalcReducedSigma(resinfadc))
    10911088    {
    1092         *fLog << warn << "Could not calculate the reduced sigma in " << what;
    1093         *fLog << ":                        " << Form("%4i",cal.GetPixId()) << endl;
     1089        *fLog << warn << desc << "Could not calculate the reduced sigma" << endl;
    10941090        bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
    10951091        return kFALSE;
     
    10981094  if (!cal.CalcFFactor())
    10991095    {
    1100         *fLog << warn << "Could not calculate the F-Factor in " << what;
    1101         *fLog << ":                             " << Form("%4i",cal.GetPixId()) << endl;
     1096        *fLog << warn << desc << "Could not calculate the F-Factor" << endl;
    11021097      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
    11031098      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
     
    11151110  if (!cal.CalcConvFFactor())
    11161111    {
    1117       *fLog << warn << "Could not calculate the Conv. FADC counts to Phes in "
    1118             << what << ":           " << Form("%4i",cal.GetPixId())
    1119             << endl;
     1112      *fLog << warn << desc << "Could not calculate the Conv. FADC counts to Phes" << endl;
    11201113      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
    11211114      return kFALSE;
     
    11351128        return;
    11361129
     1130    const TString desc = Form("%7s%4d: ", what, cal.GetPixId());
     1131
    11371132    if (cal.GetAbsTimeRms() > fArrTimeRmsLimit)
    11381133    {
    11391134        *fLog << warn;
    1140         *fLog << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms());
    1141         *fLog << " FADC sl. < " << Form("%2.1f", fArrTimeRmsLimit);
    1142         *fLog << "   in " << what << Form("%3i", cal.GetPixId()) << endl;
     1135        *fLog << desc << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms());
     1136        *fLog << " FADC sl. < " << Form("%2.1f", fArrTimeRmsLimit) << endl;
    11431137        bad.SetUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes);
    11441138    }
     
    13101304      if (numareavalid[i] == 1)
    13111305        areavars[i] = 0.;
    1312       else if (numareavalid[i] == 0)
    1313         {
    1314           areaphes[i]    = -1.;
    1315           areaweights[i] = -1.;
    1316         }
    13171306      else
    13181307        {
     
    13231312      if (areavars[i] < 0.)
    13241313        {
    1325           *fLog << warn << GetDescriptor() << ": No pixels with valid variance of photo-electrons found "
    1326                 << "in area index: " << i << endl;
     1314          *fLog << warn << "Area   " << setw(4) << i << ": No pixels with valid variance of photo-electrons found." << endl;
    13271315          continue;
    13281316        }
     
    13671355      if (mean < 0.)
    13681356        {
    1369             *fLog << inf << GetDescriptor() << ": Fitted mean number of photo-electrons " << endl;
    1370             *fLog << " with area idx " << i << ": " << mean << " is smaller than 0. " << endl;
    1371             *fLog << warn << " Will use the simple mean and rms " << endl;
     1357            *fLog << inf  << "Area   " << setw(4) << i << ": Fitted mean number of phe smaller 0." << endl;
     1358            *fLog << warn << "Area   " << setw(4) << i << ": Will use the simple mean and rms " << endl;
    13721359            SetPheFitOK(i,kFALSE);
    13731360            delete hist;
     
    13751362        }
    13761363     
    1377       *fLog << inf << GetDescriptor() << ": Mean number of phes with area idx " << i << ": "
     1364      *fLog << inf << "Area   " << setw(4) << i << ": Mean number of phes: "
    13781365            << Form("%7.2f+-%6.2f",mean,sigma) << endl;
    13791366
     
    14271414      if ( nphe < lowlim[aidx] || nphe > upplim[aidx] )
    14281415        {
    1429           *fLog << warn << "Number of phes: "
    1430                 << Form("%7.2f out of +%3.1f-%3.1f sigma limit: ",nphe,fPheErrUpperLimit,fPheErrLowerLimit)
    1431                 << Form("[%7.2f,%7.2f] pixel%4i",lowlim[aidx],upplim[aidx],i) << endl;
     1416            *fLog << warn << "Pixel  " << setw(4) << i << ": Num of phe "
     1417                << Form("%7.2f out of +%3.1f-%3.1f sigma limit ",nphe,fPheErrUpperLimit,fPheErrLowerLimit)
     1418                << Form("[%7.2f,%7.2f]",lowlim[aidx],upplim[aidx]) << endl;
    14321419          bad.SetUncalibrated( MBadPixelsPix::kDeviatingNumPhes );
    14331420
     
    14471434      sectorphes    [sector] += nphe/area;
    14481435      numsectorvalid[sector] ++;
    1449     } 
     1436    }
    14501437
    14511438  *fLog << endl;
     
    14691456          areaphes[aidx]    /=  numareavalid[aidx];
    14701457        }
    1471      
     1458
    14721459      if (areaweights[aidx] < 0. || areaphes[aidx] <= 0.)
    14731460        {
    1474           *fLog << warn << GetDescriptor()
    1475                 << ": Mean number phes from area index " << aidx << " could not be calculated: "
     1461          *fLog << warn << "Area   " << setw(4) << aidx << ": Mean number phes could not be calculated: "
    14761462                << " Mean: "  << areaphes[aidx]
    1477                 << " Variance: " << areaweights[aidx]    << endl;
     1463                << " Var: " << areaweights[aidx]    << endl;
    14781464          apix.SetFFactorMethodValid(kFALSE);
    14791465          continue;
    14801466        }
    1481      
    1482       *fLog << inf << GetDescriptor()
    1483             << ": Average total phes for area idx " << aidx << ": "
     1467
     1468      *fLog << inf << "Area   " << setw(4) << aidx << ": Average total phes: "
    14841469            << Form("%7.2f +- %6.2f",areaphes[aidx],TMath::Sqrt(areaweights[aidx])) << endl;
    1485                    
     1470
    14861471      apix.SetPheFFactorMethod   ( areaphes[aidx] );
    14871472      apix.SetPheFFactorMethodVar( areaweights[aidx] / numareavalid[aidx] );     
     
    15151500      if (sectorweights[sector] < 0. || sectorphes[sector] <= 0.)
    15161501        {
    1517           *fLog << warn << GetDescriptor()
    1518                 <<": Mean number phes/area for sector " << sector << " could not be calculated: "
    1519                 << " Mean: "  << sectorphes[sector]
    1520                 << " Variance: "             << sectorweights[sector]    << endl;
     1502          *fLog << warn << "Sector " << setw(4) << sector
     1503                <<": Mean number phes/area could not be calculated:"
     1504                << " Mean: "  << sectorphes[sector] << " Var: " << sectorweights[sector]    << endl;
    15211505          spix.SetFFactorMethodValid(kFALSE);
    15221506          continue;
    15231507        }
    15241508
    1525       *fLog << inf << GetDescriptor()
    1526             << ": Avg number phes/mm^2 in sector " << sector << ": "
     1509      *fLog << inf << "Sector " << setw(4) << sector
     1510            << ": Avg number phes/mm^2: "
    15271511            << Form("%5.3f+-%4.3f",sectorphes[sector],TMath::Sqrt(sectorweights[sector]))
    15281512            << endl;
     
    15581542            {
    15591543              *fLog << warn << GetDescriptor()
    1560                     << ": Could not calculate the Conv. FADC counts to Phes in pixel:  "
    1561                     << Form("         %4i",pix.GetPixId())
     1544                    << "Pixel  " << setw(4) << pix.GetPixId()
     1545                    <<": Could not calculate the Conv. FADC counts to Phes"
    15621546                    << endl;
    15631547              bad.SetUncalibrated( MBadPixelsPix::kDeviatingNumPhes );
     
    16111595      if (2.*(lambdacheck-lambda)/(lambdacheck+lambda) > fLambdaCheckLimit)
    16121596        {
    1613           *fLog << warn << GetDescriptor() << ": Lambda="
     1597          *fLog << warn << "BlindPix " << i << ": Lambda="
    16141598                << Form("%4.2f", lambda) << " and Lambda-Check="
    16151599                << Form("%4.2f", lambdacheck) << " differ by more than "
    1616                 << Form("%4.2f", fLambdaCheckLimit) << " in the Blind Pixel Nr."
    1617                 << Form("%2i", i) << endl;
     1600                << Form("%4.2f", fLambdaCheckLimit) << endl;
    16181601          blindpix.SetValid(kFALSE);
    16191602          continue;
     
    16221605      if (lambdaerr > fLambdaErrLimit)
    16231606        {
    1624             *fLog << warn << GetDescriptor() << ": Error of Fitted Lambda="
     1607            *fLog << warn << "BlindPix " << i << ": Error of Fitted Lambda="
    16251608                << Form("%4.2f", lambdaerr) << " is greater than "
    1626                 << Form("%4.2f", fLambdaErrLimit)
    1627                 << " in Blind Pixel Nr." << Form("%2d", i) << endl;
     1609                << Form("%4.2f", fLambdaErrLimit) << endl;
    16281610          blindpix.SetValid(kFALSE);
    16291611          continue;
     
    16681650  if (fPINDiode->GetMean() < fChargeLimit*fPINDiode->GetPedRms())
    16691651    {
    1670       *fLog << warn << GetDescriptor() << ": Fitted Charge is smaller than "
    1671             << fChargeLimit << " Pedestal RMS in PINDiode " << endl;
     1652      *fLog << warn << "PINDiode   : Fitted Charge is smaller than "
     1653            << fChargeLimit << " Pedestal RMS." << endl;
    16721654      return kFALSE;
    16731655    }
     
    16751657  if (fPINDiode->GetMeanErr() < fChargeErrLimit)
    16761658    {
    1677       *fLog << warn << GetDescriptor() << ": Error of Fitted Charge is smaller than "
    1678             << fChargeErrLimit << " in PINDiode " << endl;
     1659        *fLog << warn << "PINDiode   : Error of Fitted Charge is smaller than "
     1660            << fChargeErrLimit << endl;
    16791661      return kFALSE;
    16801662    }
     
    16821664  if (fPINDiode->GetMean() < fChargeRelErrLimit*fPINDiode->GetMeanErr())
    16831665    {
    1684       *fLog << warn << GetDescriptor() << ": Fitted Charge is smaller than "
    1685             << fChargeRelErrLimit << "* its error in PINDiode " << endl;
     1666        *fLog << warn << "PINDiode   : Fitted Charge is smaller than "
     1667            << fChargeRelErrLimit << "* its error" << endl;
    16861668      return kFALSE;
    16871669    }
     
    16891671  if (fPINDiode->GetSigma() < fPINDiode->GetPedRms())
    16901672    {
    1691       *fLog << warn << GetDescriptor()
    1692             << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl;
     1673        *fLog << warn << "PINDiode   : Sigma of Fitted Charge smaller than Pedestal RMS" << endl;
    16931674      return kFALSE;
    16941675    }
     
    16971678  if (!fPINDiode->CalcFluxOutsidePlexiglass())
    16981679    {
    1699       *fLog << warn << "Could not calculate the flux of photons from the PIN Diode, "
     1680        *fLog << warn << "PINDiode   : Could not calculate the flux of photons, "
    17001681            << "will skip PIN Diode Calibration " << endl;
    17011682      return kFALSE;
     
    19051886        }
    19061887
    1907       *fLog << inf << GetDescriptor() << ": Mean F-Factor "
    1908           << "with area index #" << i << ": " << Form("%4.2f+-%4.2f",mean,sigma) << endl;
     1888      *fLog << inf << "Area    " << setw(4) << i <<": Mean F-Factor :"
     1889          << Form("%4.2f+-%4.2f",mean,sigma) << endl;
    19091890
    19101891      lowlim  [i] = 1.;
     
    19321913      if ( ffactor < lowlim[aidx] || ffactor > upplim[aidx] )
    19331914        {
    1934           *fLog << warn << "Overall F-Factor "
     1915            *fLog << warn << "Pixel  " << setw(4) << i<< ": Overall F-Factor "
    19351916                << Form("%5.2f",ffactor) << " out of range ["
    1936                 << Form("%5.2f,%5.2f",lowlim[aidx],upplim[aidx]) << "] Pixel " << i << endl;
     1917                << Form("%5.2f,%5.2f",lowlim[aidx],upplim[aidx]) << "]" << endl;
    19371918
    19381919          bad.SetUncalibrated( MBadPixelsPix::kDeviatingFFactor );
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc

    r7188 r8147  
    799799  if (convrelvar > limit || convrelvar < 0.)
    800800    {
    801       *fLog << warn << GetDescriptor() << ":  Conv. F-Factor Method Rel. Var.: "
    802             << Form("%4.3f out of limits: [0,%3.2f] in pixel:%4i",convrelvar,limit,fPixId) << endl;
    803       return kFALSE;
     801        *fLog << warn << "pixel  " << setw(4) << fPixId << ": Conv. F-Factor Method Rel. Var.: "
     802            << Form("%4.3f out of limits: [0,%3.2f]",convrelvar,limit) << endl;
     803        return kFALSE;
    804804    }
    805805 
  • trunk/MagicSoft/Mars/mfbase/MFDataPhrase.cc

    r8091 r8147  
    116116    *fLog << inf << "found: ";
    117117    fData->Print();
     118    *fLog << endl;
    118119}
    119120
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r7886 r8147  
    719719     
    720720      const Float_t sumhi = pix.GetExtractedSignalHiGain();
    721       const Bool_t  sathi = pix.IsHiGainSaturated();
     721      const Int_t   sathi = pix.IsHiGainSaturated() ? 1 : 0;
    722722
    723723      if (IsOscillations())
     
    742742        {
    743743          MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)(*this)(i);
    744           const Float_t sumlo  = pix.GetExtractedSignalLoGain();
    745           const Int_t   satlo = (Int_t)pix.GetNumLoGainSaturated();
     744          const Float_t sumlo = pix.GetExtractedSignalLoGain();
     745          const Int_t   satlo = pix.IsLoGainSaturated() ? 1 : 0;
    746746         
    747747          if (IsOscillations())
     
    11301130    if (mean<lowerlimit)
    11311131    {
    1132         *fLog << warn << "Mean Arr.Time: "
     1132        *fLog << warn << hist.GetName() << ": Mean Arr.Time: "
    11331133            << Form("%4.1f < %4.1f, %3.1f", mean, TMath::Floor(first)+fTimeLowerLimit, fTimeLowerLimit)
    1134             << " slices below " << Form("%2i", (Int_t)first) << " in "
    1135             << hist.GetName() << endl;
     1134            << " slices below " << Form("%2i", (Int_t)first) << endl;
    11361135        bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin );
    11371136    }
     
    11391138    if (mean>upperlimit)
    11401139    {
    1141         *fLog << warn << "Mean Arr.Time: "
     1140        *fLog << warn << hist.GetName() << ": Mean Arr.Time: "
    11421141            << Form("%4.1f > %4.1f, %3.1f", mean, TMath::Floor(last)-fTimeUpperLimit, fTimeUpperLimit)
    1143             << " slices above " << Form("%2i", (Int_t)last) << " in "
    1144             << hist.GetName() << endl;
     1142            << " slices above " << Form("%2i", (Int_t)last) << endl;
    11451143        bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins );
    11461144    }
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc

    r7430 r8147  
    414414      Byte_t *end   = start + pixel.GetNumHiGainSamples();
    415415      Byte_t *p     = start;
    416       Byte_t max    = 0;
     416      Byte_t *max   = start;
    417417      Int_t  maxpos = 0;
    418418
    419419      while (p < end)
    420420        {
    421           if ((*p > max) && (*p < fSaturationLimit))
     421          if (*p > *max)
    422422            {
    423               max = *p;
     423              max = p;
    424424              maxpos = p-start-1;
    425425            }
     
    433433      while (p < end)
    434434        {
    435           if ((*p > max) && (*p < fSaturationLimit))
     435          if (*p > *max)
    436436            {
    437               max = *p;
     437              max = p;
    438438              maxpos = p-start+pixel.GetNumHiGainSamples() - 1;
    439439            }
     
    441441        }
    442442
    443       if (max < fLowerSignalLimit)
     443      if (*max < fLowerSignalLimit || *max > fSaturationLimit)
    444444        continue;
    445445
Note: See TracChangeset for help on using the changeset viewer.