ProtoDUNETimeStamp.h
Go to the documentation of this file.
1 #ifndef PROTODUNETIMESTAMP_H
2 #define PROTODUNETIMESTAMP_H
3 
4 #include "Rtypes.h"
5 // I want to do this to get the TimingCommand enum from dune-raw-data:
6 //
7 // #include "dune-raw-data/Overlays/TimingFragment.hh" // for TimingCommand enum
8 //
9 // but TimingFragment #includes Fragment.hh from artdaq-core, and
10 // large parts of artdaq::Fragment appear to be hidden from ROOT with
11 // #ifdefs, so I get compile errors from rootcling, eg:
12 //
13 // TimingFragment.hh:115:77: error: no member named 'dataBeginBytes' in 'artdaq::Fragment'
14 //
15 // Life's too short, so I'm copying the enum here with a different name
16 
17 namespace dune {
18 
20  // From https://twiki.cern.ch/twiki/bin/view/CENF/TimingSystemAdvancedOp retrieved on 2018-09-07
21  // The 'sync' bus has the following commands at the moment:
22  TimeSync = 0x0,
23  Echo = 0x1,
24  SpillStart = 0x2,
25  SpillStop = 0x3,
26  RunStart = 0x4,
27  RunStop = 0x5,
28  WibCalib = 0x6,
29  SSPCalib = 0x7,
30  FakeTrig0 = 0x8,
31  FakeTrig1 = 0x9,
32  FakeTrig2 = 0xa,
33  FakeTrig3 = 0xb,
34  BeamTrig = 0xc,
35  NoBeamTrig = 0xd,
36  ExtFakeTrig= 0xe
37  };
38 
40  {
41  public:
43 
44  UInt_t getCookie() const { return m_cookie; }
45  ProtoDUNETimingCommand getTriggerType() const { return m_triggerType; }
46  UInt_t getReservedBits() const { return m_reservedBits; }
47  ULong64_t getTimeStamp() const { return m_timeStamp; }
48  UInt_t getEventCounter() const { return m_eventCounter; }
49  bool isChecksumGood() const { return m_checksumGood; }
50  ULong64_t getLastRunStart() const { return m_lastRunStart; }
51  ULong64_t getLastSpillStart() const { return m_lastSpillStart; }
52  ULong64_t getLastSpillEnd() const { return m_lastSpillEnd; }
53  UInt_t getVersion() const { return m_version; }
54 
55  void setCookie(UInt_t arg) { m_cookie = arg; }
56  void setTriggerType(dune::ProtoDUNETimingCommand arg) { m_triggerType = arg; }
57  void setReservedBits(UInt_t arg) { m_reservedBits = arg; }
58  void setTimeStamp(ULong64_t arg) { m_timeStamp = arg; }
59  void setEventCounter(UInt_t arg) { m_eventCounter = arg; }
60  void setChecksumGood(bool arg) {m_checksumGood = arg;}
61  void setLastRunStart(ULong64_t arg) { m_lastRunStart = arg; }
62  void setLastSpillStart(ULong64_t arg) { m_lastSpillStart = arg; }
63  void setLastSpillEnd(ULong64_t arg) { m_lastSpillEnd = arg; }
64  void setVersion(UInt_t arg) { m_version = arg; }
65 
66  protected:
67  /// The cookie which identifies the event as coming from the timing board
68  UInt_t m_cookie;
69  /// The type of trigger command
71  /// Reserved bits from the trigger command word (ought to be zero)
72  UInt_t m_reservedBits;
73  /// The 50 MHz timestamp of the trigger
74  ULong64_t m_timeStamp;
75  /// The event counter from the timing board reader
76  UInt_t m_eventCounter;
77  /// Whether the checksum is good (always true)
79  /// The timestamp of the last run start seen by the timing board reader
80  ULong64_t m_lastRunStart;
81  /// The timestamp of the last spill start seen by the timing board reader
82  ULong64_t m_lastSpillStart;
83  /// The timestamp of the last spill end seen by the timing board reader
84  ULong64_t m_lastSpillEnd;
85  /// The version of the artdaq timing fragment that this object is made from
86  UInt_t m_version;
87  };
88 
89 }
90 
91 #endif
bool m_checksumGood
Whether the checksum is good (always true)
void setLastSpillEnd(ULong64_t arg)
void setLastSpillStart(ULong64_t arg)
void setTimeStamp(ULong64_t arg)
UInt_t m_reservedBits
Reserved bits from the trigger command word (ought to be zero)
ULong64_t getLastSpillStart() const
ULong64_t m_lastSpillStart
The timestamp of the last spill start seen by the timing board reader.
ProtoDUNETimingCommand m_triggerType
The type of trigger command.
void setEventCounter(UInt_t arg)
ULong64_t getLastSpillEnd() const
ULong64_t m_lastRunStart
The timestamp of the last run start seen by the timing board reader.
UInt_t getReservedBits() const
ProtoDUNETimingCommand getTriggerType() const
ULong64_t m_lastSpillEnd
The timestamp of the last spill end seen by the timing board reader.
void setTriggerType(dune::ProtoDUNETimingCommand arg)
void setLastRunStart(ULong64_t arg)
void setReservedBits(UInt_t arg)
ULong64_t m_timeStamp
The 50 MHz timestamp of the trigger.
UInt_t m_eventCounter
The event counter from the timing board reader.
ULong64_t getLastRunStart() const
UInt_t getEventCounter() const
ULong64_t getTimeStamp() const
UInt_t m_version
The version of the artdaq timing fragment that this object is made from.
ProtoDUNETimingCommand
UInt_t m_cookie
The cookie which identifies the event as coming from the timing board.