Ignore:
Timestamp:
06/28/07 21:30:25 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

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

    r7876 r8618  
    6060#include "MSignalPix.h"
    6161
     62#include "MRawRunHeader.h"
     63
    6264ClassImp(MCalibrateRelTimes);
    6365
     
    8688{
    8789    fSignals = (MArrivalTimeCam*)pList->FindObject(AddSerialNumber("MArrivalTimeCam"));
    88 
    8990    if (!fSignals)
    9091    {
     
    99100    fCalibrations = (MCalibrationRelTimeCam*)pList->FindObject(AddSerialNumber("MCalibrationRelTimeCam"));
    100101    if (!fCalibrations)
    101       {
     102    {
    102103        *fLog << err << AddSerialNumber("MCalibrationRelTimeCam") << " not found ... aborting." << endl;
    103104        return kFALSE;
    104       }
     105    }
    105106
    106107    fArrivalTime = (MSignalCam*)pList->FindCreateObj(AddSerialNumber("MSignalCam"));
     
    108109        return kFALSE;
    109110   
     111    return kTRUE;
     112}
     113
     114Bool_t MCalibrateRelTimes::ReInit(MParList *pList)
     115{
     116    MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
     117    if (!runheader)
     118    {
     119        *fLog << err << AddSerialNumber("MRawRunHeader") << " not found ... aborting." << endl;
     120        return kFALSE;
     121    }
     122
     123    fFreq = runheader->GetFreqSampling();
     124
    110125    return kTRUE;
    111126}
     
    131146        const Float_t offset = pix.GetTimeOffset();
    132147
    133         (*fArrivalTime)[idx].SetArrivalTime(signal-offset);
     148        // convert from slices to ns
     149        const Float_t time = 1000*(signal-offset)/fFreq; // [ns]
     150
     151        (*fArrivalTime)[idx].SetArrivalTime(time);
    134152
    135153        // FIXME: Is this necessary or explicitly done by the signal-
  • trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.h

    r7829 r8618  
    1010class MCalibrationRelTimeCam;
    1111class MArrivalTimeCam;
     12class MRawRunHeader;
    1213class MSignalCam;
    1314
     
    2122    MSignalCam             *fArrivalTime;  // Calibrated arrival times
    2223
    23     Int_t PreProcess(MParList *pList);
    24     Int_t Process();
     24    UShort_t fFreq;                        //! [MHz] Sampling Frequency
     25
     26    Int_t  PreProcess(MParList *pList);
     27    Bool_t ReInit(MParList *pList);
     28    Int_t  Process();
    2529
    2630public:
Note: See TracChangeset for help on using the changeset viewer.