Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
EventPreamble.hh
Go to the documentation of this file.
1#ifndef __ANTARESDAQ__EVENTPREAMBLE__
2#define __ANTARESDAQ__EVENTPREAMBLE__
3
4#include <ostream>
5#include <iomanip>
6
7#include <TROOT.h>
8#include <TObject.h>
9
12
13/**
14 * Interface for event classes.
15 * It holds the information from the 'preamble' of an event object.
16 */
18 public TObject
19{
20protected:
21 //unsigned int length_; //!< size of object in bytes; not to be written by ROOT
22 //unsigned short dataType; //!< type of object; not to be written by ROOT
23
24public:
25 /** Unique code representing the shore station for this frame */
26 unsigned short frameTarget;
27
28 /** Frame 'time stamp' in units of 50ns (MSW) */
29 unsigned int frameTime1;
30 /** Frame 'time stamp' in units of 50ns (LSW) */
31 unsigned int frameTime2;
32
33 /** Number of frames since start of the run */
34 unsigned int frameIndex;
35
36 /** Run-number as given by the RunControl */
37 unsigned int runNumber;
38
39public:
40 /**
41 * Default constructor.
42 */
44 {
45 //length_ = 0;
46 //dataType = UNDEFINED_EVENT_TYPE;
47 frameTarget = 0;
48 frameTime1 = 0;
49 frameTime2 = 0;
50 frameIndex = 0;
51 runNumber = 0;
52 }
53
54 /**
55 * Virtual destructor.
56 */
57 virtual ~EventPreamble() {};
58
59 /**
60 * Print ASCII.
61 *
62 * \param out output stream
63 * \param object event preamble
64 * \return output stream
65 */
66 friend std::ostream& operator<<(std::ostream& out, const EventPreamble& object)
67 {
68 using namespace std;
69
70 out << "frameTarget " << object.frameTarget << endl;
71 out << "frameTime1 " << object.frameTime1 << endl;
72 out << "frameTime2 " << object.frameTime2 << endl;
73 out << "frameIndex " << object.frameIndex << endl;
74 out << "runNumber " << object.runNumber << endl;
75
76 return out;
77 }
78
80};
81
82
83/**
84 * equal operator for event preamble
85 *
86 * \param first event preamble
87 * \param second event preamble
88 * \return true if first equals second; else false
89 */
90inline bool operator==(const EventPreamble& first, const EventPreamble& second)
91{
92 return (first.frameIndex == second.frameIndex &&
93 first.runNumber == second.runNumber);
94}
95
96/**
97 * not-equal operator for event preamble
98 *
99 * \param first event preamble
100 * \param second event preamble
101 * \return true if first not equals second; else false
102 */
103inline bool operator!=(const EventPreamble& first, const EventPreamble& second)
104{
105 return (first.frameIndex != second.frameIndex ||
106 first.runNumber != second.runNumber);
107}
108
109#endif
110
bool operator==(const EventPreamble &first, const EventPreamble &second)
equal operator for event preamble
bool operator!=(const EventPreamble &first, const EventPreamble &second)
not-equal operator for event preamble
Interface for event classes.
virtual ~EventPreamble()
Virtual destructor.
friend std::ostream & operator<<(std::ostream &out, const EventPreamble &object)
Print ASCII.
unsigned int frameTime2
Frame 'time stamp' in units of 50ns (LSW)
ClassDef(EventPreamble, 2)
unsigned int runNumber
Run-number as given by the RunControl.
unsigned int frameIndex
Number of frames since start of the run.
unsigned short frameTarget
Unique code representing the shore station for this frame.
unsigned int frameTime1
Frame 'time stamp' in units of 50ns (MSW)
EventPreamble()
Default constructor.