Ignore:
Timestamp:
06/20/15 15:47:28 (9 years ago)
Author:
Daniela Dorner
Message:
added new parameter fTimeSlope to the output of the calibration
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mdrs/MCalibrateDrsTimes.cc

    r18154 r18243  
    153153
    154154        const Float_t signal = (*fSignals)[sw].GetArrivalTime();
     155        const Float_t slope  = (*fSignals)[sw].GetArrivalTimeHiGainError();
    155156        const Float_t offset = fCalib ? fCalib->GetOffset(hw, start[hw], signal) : 0;
     157        const Float_t offset2 = (fCalib && (signal-slope)>=0) ? fCalib->GetOffset(hw, start[hw], signal-slope) : 0;
    156158        const Float_t delay  = fCalib ? fCalib->GetDelay(hw) : 0;
    157159
     
    160162
    161163        // convert from slices to ns
    162         const Float_t utime = 1000*(signal       )/fFreq-delay; // [ns]
    163         const Float_t time  = 1000*(signal-offset)/fFreq-delay; // [ns]
     164        const Float_t utime      = 1000*(signal       )/fFreq-delay;  // [ns]
     165        const Float_t time       = 1000*(signal-offset)/fFreq-delay;  // [ns]
     166        const Float_t slopecal   = (slope-offset+offset2)<0 ? -1 : 1000*(slope-offset+offset2)/fFreq; // [ns]
     167        const Float_t uslope     = slope<0 ? -1 : 1000*(slope)/fFreq;                // [ns]
    164168
    165169        /*
     
    172176        {
    173177            (*fArrivalTime)[idx[j]].SetArrivalTime(time);
     178            (*fArrivalTime)[idx[j]].SetTimeSlope(slopecal);
    174179            if (fArrivalTimeU)
     180            {
    175181                (*fArrivalTimeU)[idx[j]].SetArrivalTime(utime);
     182                (*fArrivalTimeU)[idx[j]].SetTimeSlope(uslope);
     183            }
    176184        }
    177185    }
Note: See TracChangeset for help on using the changeset viewer.