Class Reference for E1039 Core & Analysis Software
SQEvent_v1.h
Go to the documentation of this file.
1 /*
2  * SQEvent_v1.h
3  *
4  * Created on: Oct 29, 2017
5  * Author: yuhw
6  */
7 
8 #ifndef _H_SQEvent_v1_H_
9 #define _H_SQEvent_v1_H_
10 
11 #include <phool/PHObject.h>
12 
13 #include <map>
14 #include <iostream>
15 #include <limits>
16 #include <climits>
17 
18 #include "SQEvent.h"
19 
20 class SQEvent_v1: public SQEvent {
21 
22 public:
23 
25 
26  virtual ~SQEvent_v1();
27 
28  void Reset();
29  virtual void identify(std::ostream& os = std::cout) const;
30  int isValid() const {return 1;}
31  SQEvent* Clone() const {return new SQEvent_v1(*this);}
32 
33  virtual int get_run_id() const {return _run_id;}
34  virtual void set_run_id(const int a) {_run_id = a;}
35 
36  virtual int get_spill_id() const {return _spill_id;}
37  virtual void set_spill_id(const int a) {_spill_id = a;}
38 
39  virtual int get_event_id() const {return _event_id;}
40  virtual void set_event_id(const int a) {_event_id = a;}
41 
42  virtual int get_coda_event_id() const {return _coda_event_id;}
43  virtual void set_coda_event_id(const int a) {_coda_event_id = a;}
44 
45 
46  virtual int get_data_quality() const {return _data_quality;}
47  virtual void set_data_quality(const int a) {_data_quality = a;}
48 
49  virtual int get_vme_time() const {return _vme_time;}
50  virtual void set_vme_time(const int a) {_vme_time = a;}
51 
52  virtual bool get_trigger(const SQEvent::TriggerMask i) const {return (_trigger&(1<<i)) > 0 ;}
53  virtual void set_trigger(const SQEvent::TriggerMask i, const bool a) {a ? (_trigger |= (1<<i)) : (_trigger &= ~(1<<i)) ;}
54 
55  virtual unsigned short get_trigger() const {return _trigger;}
56  virtual void set_trigger(const unsigned short a) {_trigger = a;}
57 
58  virtual int get_raw_matrix(const unsigned short i) const {
59  if(i<5) return _raw_matrix[i];
60  return INT_MAX;
61  }
62  virtual void set_raw_matrix(const unsigned short i, const bool a) {
63  if(i<5) _raw_matrix[i] = a;
64  else std::cout<<"SQEvent_v1::set_raw_matrix: i>=5";
65  }
66 
67  virtual int get_after_inh_matrix(const unsigned short i) const {
68  if(i<5) return _after_inh_matrix[i];
69  return INT_MAX;
70  }
71  virtual void set_after_inh_matrix(const unsigned short i, const bool a) {
72  if(i<5) _after_inh_matrix[i] = a;
73  else std::cout<<"SQEvent_v1::set_after_inh_matrix: i>=5";
74  }
75 
76  virtual int get_qie_presum(const unsigned short i) const {
77  if (i<4) return _qie_presums[i];
78  return INT_MAX;
79  }
80  virtual void set_qie_presum(const unsigned short i, const int a) {
81  if(i<4) _qie_presums[i] = a;
82  else std::cout<<"SQEvent_v1::set_qie_presum: i>=4";
83  }
84 
85  virtual int get_qie_trigger_count() const { return _qie_trig_cnt; }
86  virtual void set_qie_trigger_count(const int a) { _qie_trig_cnt = a; }
87 
88  virtual int get_qie_turn_id() const { return _qie_turn_id; }
89  virtual void set_qie_turn_id(const int a) { _qie_turn_id = a; }
90 
91  virtual int get_qie_rf_id() const { return _qie_rf_id; }
92  virtual void set_qie_rf_id(const int a) { _qie_rf_id = a; }
93 
94  virtual int get_qie_rf_intensity(const short i) const {
95  if (abs(i)<=16) return _qie_rf_inte[i+16];
96  return INT_MAX;
97  }
98  virtual void set_qie_rf_intensity(const short i, const int a) {
99  if(abs(i)<=16) _qie_rf_inte[i+16] = a;
100  else std::cout<<"SQEvent_v1::set_qie_rf_intensity: abs(i)>16";
101  }
102 
103  virtual short get_flag_v1495() const { return _flag_v1495; }
104  virtual void set_flag_v1495(const short a) { _flag_v1495 = a; }
105 
106  virtual short get_n_board_qie() const { return _n_board_qie; }
107  virtual void set_n_board_qie(const short a) { _n_board_qie = a; }
108 
109  virtual short get_n_board_v1495() const { return _n_board_v1495; }
110  virtual void set_n_board_v1495(const short a) { _n_board_v1495 = a; }
111 
112  virtual short get_n_board_taiwan() const { return _n_board_taiwan; }
113  virtual void set_n_board_taiwan(const short a) { _n_board_taiwan = a; }
114 
115  virtual short get_n_board_trig_bit() const { return _n_board_trig_b; }
116  virtual void set_n_board_trig_bit(const short a) { _n_board_trig_b = a; }
117 
118  virtual short get_n_board_trig_count() const { return _n_board_trig_c; }
119  virtual void set_n_board_trig_count(const short a) { _n_board_trig_c = a; }
120 
121 
122 
123 protected:
124  int _run_id;
128 
129  unsigned short _trigger; //< NIM[1-5], MATRIX[1-5]
130 
131  int _raw_matrix[5];
132 
134 
136 
138 
139  int _qie_presums[4];
143  int _qie_rf_inte[33];
144 
145  short _flag_v1495;
151 
153 };
154 
155 #endif /* _H_SQEvent_v1_H_ */
virtual unsigned short get_trigger() const
Return the full trigger bits.
Definition: SQEvent_v1.h:55
virtual void set_raw_matrix(const unsigned short i, const bool a)
Definition: SQEvent_v1.h:62
virtual short get_n_board_trig_bit() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:115
unsigned short _trigger
Definition: SQEvent_v1.h:129
virtual int get_raw_matrix(const unsigned short i) const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:58
virtual int get_qie_presum(const unsigned short i) const
Return the i-th QIE presum, where i=0...3.
Definition: SQEvent_v1.h:76
virtual void set_after_inh_matrix(const unsigned short i, const bool a)
Definition: SQEvent_v1.h:71
virtual int get_qie_turn_id() const
Return the QIE turn ID.
Definition: SQEvent_v1.h:88
virtual void set_run_id(const int a)
Definition: SQEvent_v1.h:34
virtual void set_n_board_qie(const short a)
Definition: SQEvent_v1.h:107
short _n_board_taiwan
Definition: SQEvent_v1.h:148
virtual void set_qie_trigger_count(const int a)
Definition: SQEvent_v1.h:86
virtual void set_qie_presum(const unsigned short i, const int a)
Definition: SQEvent_v1.h:80
virtual int get_vme_time() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:49
virtual void set_qie_rf_intensity(const short i, const int a)
Definition: SQEvent_v1.h:98
virtual short get_n_board_qie() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:106
short _n_board_v1495
Definition: SQEvent_v1.h:147
int _spill_id
Definition: SQEvent_v1.h:125
virtual void set_trigger(const unsigned short a)
Definition: SQEvent_v1.h:56
short _n_board_qie
Definition: SQEvent_v1.h:146
virtual int get_coda_event_id() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:42
virtual short get_n_board_v1495() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:109
virtual void set_n_board_trig_count(const short a)
Definition: SQEvent_v1.h:119
virtual void set_event_id(const int a)
Definition: SQEvent_v1.h:40
short _flag_v1495
Definition: SQEvent_v1.h:145
virtual void set_vme_time(const int a)
Definition: SQEvent_v1.h:50
SQEvent * Clone() const
Definition: SQEvent_v1.h:31
virtual int get_qie_rf_id() const
Return the QIE RF ID.
Definition: SQEvent_v1.h:91
virtual void set_coda_event_id(const int a)
Definition: SQEvent_v1.h:43
virtual int get_spill_id() const
Return the spill ID.
Definition: SQEvent_v1.h:36
virtual void set_flag_v1495(const short a)
Definition: SQEvent_v1.h:104
ClassDef(SQEvent_v1, 1)
virtual void set_trigger(const SQEvent::TriggerMask i, const bool a)
Definition: SQEvent_v1.h:53
int _event_id
Definition: SQEvent_v1.h:126
virtual void set_n_board_v1495(const short a)
Definition: SQEvent_v1.h:110
virtual bool get_trigger(const SQEvent::TriggerMask i) const
Return the trigger bit (fired or not) of the selected trigger channel.
Definition: SQEvent_v1.h:52
virtual int get_event_id() const
Return the event ID, which is unique per run.
Definition: SQEvent_v1.h:39
int _coda_event_id
Definition: SQEvent_v1.h:127
int _vme_time
Definition: SQEvent_v1.h:137
int _after_inh_matrix[5]
Definition: SQEvent_v1.h:133
virtual int get_qie_trigger_count() const
Return the QIE trigger counts.
Definition: SQEvent_v1.h:85
short _n_board_trig_c
Definition: SQEvent_v1.h:150
virtual short get_n_board_taiwan() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:112
int _qie_trig_cnt
Definition: SQEvent_v1.h:140
int _qie_rf_inte[33]
Definition: SQEvent_v1.h:143
virtual void set_data_quality(const int a)
Definition: SQEvent_v1.h:47
int _qie_rf_id
Definition: SQEvent_v1.h:142
int _qie_turn_id
Definition: SQEvent_v1.h:141
int isValid() const
isValid returns non zero if object contains vailid data
Definition: SQEvent_v1.h:30
void Reset()
Clear Event.
Definition: SQEvent_v1.cxx:44
virtual int get_qie_rf_intensity(const short i) const
Return the i-th QIE RF intensity, where i=-16...+16.
Definition: SQEvent_v1.h:94
virtual void set_spill_id(const int a)
Definition: SQEvent_v1.h:37
virtual void set_qie_rf_id(const int a)
Definition: SQEvent_v1.h:92
int _data_quality
Definition: SQEvent_v1.h:135
int _qie_presums[4]
Definition: SQEvent_v1.h:139
virtual int get_run_id() const
Return the run ID.
Definition: SQEvent_v1.h:33
virtual ~SQEvent_v1()
Definition: SQEvent_v1.cxx:40
int _raw_matrix[5]
Definition: SQEvent_v1.h:131
virtual void set_n_board_taiwan(const short a)
Definition: SQEvent_v1.h:113
virtual int get_data_quality() const
Return the data-quality bits.
Definition: SQEvent_v1.h:46
virtual int get_after_inh_matrix(const unsigned short i) const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:67
virtual void set_qie_turn_id(const int a)
Definition: SQEvent_v1.h:89
virtual short get_n_board_trig_count() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:118
virtual short get_flag_v1495() const
[Obsolete] Use SQHardEvent instead.
Definition: SQEvent_v1.h:103
short _n_board_trig_b
Definition: SQEvent_v1.h:149
virtual void identify(std::ostream &os=std::cout) const
Definition: SQEvent_v1.cxx:68
virtual void set_n_board_trig_bit(const short a)
Definition: SQEvent_v1.h:116
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
TriggerMask
Definition: SQEvent.h:21