]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
16-mar-2007 NvE Uniform data format introduced for printout of AliTimestamp::Date().
authornick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Mar 2007 11:49:39 +0000 (11:49 +0000)
committernick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Mar 2007 11:49:39 +0000 (11:49 +0000)
RALICE/AliTimestamp.cxx
RALICE/AliTimestamp.h
RALICE/history.txt

index bba3c90db1b0f6847d5640aece2b368249aa72c0..28f8d50f510be73a5c320b28fafaa1a50ac28af4 100644 (file)
 
 #include "AliTimestamp.h"
 #include "Riostream.h"
-#include <cmath>
 
 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)
  {
index 81ecacf23af3b6f9ddd90c5cf10cff743cdb562c..17eab0509c4fcd29af5b77e6c669ad2be421dcb2 100644 (file)
@@ -5,6 +5,8 @@
 
 // $Id$
 
+#include <math.h>
+
 #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
index 54e5c1a3adbdcdf75ff255bc27e5b8c0c6149ecc..2d96e55b00f10a2fa56a9163016999f5cf939bfc 100644 (file)
                 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().