Ignore:
Timestamp:
12/08/03 10:56:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.cc

    r2521 r2620  
    231231    }
    232232
     233    {
     234        // FIXME This is a stupid workaround for the missing time stamp!
     235        //       Might be used depending on the run number in the future
     236        static Double_t tm = 0; // Range of roughly 8min
     237        const UInt_t ct = (*fRawCrateArray)[0]->GetFADCClockTick();
     238
     239        tm = ct<tm ? fmod(tm, (UInt_t)(-1))+(UInt_t)(-1)+ct : ct;
     240
     241        const Double_t mhz = 9.375;                        // [1e6 ticks/s]
     242        const Double_t t   = tm/mhz;                       // [us]
     243        cout << (ULong_t)t << endl;
     244        const UInt_t ns    = (UInt_t)fmod(t*1e3, 1e6);
     245        const UShort_t ms  = (UShort_t)fmod(t/1e3, 1e3);
     246        const Byte_t s     = (Byte_t)fmod(t/1e6, 60);
     247
     248        // Create an artificial time stamp!
     249        UInt_t m     = (Byte_t)fmod(t/60e6, 60);
     250        //const Byte_t h     = (Byte_t)(t/3600e6);
     251        m += fRawRunHeader->GetRunNumber()*10;
     252        m %= 360; // 6h
     253
     254        fRawEvtTime->Set(fRawRunHeader->GetDateYear(),
     255                         fRawRunHeader->GetDateMonth(),
     256                         fRawRunHeader->GetDateDay(),
     257                         m/60, m%60, s, ms, ns);
     258
     259        //cout << tm << ": ";
     260        //fRawEvtTime->Print();
     261    }
     262
    233263    return kTRUE;
    234264}
Note: See TracChangeset for help on using the changeset viewer.