Class Reference for E1039 Core & Analysis Software
SQEvent.h
Go to the documentation of this file.
1 /*
2  * SQEvent.h
3  *
4  * Created on: Oct 29, 2017
5  * Author: yuhw
6  */
7 
8 #ifndef _H_SQEvent_H_
9 #define _H_SQEvent_H_
10 
11 #include <phool/PHObject.h>
12 #include <climits>
13 #include <map>
14 #include <iostream>
15 
17 class SQEvent: public PHObject {
18 
19 public:
20 
21  enum TriggerMask {
22  NIM1 = 0,
23  NIM2 = 1,
24  NIM3 = 2,
25  NIM4 = 3,
26  NIM5 = 4,
27  MATRIX1 = 5,
28  MATRIX2 = 6,
29  MATRIX3 = 7,
30  MATRIX4 = 8,
31  MATRIX5 = 9
32  };
33 
34  virtual ~SQEvent() {}
35 
36  void Reset() {}
37 
38  virtual void identify(std::ostream& os = std::cout) const {
39  std::cout
40  << "---SQEvent::identify: abstract base-------------------"
41  << std::endl;
42  }
43 
45  virtual int get_run_id() const = 0;
46  virtual void set_run_id(const int a) = 0;
47 
49  virtual int get_spill_id() const = 0;
50  virtual void set_spill_id(const int a) = 0;
51 
53  virtual int get_event_id() const = 0;
54  virtual void set_event_id(const int a) = 0;
55 
57  virtual int get_coda_event_id() const {return INT_MAX;}
58  virtual void set_coda_event_id(const int a) {;}
59 
61  virtual int get_data_quality() const = 0;
62  virtual void set_data_quality(const int a) = 0;
63 
65  virtual int get_vme_time() const {return INT_MAX;}
66  virtual void set_vme_time(const int a) {;}
67 
69  virtual bool get_trigger(const SQEvent::TriggerMask i) const = 0;
70  virtual void set_trigger(const SQEvent::TriggerMask i, const bool a) = 0;
71 
73  virtual unsigned short get_trigger() const = 0;
74  virtual void set_trigger(const unsigned short a) = 0;
75 
77  virtual int get_raw_matrix(const unsigned short i) const { return INT_MAX; }
78  virtual void set_raw_matrix(const unsigned short i, const bool a) {;}
79 
81  virtual int get_after_inh_matrix(const unsigned short i) const { return INT_MAX; }
82  virtual void set_after_inh_matrix(const unsigned short i, const bool a) {;}
83 
84 
86  virtual int get_qie_presum(const unsigned short i) const = 0;
87  virtual void set_qie_presum(const unsigned short i, const int a) = 0;
88 
90  virtual int get_qie_trigger_count() const = 0;
91  virtual void set_qie_trigger_count(const int a) = 0;
92 
94  virtual int get_qie_turn_id() const = 0;
95  virtual void set_qie_turn_id(const int a) = 0;
96 
98  virtual int get_qie_rf_id() const = 0;
99  virtual void set_qie_rf_id(const int a) = 0;
100 
102  virtual int get_qie_rf_intensity(const short i) const = 0;
103  virtual void set_qie_rf_intensity(const short i, const int a) = 0;
104 
105 
107  virtual short get_flag_v1495() const { return SHRT_MAX; }
108  virtual void set_flag_v1495(const short a) {;}
109 
111  virtual short get_n_board_qie() const { return SHRT_MAX; }
112  virtual void set_n_board_qie(const short a) {;}
113 
115  virtual short get_n_board_v1495() const { return SHRT_MAX; }
116  virtual void set_n_board_v1495(const short a) {;}
117 
119  virtual short get_n_board_taiwan() const { return SHRT_MAX; }
120  virtual void set_n_board_taiwan(const short a) {;}
121 
123  virtual short get_n_board_trig_bit() const { return SHRT_MAX; }
124  virtual void set_n_board_trig_bit(const short a) {;}
125 
127  virtual short get_n_board_trig_count() const { return SHRT_MAX; }
128  virtual void set_n_board_trig_count(const short a) {;}
129 
130 
131 protected:
132 
133  SQEvent(){};
134 
136 };
137 
138 #endif /* _H_SQEvent_H_ */
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
virtual int get_qie_presum(const unsigned short i) const =0
Return the i-th QIE presum, where i=0...3.
void Reset()
Clear Event.
Definition: SQEvent.h:36
virtual void set_vme_time(const int a)
Definition: SQEvent.h:66
virtual int get_raw_matrix(const unsigned short i) const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:77
virtual unsigned short get_trigger() const =0
Return the full trigger bits.
virtual void set_raw_matrix(const unsigned short i, const bool a)
Definition: SQEvent.h:78
virtual int get_after_inh_matrix(const unsigned short i) const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:81
virtual void set_n_board_qie(const short a)
Definition: SQEvent.h:112
virtual void identify(std::ostream &os=std::cout) const
Definition: SQEvent.h:38
virtual int get_run_id() const =0
Return the run ID.
virtual int get_qie_trigger_count() const =0
Return the QIE trigger counts.
virtual void set_after_inh_matrix(const unsigned short i, const bool a)
Definition: SQEvent.h:82
virtual void set_data_quality(const int a)=0
TriggerMask
Definition: SQEvent.h:21
@ MATRIX2
Definition: SQEvent.h:28
@ NIM5
Definition: SQEvent.h:26
@ MATRIX1
Definition: SQEvent.h:27
@ NIM4
Definition: SQEvent.h:25
@ NIM2
Definition: SQEvent.h:23
@ NIM1
Definition: SQEvent.h:22
@ MATRIX3
Definition: SQEvent.h:29
@ NIM3
Definition: SQEvent.h:24
@ MATRIX4
Definition: SQEvent.h:30
@ MATRIX5
Definition: SQEvent.h:31
virtual void set_trigger(const unsigned short a)=0
SQEvent()
Definition: SQEvent.h:133
virtual void set_qie_turn_id(const int a)=0
virtual void set_coda_event_id(const int a)
Definition: SQEvent.h:58
virtual void set_qie_presum(const unsigned short i, const int a)=0
virtual ~SQEvent()
Definition: SQEvent.h:34
ClassDef(SQEvent, 1)
virtual void set_n_board_v1495(const short a)
Definition: SQEvent.h:116
virtual short get_n_board_trig_count() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:127
virtual int get_qie_rf_intensity(const short i) const =0
Return the i-th QIE RF intensity, where i=-16...+16.
virtual bool get_trigger(const SQEvent::TriggerMask i) const =0
Return the trigger bit (fired or not) of the selected trigger channel.
virtual int get_qie_turn_id() const =0
Return the QIE turn ID.
virtual void set_spill_id(const int a)=0
virtual void set_event_id(const int a)=0
virtual void set_n_board_taiwan(const short a)
Definition: SQEvent.h:120
virtual void set_flag_v1495(const short a)
Definition: SQEvent.h:108
virtual short get_n_board_trig_bit() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:123
virtual int get_data_quality() const =0
Return the data-quality bits.
virtual void set_qie_rf_id(const int a)=0
virtual void set_qie_rf_intensity(const short i, const int a)=0
virtual void set_run_id(const int a)=0
virtual void set_n_board_trig_bit(const short a)
Definition: SQEvent.h:124
virtual int get_qie_rf_id() const =0
Return the QIE RF ID.
virtual short get_flag_v1495() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:107
virtual void set_qie_trigger_count(const int a)=0
virtual short get_n_board_v1495() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:115
virtual void set_trigger(const SQEvent::TriggerMask i, const bool a)=0
virtual int get_coda_event_id() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:57
virtual short get_n_board_qie() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:111
virtual int get_spill_id() const =0
Return the spill ID.
virtual int get_vme_time() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:65
virtual void set_n_board_trig_count(const short a)
Definition: SQEvent.h:128
virtual int get_event_id() const =0
Return the event ID, which is unique per run.
virtual short get_n_board_taiwan() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent.h:119