Ignore:
Timestamp:
05/13/05 19:26:28 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc

    r6985 r7033  
    172172    const UInt_t cnt = n1<n2 ? n : n1-n2;
    173173
    174     if (cnt<n/10)
    175         return kTRUE;
    176 
    177 
    178     // Calculate the rate
    179     const Double_t rate = (Double_t)cnt/(fTimes[n1%n]-fTimes[n2%n]);
    180 
    181174    // Store the time difference between two consecutive events
    182175    fTimeDiff->SetVal(exec==0 ? -1 : fTimes[n1%n] - fTimes[(n1+n-1)%n]);
     
    185178    // Make sure, that the beginning of data-takeing (open
    186179    // a new file) doesn't effect the rate too much
    187     if (exec<fNumFirstEvent+n)
    188     {
    189         fRate->SetRate(-1, 0);
     180    if (cnt<n/10)
    190181        return kTRUE;
    191     }
     182
     183    // Calculate the rate
     184    const Double_t rate = (Double_t)cnt/(fTimes[n1%n]-fTimes[n2%n]);
    192185
    193186    // Store the rate
     
    195188    fRate->SetReadyToSave();
    196189
    197     Double_t diff = fTimes[n1%n]- fTimes[n2%n];
    198     Double_t time = fTimes[n2%n]+ (cnt-n/10.)/(n-n/10.)*diff/2;
     190    // Calculate and store the corresponding time
     191    const Double_t diff = fTimes[n1%n] - fTimes[n2%n];
     192    const Double_t time = fTimes[n2%n] + (cnt-n/10.)/(n-n/10.)*diff/2;
    199193
    200194    fTimeRate->SetMean(time, time);
    201 
    202     //if (cnt>1000)
    203     //*fLog << all << *fTimeRate << " " << *fTime << " " << diff << " " << cnt << " " << n << " " << (float)(cnt-n/2)/n << endl;
    204 
     195    fTimeRate->SetReadyToSave();
     196
     197   /*
    205198    // Store the corresponding time
    206199    if (exec==fNumFirstEvent+n)
     
    208201    else
    209202        fTimeRate->SetMean(fTimes[n1%n], fTimes[n2%n]);
     203        */
    210204
    211205    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.