Ignore:
Timestamp:
10/27/07 21:59:05 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r8551 r8765  
    426426
    427427    fMjd = mjd+1;
     428}
     429
     430// --------------------------------------------------------------------------
     431//
     432// Set MTime to time expressed as float (yymmdd.ffff)
     433//  for details see MAstro::Yymmdd2Mjd
     434//
     435void MTime::SetCorsikaTime(Float_t t)
     436{
     437    const UInt_t   yymmdd = (UInt_t)TMath::Floor(t);
     438    const UInt_t   mjd    = MAstro::Yymmdd2Mjd(yymmdd);
     439    const Double_t frac   = fmod(t, 1)*kDay; // [ms] Fraction of day
     440    const UInt_t   ns     = (UInt_t)fmod(frac*1e6, 1000000);
     441
     442    SetMjd(mjd, (ULong_t)TMath::Floor(frac), ns);
    428443}
    429444
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r8551 r8765  
    9494    Bool_t   SetSqlTimeStamp(const char *str);
    9595    void     SetCT1Time(UInt_t mjd, UInt_t t1, UInt_t t0);
     96    void     SetCorsikaTime(Float_t time);
    9697    Bool_t   SetStringFmt(const char *time, const char *fmt, const char *loc=0);
    9798    Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UInt_t ns);
Note: See TracChangeset for help on using the changeset viewer.