RawTimingMarker.h
Go to the documentation of this file.
1 #ifndef RAWTIMINGMARKER_H
2 #define RAWTIMINGMARKER_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/Macros.h"
5 
6 namespace daqdataformats {
7 
8  static const uint32_t RAWTIMINGMARKER_SIZE = 2;
9 
10 
11  //! Data structure to hold the parts of the timing word
12  struct TimingMarker {
13  uint32_t MarkerLowWord;
14  uint32_t MarkerHighWord;
15  };
16  namespace timmarker {
18  MASK_Lo = 0xFFFFFFFF,
19  MASK_Hi = 0x00FFFFFF
20  };
21 
23  WORD_Lo = 0,
24  WORD_Hi = 1
25  };
26 
29 
30  } // end of namespace timmarker
31 
32 
33  //! Class to hold the timing markers used in the construction of Microslices in the DCMs
34  /*!
35  The RawTimingMarker class impliments the data formats used to create proper timing marker
36  which is used in the construction of a data microslice in the Data concentrator modules
37  data collection process. These markers are designed to separate blocks of data coming
38  out of the front end boards at roughly 5us intervals. All the data between time markers
39  is assume to have occured after the first marker and before the second marker.
40 
41  Each marker is 56 bits (0-55) long divided into a high and low word.
42 
43  This class provides a set of generator methods which will produce a valid time marker
44  based off of the current system clock of the host system on which it is running. This marker
45  is generated using the CPU specific real time clock system and may not be available
46  on all platforms.
47  */
48  class RawTimingMarker: public RawDAQData {
49  public:
50  // Constructors
51  RawTimingMarker(); //! The default constructor
52  RawTimingMarker(const RawTimingMarker& copy_in); //! Deep copy constructor
53  RawTimingMarker(const void* timingmarker_buffer);//! Shallow copy constructor
54  /// Destructor
55  ~RawTimingMarker();
56 
57  uint32_t getLowWord() const; ///! Get method for lower half of timing word
58  uint32_t getHighWord() const; ///! Get method for upper half of timing word
59  uint64_t getTime() const; ///! Get the time-stamp as a single 64-bit value
60 
61  bool setLowWord (const uint32_t); ///! Set method for lower half of timing word
62  bool setHighWord(const uint32_t); ///! Set method for upper half of timing word
63  bool setTime (const uint64_t); ///! Set the time-stamp as a single 64-bit value
64 
65  /// Method to generate a valid timing marker from the system clocks
66  void generate();
67 
68  uint32_t sizeofdata () const;
69 
70  using RawDAQData::readData; // unhide the reset of the readData methods
71  void* readData(const void* buffer){return readDataGeneral(buffer);}
72 
73  protected:
74  void printStandard (std::ostream& os=std::cout) const;
75  void* readDataFromBuffer(const void* buffer) {return readDataGeneral(buffer);}
76  bool setFunctionPointers() { return true;}
77 
78  private:
79  /// Read the TimingMarker version is meaningless, because we don't have versioning for it
80  version_t figureOutTheVersion(const void*) const {return 0;}
81 
82  };
83 
84 
85 } // END NAMESPCE daqdataformats
86 #endif /* RAWTIMINGMARKER_H */
version_t figureOutTheVersion(const void *) const
Read the TimingMarker version is meaningless, because we don't have versioning for it...
static const uint32_t RAWTIMINGMARKER_SIZE
::xsd::cxx::tree::buffer< char > buffer
Definition: Database.h:179
Data structure to hold the parts of the timing word.
OStream cout
Definition: OStream.cxx:6
Class to hold the timing markers used in the construction of Microslices in the DCMs.
void * readData(const void *buffer)
Shallow copy constructor.
Definition: RawDAQData.cpp:181
int32_t version_t
Definition: RawDAQData.h:72
void * readData(const void *buffer)
void * readDataFromBuffer(const void *buffer)
Class to hold the data from the FEBs in correct formats.
#define DEFINE_SHIFT_FROM_MASK(FUNC)
Definition: Macros.h:151