Ignore:
Timestamp:
05/24/06 19:00:45 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc

    r7740 r7744  
    8484    }
    8585
    86     fNsbSum   = 0;
    87     fNsbSq    = 0;
    88     fNsbCount = 0;
     86    fNsbSum   =  0;
     87    fNsbSq    =  0;
     88    fNsbCount =  0;
    8989
    9090    fRunType = run->GetRunType();
     
    127127    // We use kRTNone here as a placeholder for data runs.
    128128    fRunType  = MRawRunHeader::kRTNone;
     129    fLastMjd  = -1;
    129130
    130131    fSkip.Reset();
    131132
    132133    return fDeviation ? kTRUE : kFALSE;
     134}
     135
     136// --------------------------------------------------------------------------
     137//
     138// Increase fSkip[i] by one. If the data in fDeviation is outdated (older
     139// than fMaxAge) and the current report should be skipped reset DevZdAz and
     140// DevXY and fSkip[5] is increased by one.
     141//
     142void MPointingDevCalc::Skip(Int_t i)
     143{
     144    fSkip[i]++;
     145
     146    const Double_t diff = (fReport->GetMjd()-fLastMjd)*1440; // [min] 1440=24*60
     147    if (diff<fMaxAge && fLastMjd>0)
     148        return;
     149
     150    fDeviation->SetDevZdAz(0, 0);
     151    fDeviation->SetDevXY(0, 0);
     152    fSkip[5]++;
    133153}
    134154
     
    142162        fDeviation->SetDevXY(0, 0);   //?!?
    143163        fSkip[1]++;
     164        fLastMjd = fReport->GetMjd();
    144165        return kTRUE;
    145166    }
     
    167188            if (nsb<sum-rms || nsb>sum+rms)
    168189            {
    169                 fSkip[2]++;
     190                Skip(2);
    170191                return kTRUE;
    171192            }
     
    174195        if (fReport->GetNumIdentifiedStars()<fNumMinStars)
    175196        {
    176             fSkip[3]++;
     197            Skip(3);
    177198            return kTRUE;
    178199        }
     
    185206    if (dev*60>fMaxAbsDev)
    186207    {
    187         fSkip[4]++;
     208        Skip(4);
    188209        return kTRUE;
    189210    }
     
    198219
    199220    fSkip[0]++;
     221    fLastMjd = fReport->GetMjd();
    200222
    201223    return kTRUE;
     
    238260    PrintSkipped(fSkip[3], Form("Number of identified stars < %d", fNumMinStars));
    239261    PrintSkipped(fSkip[4], Form("Absolute deviation > %.1farcmin", fMaxAbsDev));
     262    PrintSkipped(fSkip[5], Form("Events set to 0 because older than %.1fmin", fMaxAge));
    240263    *fLog << " " << (int)fSkip[0] << " (" << Form("%5.1f", 100.*fSkip[0]/GetNumExecutions()) << "%) Evts survived calculation!" << endl;
    241264    *fLog << endl;
     
    251274// MPointingDevCalc.NsbMax:      60
    252275// MPointingDevCalc.MaxAbsDev:   15
     276// MPointingDevCalc.MaxAge:      1.0
    253277//
    254278Int_t MPointingDevCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     
    290314        rc = kTRUE;
    291315    }
     316    if (IsEnvDefined(env, prefix, "MaxAge", print))
     317    {
     318        fMaxAge = GetEnvValue(env, prefix, "MaxAge", fMaxAge);
     319        rc = kTRUE;
     320    }
    292321
    293322    return rc;
Note: See TracChangeset for help on using the changeset viewer.