Ignore:
Timestamp:
07/14/05 17:13:40 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7188 r7191  
    472472void MCalibrationRelTimeCalc::FinalizeUnsuitablePixels()
    473473{
    474  
    475   *fLog << inf << endl;
    476   *fLog << GetDescriptor() << ": Rel. Times Calibration status:" << endl;
    477   *fLog << dec << setfill(' ');
    478 
    479   MCalibrationRelTimeCam *relcam = fIntensCam
    480     ? (MCalibrationRelTimeCam*)fIntensCam->GetCam()  : fCam;
    481   MBadPixelsCam         *badcam    = fIntensBad
    482     ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
    483 
    484   const Int_t nareas = fGeom->GetNumAreas();
    485 
    486   TArrayI counts(nareas);
    487 
    488   for (Int_t i=0; i<badcam->GetSize(); i++)
    489     {
    490       MBadPixelsPix &bad = (*badcam)[i];
    491       if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     474    *fLog << inf << endl;
     475    *fLog << GetDescriptor() << ": Rel. Times Calibration status:" << endl;
     476    *fLog << dec;
     477
     478    MCalibrationRelTimeCam *relcam = fIntensCam ? (MCalibrationRelTimeCam*)fIntensCam->GetCam() : fCam;
     479    const MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam() : fBadPixels;
     480
     481    const Int_t nareas = fGeom->GetNumAreas();
     482
     483    TArrayI unsuit(nareas);
     484    TArrayI unrel(nareas);
     485
     486    for (int aidx=0; aidx<nareas; aidx++)
     487    {
     488        unsuit[aidx] += badcam->GetNumUnsuitable(MBadPixelsPix::kUnsuitableRun, fGeom, aidx);
     489        unrel[aidx]  += badcam->GetNumUnsuitable(MBadPixelsPix::kUnreliableRun, fGeom, aidx);
     490        relcam->SetNumUnsuitable(unsuit[aidx], aidx);
     491        relcam->SetNumUnreliable(unrel[aidx],  aidx);
     492    }
     493
     494    if (fGeom->InheritsFrom("MGeomCamMagic"))
     495    {
     496        *fLog << " Uncalibrated Pixels:            Inner: "
     497            << Form("%3i",unsuit[0]) << " Outer: " << Form("%3i",unsuit[1]) << endl;
     498        *fLog << " Unreliable Pixels:              Inner: "
     499            << Form("%3i",unrel[0])  << " Outer: " << Form("%3i",unrel[1])  << endl;
     500    }
     501}
     502
     503// -----------------------------------------------------------------------------------------------
     504//
     505// Print out statistics about BadPixels of type UncalibratedType_t
     506//
     507void MCalibrationRelTimeCalc::PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const
     508{
     509    const MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam()  : fBadPixels;
     510
     511    UInt_t countinner = 0;
     512    UInt_t countouter = 0;
     513    for (Int_t i=0; i<badcam->GetSize(); i++)
     514    {
     515        if ((*badcam)[i].IsUncalibrated(typ))
    492516        {
    493           const Int_t aidx = (*fGeom)[i].GetAidx();
    494           counts[aidx]++;
     517            if (fGeom->GetPixRatio(i) == 1.)
     518                countinner++;
     519            else
     520                countouter++;
    495521        }
    496522    }
    497523
    498   for (Int_t aidx=0; aidx<nareas; aidx++)
    499     relcam->SetNumUnsuitable(counts[aidx], aidx);
    500 
    501   if (fGeom->InheritsFrom("MGeomCamMagic"))
    502     *fLog << " " << setw(7) << "Uncalibrated Pixels:            Inner: "
    503           << Form("%3i",counts[0]) << " Outer: " << Form("%3i",counts[1]) << endl;
    504 
    505   counts.Reset();
    506 
    507   for (Int_t i=0; i<badcam->GetSize(); i++)
    508     {
    509       MBadPixelsPix &bad = (*badcam)[i];
    510       if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun))
    511         {
    512           const Int_t aidx = (*fGeom)[i].GetAidx();
    513           counts[aidx]++;
    514         }
    515     }
    516 
    517   for (Int_t aidx=0; aidx<nareas; aidx++)
    518     relcam->SetNumUnreliable(counts[aidx], aidx);
    519 
    520   *fLog << " " << setw(7) << "Unreliable Pixels:              Inner: "
    521         << Form("%3i",counts[0]) << " Outer: " << Form("%3i",counts[1]) << endl;
    522 
    523 }
    524 
    525 // -----------------------------------------------------------------------------------------------
    526 //
    527 // Print out statistics about BadPixels of type UncalibratedType_t
    528 //
    529 void MCalibrationRelTimeCalc::PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const
    530 {
    531  
    532   MBadPixelsCam         *badcam    = fIntensBad
    533     ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
    534 
    535   UInt_t countinner = 0;
    536   UInt_t countouter = 0;
    537   for (Int_t i=0; i<badcam->GetSize(); i++)
    538     {
    539       MBadPixelsPix &bad = (*badcam)[i];
    540       if (bad.IsUncalibrated(typ))
    541         {
    542           if (fGeom->GetPixRatio(i) == 1.)
    543             countinner++;
    544           else
    545             countouter++;
    546         }
    547     }
    548 
    549   *fLog << " " << setw(7) << text 
    550         << Form("%s%3i%s%3i","Inner: ",countinner," Outer: ",countouter) << endl;
     524    *fLog << " " << text << "Inner: " << Form("%3i",countinner);
     525    *fLog << " Outer: " << Form("%3i", countouter) << endl;
    551526}
    552527
Note: See TracChangeset for help on using the changeset viewer.