LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
RDTimeStamp.h
Go to the documentation of this file.
1 //
3 // A timestamp data product to be associated with raw::RawDigit
4 // Tom Junk, June 26, 2018
5 //
7 
8 #ifndef RDTIMESTAMPDATAPRODUCT_H
9 #define RDTIMESTAMPDATAPRODUCT_H
10 
11 // uint64_t is typedef unsigned long long on macOS but unsigned long on Linux
12 // We use the root type ULong64_t from RtypesCore.h instead
13 #include "RtypesCore.h"
14 #include <stdint.h>
15 
16 
17 namespace raw {
18 
20  {
21 
22  public:
23  RDTimeStamp(ULong64_t tstamp=0, uint16_t flags=0) {fTimeStamp = tstamp; fFlags=flags;} // Constructor
24 
25  void SetTimeStamp(ULong64_t tstamp);
26  void SetTimeStamp_Low(uint32_t tslow);
27  void SetTimeStamp_High(uint32_t tshigh);
28  ULong64_t GetTimeStamp() const;
29  uint32_t GetTimeStamp_Low() const;
30  uint32_t GetTimeStamp_High() const;
31  void SetFlags(uint16_t flags);
32  uint16_t GetFlags() const;
33 
34  private:
35  ULong64_t fTimeStamp;
36  uint16_t fFlags;
37  };
38 
39  inline void RDTimeStamp::SetTimeStamp(ULong64_t tstamp) { fTimeStamp = tstamp; }
40  inline void RDTimeStamp::SetTimeStamp_Low(uint32_t tslow) { fTimeStamp &= 0xFFFFFFFF00000000; fTimeStamp |= tslow; }
41  inline void RDTimeStamp::SetTimeStamp_High(uint32_t tshigh) { fTimeStamp &= 0xFFFFFFFF; fTimeStamp |= ( (ULong64_t) tshigh << 32); }
42  inline ULong64_t RDTimeStamp::GetTimeStamp() const { return fTimeStamp; }
43  inline uint32_t RDTimeStamp::GetTimeStamp_Low() const { return fTimeStamp & 0xFFFFFFFF; }
44  inline uint32_t RDTimeStamp::GetTimeStamp_High() const { return fTimeStamp >> 32; }
45  inline void RDTimeStamp::SetFlags(uint16_t flags) {fFlags = flags; }
46  inline uint16_t RDTimeStamp::GetFlags() const { return fFlags; }
47 
48 }
49 
50 
51 #endif // RDTIMESTAMPDATAPRODUCT_H
uint16_t fFlags
Definition: RDTimeStamp.h:36
uint16_t GetFlags() const
Definition: RDTimeStamp.h:46
void SetTimeStamp(ULong64_t tstamp)
Definition: RDTimeStamp.h:39
Raw data description.
Definition: RawTypes.h:6
ULong64_t fTimeStamp
Definition: RDTimeStamp.h:35
uint32_t GetTimeStamp_High() const
Definition: RDTimeStamp.h:44
void SetFlags(uint16_t flags)
Definition: RDTimeStamp.h:45
void SetTimeStamp_High(uint32_t tshigh)
Definition: RDTimeStamp.h:41
ULong64_t GetTimeStamp() const
Definition: RDTimeStamp.h:42
uint32_t GetTimeStamp_Low() const
Definition: RDTimeStamp.h:43
RDTimeStamp(ULong64_t tstamp=0, uint16_t flags=0)
Definition: RDTimeStamp.h:23
void SetTimeStamp_Low(uint32_t tslow)
Definition: RDTimeStamp.h:40