4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /* $Id: AliTimeStamp.h 22322 2007-11-22 11:43:14Z cvetan $ */
9 ///////////////////////////////////////////////////////////////////////////////
11 // Class to define Event Timestamp from :
16 // + | ===> Bunch cross
19 //////////////////////////////////////////////////////////////////////////////
24 class AliTimeStamp : public TObject {
28 AliTimeStamp( UInt_t orbit, UInt_t period, ULong64_t bunchCross );
29 AliTimeStamp( UInt_t orbit, UInt_t period,
30 UInt_t seconds, UInt_t microsecs );
31 virtual ~AliTimeStamp() {}
34 UInt_t GetOrbit() const { return fOrbit; }
35 UInt_t GetPeriod() const { return fPeriod; }
36 ULong64_t GetBunchCross() const { return fBunchCross; }
37 UInt_t GetSeconds() const { return (UInt_t)(fBunchCross/1000000000.*fNanosecPerBC); }
38 UInt_t GetMicroSecs() const { return (UInt_t)(fmod(fBunchCross *fNanosecPerBC, 1000000000.)/1000 ); }
39 virtual Bool_t IsSortable() const { return kTRUE; }
41 void SetTimeStamp( UInt_t orbit, UInt_t period, ULong64_t bunchcross );
42 void SetTimeStamp( UInt_t orbit, UInt_t period,
43 UInt_t seconds, UInt_t microsecs );
46 virtual Int_t Compare( const TObject* obj ) const;
47 virtual void Print( const Option_t* opt ="" ) const;
49 static const Int_t fNanosecPerBC; //! nanosecs per bunch cross
52 UInt_t fOrbit; // Orbit
53 UInt_t fPeriod; // Period counter
54 ULong64_t fBunchCross; // Bunch Cross
55 // UInt_t fSeconds; // Seconds
56 // UInt_t fMicroSecs; // Microsecs
59 AliTimeStamp( const AliTimeStamp ×tamp );
60 AliTimeStamp& operator=(const AliTimeStamp& clus);
62 ClassDef( AliTimeStamp, 1 ) // Define a timestamp