From: nick Date: Fri, 16 Mar 2007 11:49:39 +0000 (+0000) Subject: 16-mar-2007 NvE Uniform data format introduced for printout of AliTimestamp::Date(). X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=145c9890965213666d3bb8a5dde26b8d240a606d;p=u%2Fmrichter%2FAliRoot.git 16-mar-2007 NvE Uniform data format introduced for printout of AliTimestamp::Date(). --- diff --git a/RALICE/AliTimestamp.cxx b/RALICE/AliTimestamp.cxx index bba3c90db1b..28f8d50f510 100644 --- a/RALICE/AliTimestamp.cxx +++ b/RALICE/AliTimestamp.cxx @@ -166,7 +166,6 @@ #include "AliTimestamp.h" #include "Riostream.h" -#include ClassImp(AliTimestamp) // Class implementation to enable ROOT I/O @@ -211,14 +210,14 @@ void AliTimestamp::Date(Int_t mode) { // Print date/time info. // -// mode = 1 ==> Only the TTimeStamp yy-mm-dd hh:mm:ss:ns and GMST info is printed +// mode = 1 ==> Only the UT yy-mm-dd hh:mm:ss:ns:ps and GST info is printed // 2 ==> Only the Julian parameter info is printed -// 3 ==> Both the TTimeStamp, GMST and Julian parameter info is printed +// 3 ==> Both the UT, GST and Julian parameter info is printed // // The default is mode=3. // // Note : In case the (M/T)JD falls outside the TTimeStamp range, -// the TTimeStamp info will be replaced by UT hh:mm:ss:ns:ps info. +// the yy-mm-dd info will be omitted. Int_t mjd,mjsec,mjns,mjps; GetMJD(mjd,mjsec,mjns); @@ -230,19 +229,29 @@ void AliTimestamp::Date(Int_t mode) { if (mjd>=40587 && (mjd<65442 || (mjd==65442 && mjsec<8047))) { - cout << " " << AsString() << endl; + TString month[12]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; + TString day[7]={"Mon","Tue","Wed","Thu","Fri","Sat","Sun"}; + + UInt_t y,m,d; + GetDate(kTRUE,0,&y,&m,&d); + + Int_t wd=GetDayOfWeek(kTRUE,0); + + cout << " " << day[wd-1].Data() << ", " << setfill('0') << setw(2) << d << " " + << setfill(' ') << month[m-1].Data() << " " << y << " "; } else { - GetUT(hh,mm,ss,ns,ps); - cout << " UT : " << setfill('0') << setw(2) << hh << ":" - << setw(2) << mm << ":" << setw(2) << ss - << " ns : " << ns << " ps : " << ps << " "; + cout << " Time "; } + GetUT(hh,mm,ss,ns,ps); + cout << setfill('0') << setw(2) << hh << ":" + << setw(2) << mm << ":" << setw(2) << ss << "." + << setw(9) << ns << setw(3) << ps << " (UT) "; GetGST(hh,mm,ss,ns,ps); - cout << " GST : " << setfill('0') << setw(2) << hh << ":" - << setw(2) << mm << ":" << setw(2) << ss - << " ns : " << ns << " ps : " << ps << endl; + cout << setfill('0') << setw(2) << hh << ":" + << setw(2) << mm << ":" << setw(2) << ss << "." + << setw(9) << ns << setw(3) << ps << " (GST)"<< endl; } if (mode==2 || mode==3) { diff --git a/RALICE/AliTimestamp.h b/RALICE/AliTimestamp.h index 81ecacf23af..17eab0509c4 100644 --- a/RALICE/AliTimestamp.h +++ b/RALICE/AliTimestamp.h @@ -5,6 +5,8 @@ // $Id$ +#include + #include "TTimeStamp.h" #include "TString.h" @@ -70,6 +72,6 @@ class AliTimestamp : public TTimeStamp Int_t fCalcs; // The TTimeStamp seconds counter value at Julian parameter calculation Int_t fCalcns; // The TTimeStamp nanoseconds counter value at Julian parameter calculation - ClassDef(AliTimestamp,6) // Handling of timestamps for (astro)particle physics research. + ClassDef(AliTimestamp,7) // Handling of timestamps for (astro)particle physics research. }; #endif diff --git a/RALICE/history.txt b/RALICE/history.txt index 54e5c1a3adb..2d96e55b00f 100644 --- a/RALICE/history.txt +++ b/RALICE/history.txt @@ -755,4 +755,5 @@ accessible even for cases which fall outside the TTimeStamp range. As such, the UT and GST info will always be provided via the Date() memberfunction. +16-mar-2007 NvE Uniform data format introduced for printout of AliTimestamp::Date().