GRUTinizer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TNSCLEvent.h
Go to the documentation of this file.
1 #ifndef _TNSCLEVENT_H_
2 #define _TNSCLEVENT_H_
3 
4 #include "TRawEvent.h"
5 #include "TSmartBuffer.h"
6 
8  BEGIN_RUN = 1, // 0x0001
9  END_RUN = 2, // 0x0002
10  PAUSE_RUN = 3, // 0x0003
11  RESUME_RUN = 4, // 0x0004
12  // ABNORMAL_ENDRUN = 4, // 0x0004
13  PACKET_TYPES = 10, // 0x000A
14  MONITORED_VARIABLES = 11, // 0x000B
15  RING_FORMAT = 12, // 0x000C
16  PERIODIC_SCALERS = 20, // 0x0014
17  PHYSICS_EVENT = 30, // 0x001E
18  PHYSICS_EVENT_COUNT = 31, // 0x001F
19  EVB_FRAGMENT = 40, // 0x0028
20  EVB_UNKNOWN_PAYLOAD = 41, // 0x0029
21  EVB_GLOM_INFO = 42, // 0x002A
22  FIRST_USER_ITEM_CODE = 32768 // 0x8000
23 };
24 
25 class TNSCLEvent : public TRawEvent {
26  public:
27  TNSCLEvent();
28  TNSCLEvent(const TRawEvent&);
29  virtual ~TNSCLEvent();
30 
31  Int_t GetBodyHeaderSize() const;
32  long GetTimestamp() const;
33  Int_t GetSourceID() const;
34  Int_t GetBarrierType() const;
35  int IsBuiltData() const;
36  const char* GetPayload() const;
38  Int_t GetPayloadSize() const;
40 };
41 
42 class TNSCLScaler : public TNSCLEvent {
43 public:
44  // Seconds since the previous scaler read
45  Int_t GetIntervalStartOffset();
46 
47  // Seconds since beginning of run
48  Int_t GetIntervalEndOffset();
49 
50  // Time when writing to disk
51  time_t GetUnixTime();
52 
53  // Interval (seconds) between each scaler packet
54  Int_t GetIntervalDivisor();
55 
56 // Number of integers to follow.
57  Int_t GetScalerCount();
58 
59  // Are the scalers reset after each read
60  Int_t IsIncremental();
61 
62  Int_t GetScalerValue(size_t scaler_num);
63 
65 };
66 
67 class TNSCLFragment : public TObject {
68 
69 public:
71 
72  Long_t GetFragmentTimestamp() const;
73  Int_t GetFragmentSourceID() const;
74  Int_t GetFragmentPayloadSize() const;
75  Int_t GetFragmentBarrier() const;
76 
78 
79 private:
82 
84 };
85 
86 class TNSCLBuiltRingItem : public TObject {
87 public:
89 
90  TNSCLFragment& GetFragment(size_t fragnum);
91  Int_t Size() const;
92  size_t NumFragments() const;
93  Int_t GetBuiltRingItemSize() const;
94 
95 private:
96  void BuildFragments();
97 
98 
100  std::vector<TNSCLFragment> fragments;
101 
103 };
104 
105 
106 #endif /* _TNSCLEVENT_H_ */