Changeset 7288 for trunk


Ignore:
Timestamp:
08/17/05 17:36:32 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7287 r7288  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2005/08/17 Thomas Bretz
     21
     22   * mcalib/MCalibCalcFromPast.[h,cc]:
     23     - reset the number of events fNumEvents in ReInit, because
     24       the corresponding histograms get also reset. This prevents
     25       the calibration from analysing partly filled histograms
     26     - the number of cases in which the fChargeCalc->Finalize fails
     27       are counted and written to the console
     28     - In PostProcess all histograms and fChargeCalc are reset to
     29       prevent the finalization of the histograms to fit partly filled
     30       histograms and fail.
     31
     32   * mcalib/MCalibrationChargeCalc.h:
     33     - added a member function ResetNumProcessed so that MCalibCalcFromPast
     34       can 'switch off' the finalization in PostProcess
     35
     36   * mhcalib/MHCalibrationCam.cc, mhcalib/MHCalibrationChargeCam.cc,
     37     mhcalib/MHCalibrationPulseTimeCam.cc:
     38     - shortened some console output
     39
     40
     41
    2042 2005/08/16 Thomas Bretz
    2143
  • trunk/MagicSoft/Mars/NEWS

    r7267 r7288  
    33 *** Version <cvs>
    44
     5   - callisto: fixed some problems with the calibration in case of
     6     inteleaved events. Therefor the final and some intermediate
     7     fits are skipped which would take place on partly filled #
     8     histograms and gave wrong results or failed completely.
     9
     10   - callisto: If the intermediate finalization of the histograms
     11     calculating the mean charge of the calibration signal fails
     12     it is counted now and printed in PostProcess of MCalibCalcFromPast.
     13
     14   - ganymed: Fixed some bugs which caused problems in On-only mode.
     15     Still the false source plot doesn't give reasonable results.
    516
    617
     
    2233   - general: MHillas - the case of CorrXY==0 is now handled properly
    2334
    24    - general: implemnetd the possibility to change the line and
     35   - general: implemented the possibility to change the line and
    2536     marker style of a sky-grid drawn by MAstroCatalog
    2637
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc

    r7190 r7288  
    9393      fIntensBad(NULL),
    9494      fChargeCalc(NULL), fRelTimeCalc(NULL), fCalibrate(NULL),
    95       fNumCam(0), fNumEvents(0), fUpdateWithFFactorMethod(kTRUE), fUpdateNumPhes(kTRUE)
     95    fNumCam(0), fNumEvents(0), fUpdateWithFFactorMethod(kTRUE), fUpdateNumPhes(kTRUE),
     96    fNumFails(0)
    9697{
    9798
     
    252253    }
    253254
     255  fNumFails = 0;
     256
    254257  return kTRUE;
     258}
     259
     260// --------------------------------------------------------------------------
     261//
     262// Set fNumEvents=0
     263//
     264// This is necessary because the calibration histograms do reset themself
     265// if ReInit is called, so they are empty. MCalibCalcFromPast errornously
     266// ignores how many events are in the histograms but count the number
     267// itself.
     268//
     269Bool_t MCalibCalcFromPast::ReInit(MParList *pList)
     270{
     271    if (fNumEvents>0)
     272        *fLog << inf << fNumEvents << " calibration events at the end of the last file have been skipped." << endl;
     273
     274    fNumEvents = 0;
     275
     276    return kTRUE;
    255277}
    256278
     
    288310  if (fChargeCalc)
    289311    {
    290       if (!fChargeCalc->Finalize())
    291           return kERROR;
    292 
    293       if (fUpdateNumPhes)
     312        if (!fChargeCalc->Finalize())
     313        {
     314            fNumFails++;
     315            *fLog << warn << "WARNING - Finalization of charges failed the " << fNumFails << " time..." << endl;
     316        }
     317
     318        if (fUpdateNumPhes)
    294319        {
    295320          MCalibrationChargePix &avpix =(MCalibrationChargePix&)fIntensCharge->GetCam()->GetAverageArea(0);
     
    336361// - MHCalibrationCam::ResetHists()
    337362//
    338 Bool_t MCalibCalcFromPast::Finalize(const char* name)
    339 {
    340 
    341   MHCalibrationCam *hist = (MHCalibrationCam*)fParList->FindObject(name);
    342   if (hist)
    343     {
    344       hist->Finalize();
    345       hist->ResetHists();
    346       return kTRUE;
    347     }
    348 
    349   return kFALSE;
    350  
     363Bool_t MCalibCalcFromPast::Finalize(const char* name, Bool_t finalize)
     364{
     365    MHCalibrationCam *hist = (MHCalibrationCam*)fParList->FindObject(name, "MHCalibrationCam");
     366    if (!hist)
     367        return kFALSE;
     368
     369    if (finalize)
     370        hist->Finalize();
     371
     372    hist->ResetHists();
     373    return kTRUE;
    351374}
    352375
     
    398421Int_t MCalibCalcFromPast::PostProcess()
    399422{
    400   *fLog << inf << "Number of Calibration Cams: " << fNumCam << endl;
    401   return kTRUE;
    402  
     423    if (GetNumExecutions()==0)
     424        return kTRUE;
     425
     426    // Now we reset all histograms to make sure that the PostProcess
     427    // of the following tasks doesn't try to finalize a partly empty
     428    // histogram!
     429    Finalize("MHCalibrationChargeCam",      kFALSE);
     430    Finalize("MHCalibrationChargeBlindCam", kFALSE);
     431    Finalize("MHCalibrationRelTimeCam",     kFALSE);
     432
     433    if (fChargeCalc)
     434        fChargeCalc->ResetNumProcessed();
     435
     436    if (fNumCam==0)
     437        return kTRUE;
     438
     439    *fLog << inf << endl;
     440    *fLog << GetDescriptor() << " execution statistics:" << endl;
     441    *fLog << " " << setw(7) << fNumFails << " (" << Form("%5.1f", 100.*fNumFails/fNumCam) << "%) updates failed." << endl;
     442    *fLog << endl;
     443
     444    return kTRUE;
    403445}
    404446
     
    468510    }
    469511
    470 
    471 
    472512    return rc;
    473513}
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.h

    r7189 r7288  
    5959  TArrayF fPhesVar;
    6060
     61  Int_t fNumFails;          //! How often got the update skipped?
     62
    6163  // MTask
    6264  Int_t  PreProcess(MParList *pList);
    6365  Int_t  Process();
    64   Int_t  PostProcess(); 
     66  Int_t  PostProcess();
     67  Bool_t ReInit(MParList *pList);
    6568
    6669  // MCalibCalcFromPast
    6770  Bool_t ReInitialize();
    68   Bool_t Finalize(const char* name);
     71  Bool_t Finalize(const char* name, Bool_t finalize=kTRUE);
    6972
    7073  Bool_t UpdateMeanPhes();
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r7189 r7288  
    183183  void Clear(const Option_t *o="");
    184184
     185  void ResetNumProcessed() { fNumProcessed=0; }
     186
    185187  Int_t Finalize();
    186188
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc

    r7188 r7288  
    12611261    {
    12621262      *fLog << warn << GetDescriptor()
    1263             << ": Only overflow or underflow in hi-gain pixel: " << pix.GetPixId() << endl;
     1263            << ": Only over- or underflow in hi-gain pixel: " << pix.GetPixId() << endl;
    12641264      return;
    12651265    } 
     
    13531353    {
    13541354      *fLog << warn << GetDescriptor()
    1355             << ": Only overflow or underflow in lo-gain pixel: " << pix.GetPixId() << endl;
     1355            << ": Only over- or underflow in lo-gain pixel: " << pix.GetPixId() << endl;
    13561356      return;
    13571357    } 
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r7188 r7288  
    11191119                                              Byte_t first, Byte_t last)
    11201120{
    1121  
    1122   const Float_t mean = hist.GetAbsTimeMean();
    1123   const Float_t rms  = hist.GetAbsTimeRms();
    1124 
    1125   pix.SetAbsTimeMean ( mean );
    1126   pix.SetAbsTimeRms  ( rms  );
    1127  
    1128   const Float_t lowerlimit = (Float_t)first + fTimeLowerLimit;
    1129   const Float_t upperlimit = (Float_t)last  - fTimeUpperLimit; 
    1130 
    1131   if ( mean < lowerlimit)
    1132     {
    1133       *fLog << warn
    1134             << Form("Mean ArrivalTime: %3.1f < %2.1f slices from lower edge: %2i in pixel %s",
    1135                     mean,fTimeLowerLimit,(Int_t)first,hist.GetName()) << endl;
    1136       bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin );
    1137     }
    1138  
    1139   if ( mean  > upperlimit )
    1140     {
    1141       *fLog << warn
    1142             << Form("Mean ArrivalTime: %3.1f > %2.1f slices from upper edge: %2i in pixel %s",
    1143                     mean,fTimeUpperLimit,(Int_t)last,hist.GetName()) << endl;
    1144       bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins );
     1121    const Float_t mean = hist.GetAbsTimeMean();
     1122    const Float_t rms  = hist.GetAbsTimeRms();
     1123
     1124    pix.SetAbsTimeMean(mean);
     1125    pix.SetAbsTimeRms(rms);
     1126
     1127    const Float_t lowerlimit = (Float_t)first + fTimeLowerLimit;
     1128    const Float_t upperlimit = (Float_t)last  - fTimeUpperLimit;
     1129
     1130    if (mean<lowerlimit)
     1131    {
     1132        *fLog << warn << "Mean Arr.Time: "
     1133            << 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;
     1136        bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin );
     1137    }
     1138
     1139    if (mean>upperlimit)
     1140    {
     1141        *fLog << warn << "Mean Arr.Time: "
     1142            << 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;
     1145        bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins );
    11451146    }
    11461147}
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc

    r7189 r7288  
    555555  if (hist.IsEmpty() || hist.IsOnlyOverflow() || hist.IsOnlyUnderflow())
    556556    {
    557       *fLog << warn << GetDescriptor()
    558             << ": Only overflow or underflow in hi-gain pixel: " << hist.GetName() << endl;
     557      *fLog << warn << GetDescriptor() << ": Only over- or underflow in " << hist.GetName() << endl;
    559558      return;
    560559    } 
Note: See TracChangeset for help on using the changeset viewer.