Class Reference for E1039 Core & Analysis Software
SQEvent_v2.h
Go to the documentation of this file.
1 #ifndef _H_SQEvent_v2_H_
2 #define _H_SQEvent_v2_H_
3 #include <map>
4 #include <iostream>
5 #include <limits>
6 #include <climits>
7 #include "SQEvent.h"
8 
9 class SQEvent_v2: public SQEvent {
10  int _run_id;
11  int _spill_id;
12  int _event_id;
13  unsigned short _trigger; //< NIM[1-5], MATRIX[1-5]
14  int _data_quality;
15 
16  int _qie_presums[4];
17  int _qie_trig_cnt;
18  int _qie_turn_id;
19  int _qie_rf_id;
20  int _qie_rf_inte[33];
21 
22  public:
24  virtual ~SQEvent_v2();
25 
26  virtual void Reset();
27  virtual void identify(std::ostream& os = std::cout) const;
28  virtual int isValid() const {return 1;}
29  virtual SQEvent* Clone() const {return new SQEvent_v2(*this);}
30 
31  virtual int get_run_id() const {return _run_id;}
32  virtual void set_run_id(const int a) {_run_id = a;}
33 
34  virtual int get_spill_id() const {return _spill_id;}
35  virtual void set_spill_id(const int a) {_spill_id = a;}
36 
37  virtual int get_event_id() const {return _event_id;}
38  virtual void set_event_id(const int a) {_event_id = a;}
39 
40  virtual int get_data_quality() const {return _data_quality;}
41  virtual void set_data_quality(const int a) {_data_quality = a;}
42 
43  virtual bool get_trigger(const SQEvent::TriggerMask i) const {return (_trigger&(1<<i)) > 0 ;}
44  virtual void set_trigger(const SQEvent::TriggerMask i, const bool a) {a ? (_trigger |= (1<<i)) : (_trigger &= ~(1<<i)) ;}
45 
46  virtual unsigned short get_trigger() const {return _trigger;}
47  virtual void set_trigger(const unsigned short a) {_trigger = a;}
48 
49  virtual int get_qie_presum(const unsigned short i) const {
50  if (i<4) return _qie_presums[i];
51  return INT_MAX;
52  }
53  virtual void set_qie_presum(const unsigned short i, const int a) {
54  if(i<4) _qie_presums[i] = a;
55  else std::cout<<"SQEvent_v2::set_qie_presum: i>=4";
56  }
57 
58  virtual int get_qie_trigger_count() const { return _qie_trig_cnt; }
59  virtual void set_qie_trigger_count(const int a) { _qie_trig_cnt = a; }
60 
61  virtual int get_qie_turn_id() const { return _qie_turn_id; }
62  virtual void set_qie_turn_id(const int a) { _qie_turn_id = a; }
63 
64  virtual int get_qie_rf_id() const { return _qie_rf_id; }
65  virtual void set_qie_rf_id(const int a) { _qie_rf_id = a; }
66 
67  virtual int get_qie_rf_intensity(const short i) const {
68  if (abs(i)<=16) return _qie_rf_inte[i+16];
69  return INT_MAX;
70  }
71  virtual void set_qie_rf_intensity(const short i, const int a) {
72  if(abs(i)<=16) _qie_rf_inte[i+16] = a;
73  else std::cout<<"SQEvent_v2::set_qie_rf_intensity: abs(i)>16";
74  }
75 
77 };
78 
79 #endif /* _H_SQEvent_v2_H_ */
virtual void set_qie_trigger_count(const int a)
Definition: SQEvent_v2.h:59
virtual void set_run_id(const int a)
Definition: SQEvent_v2.h:32
virtual void set_qie_presum(const unsigned short i, const int a)
Definition: SQEvent_v2.h:53
virtual bool get_trigger(const SQEvent::TriggerMask i) const
Return the trigger bit (fired or not) of the selected trigger channel.
Definition: SQEvent_v2.h:43
virtual void Reset()
Clear Event.
Definition: SQEvent_v2.cxx:25
virtual void set_qie_rf_intensity(const short i, const int a)
Definition: SQEvent_v2.h:71
virtual int get_spill_id() const
Return the spill ID.
Definition: SQEvent_v2.h:34
virtual void set_qie_rf_id(const int a)
Definition: SQEvent_v2.h:65
ClassDef(SQEvent_v2, 1)
virtual void identify(std::ostream &os=std::cout) const
Definition: SQEvent_v2.cxx:39
virtual ~SQEvent_v2()
Definition: SQEvent_v2.cxx:20
virtual int get_data_quality() const
Return the data-quality bits.
Definition: SQEvent_v2.h:40
virtual int get_qie_rf_id() const
Return the QIE RF ID.
Definition: SQEvent_v2.h:64
virtual void set_event_id(const int a)
Definition: SQEvent_v2.h:38
virtual void set_data_quality(const int a)
Definition: SQEvent_v2.h:41
virtual int get_run_id() const
Return the run ID.
Definition: SQEvent_v2.h:31
virtual int get_qie_rf_intensity(const short i) const
Return the i-th QIE RF intensity, where i=-16...+16.
Definition: SQEvent_v2.h:67
virtual int get_qie_trigger_count() const
Return the QIE trigger counts.
Definition: SQEvent_v2.h:58
virtual int get_event_id() const
Return the event ID, which is unique per run.
Definition: SQEvent_v2.h:37
virtual void set_qie_turn_id(const int a)
Definition: SQEvent_v2.h:62
virtual unsigned short get_trigger() const
Return the full trigger bits.
Definition: SQEvent_v2.h:46
virtual void set_trigger(const unsigned short a)
Definition: SQEvent_v2.h:47
virtual int isValid() const
isValid returns non zero if object contains vailid data
Definition: SQEvent_v2.h:28
virtual void set_spill_id(const int a)
Definition: SQEvent_v2.h:35
virtual int get_qie_presum(const unsigned short i) const
Return the i-th QIE presum, where i=0...3.
Definition: SQEvent_v2.h:49
virtual void set_trigger(const SQEvent::TriggerMask i, const bool a)
Definition: SQEvent_v2.h:44
virtual int get_qie_turn_id() const
Return the QIE turn ID.
Definition: SQEvent_v2.h:61
virtual SQEvent * Clone() const
Definition: SQEvent_v2.h:29
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
TriggerMask
Definition: SQEvent.h:21