Jpp  18.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 {
20 protected:
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 
24 public:
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 
39 public:
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  */
90 inline 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  */
103 inline 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 
Interface for event classes.
unsigned short frameTarget
Unique code representing the shore station for this frame.
Definition: JRoot.hh:19
EventPreamble()
Default constructor.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
unsigned int frameIndex
Number of frames since start of the run.
friend std::ostream & operator<<(std::ostream &out, const EventPreamble &object)
Print ASCII.
bool operator==(Packet const &p, ID const &id)
unsigned int runNumber
Run-number as given by the RunControl.
ClassDef(EventPreamble, 2)
unsigned int frameTime2
Frame &#39;time stamp&#39; in units of 50ns (LSW)
virtual ~EventPreamble()
Virtual destructor.
unsigned int frameTime1
Frame &#39;time stamp&#39; in units of 50ns (MSW)
bool operator!=(const JTag &first, const JTag &second)
Not equal operator for JTag.
Definition: JTag.hh:291