Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DecoData.h
Go to the documentation of this file.
1 #ifndef __DECO_DATA_H__
2 #define __DECO_DATA_H__
3 #include <stdio.h>
4 #include <iostream>
5 #include <string.h>
6 #include <string>
7 #include <vector>
8 #include <map>
9 #include <algorithm>
10 #include <TObject.h>
11 
12 /* ================================================================
13  DecoData
14  |
15  +- RunData
16  | +- FeeData
17  | +- Other run variables
18  |
19  |
20  +- map<spill ID, SpillData> = SpillDataMap
21  | +- BOS & EOS spill variables
22  | +- vector<SlowControlData>
23  | +- vector<ScalerData>
24  |
25  |
26  +- map<event ID, EventData> = EventDataMap
27  | +- EventInfo
28  | | +- Trigger & QIE variables
29  | +- vector<HitData> for Taiwan-TDC hits
30  | +- vector<HitData> for v1495-TDC hits
31  | Note: The contents of HitData are useful for now
32  | since SRawEvent cannot hold roc/board/tdc IDs.
33  O
34 
35  Timeline of Coda events
36  |
37  +- BOS
38  |
39  +- EOS
40  | <- Flush events
41  +- Spill Counter <- Flush events
42  | <- Flush events
43  +- Slow Control <- Flush events
44  | <- Flush events
45  + (Next BOS)
46 
47 ================================================================ */
48 
50 //
51 // Run Data
52 //
53 
54 struct FeeData : public TObject {
55  unsigned int roc;
56  unsigned int board;
57  unsigned int hard; // TDCHardID
58  unsigned int falling_enabled;
59  unsigned int segmentation;
60  unsigned int multihit_elim_enabled;
61  unsigned int updating_enabled;
62  unsigned int elim_window;
63  unsigned int lowLimit;
64  unsigned int highLimit;
65  unsigned int selectWindow;
66 
67  FeeData();
68  virtual ~FeeData() {;}
69 };
70 typedef std::vector<FeeData> FeeDataList;
71 
72 struct RunData : public TObject {
73  int run_id;
74  int utime_b;
75  int utime_e; // not implemented
76 
77  int fpga_enabled [5];
78  int nim_enabled [5];
79  int fpga_prescale[5];
80  int nim_prescale[3];
81 
82  int trig_bit[10];
83  int prescale[ 8];
85  std::string run_desc;
86 
90  int n_spill;
91  int n_evt_all; //< N of all real (i.e. triggered) events
92  int n_evt_dec; //< N of decoded real events
93  int n_phys_evt; //< N of Coda physics events
95  int n_flush_evt; //< N of Coda flush events
97  int n_hit; //< N of Taiwan-TDC hits
98  int n_t_hit; //< N of v1495-TDC hits
99  int n_hit_bad; //< N of bad hits
100  int n_t_hit_bad; //< N of bad t-hits. Not implemented
101  int n_v1495; //< N of v1495 events
105 
106  RunData();
107  virtual ~RunData() {;}
108 };
109 
111 //
112 // Spill Data
113 //
114 
116  std::string ts;
117  std::string name;
118  std::string value;
119  std::string type;
120 
121  SlowControlData();
122  virtual ~SlowControlData() {;}
123 };
124 typedef std::vector<SlowControlData> SlowControlDataList;
125 
126 struct ScalerData {
127  short type ;
128  int coda ;
129  short roc ;
130  short board;
131  short chan ;
132  int value;
133  std::string name;
134 
135  ScalerData();
136  virtual ~ScalerData() {;}
137 };
138 typedef std::vector<ScalerData> ScalerDataList;
139 
140 struct SpillData {
141  unsigned int spill_id; //< spill ID in Spill Counter
142  unsigned int spill_id_slow; //< spill ID in slow control
143  unsigned int run_id;
144  unsigned int targ_pos;
145  unsigned int bos_coda_id;
146  unsigned int bos_vme_time;
147  unsigned int eos_coda_id;
148  unsigned int eos_vme_time;
149 
150  unsigned int n_bos_spill;
151  unsigned int n_eos_spill;
152  unsigned int n_slow;
153  unsigned int n_scaler;
154 
157 
158  SpillData();
159  virtual ~SpillData() {;}
160 };
161 typedef std::map<unsigned int, SpillData> SpillDataMap;
162 
164 //
165 // Event-by-event data
166 //
167 struct HitData {
168  int event;
169  int id;
170  short roc;
171  short board;
172  short chan;
173  short det;
174  short ele;
175  short lvl;
176  double time;
177  HitData();
178  virtual ~HitData() {;}
179 };
180 typedef std::vector<HitData> HitDataList;
181 
182 struct EventInfo {
183  int eventID;
185  int runID;
186  int spillID;
188  int vmeTime;
189  int RawMATRIX[5];
191  int NIM[5];
192  int MATRIX[5];
194  unsigned int sums[4];
195  unsigned int triggerCount;
196  unsigned int turnOnset;
197  unsigned int rfOnset;
198  unsigned int rf[33];
199  short flag_v1495;
200 
201  EventInfo();
203 };
204 
205 struct EventData {
206  unsigned int n_qie;
207  unsigned int n_v1495;
208  unsigned int n_tdc;
209  unsigned int n_trig_b;
210  unsigned int n_trig_c;
211 
215 
216  EventData();
218 };
219 typedef std::map<unsigned int, EventData> EventDataMap;
220 
221 #endif // __DECO_DATA_H__
virtual ~HitData()
Definition: DecoData.h:178
unsigned int selectWindow
Definition: DecoData.h:65
virtual ~RunData()
Definition: DecoData.h:107
int n_phys_evt
Definition: DecoData.h:93
int n_v1495_d3ad
Definition: DecoData.h:104
SlowControlDataList list_slow_cont
Definition: DecoData.h:155
HitData()
Definition: DecoData.cc:70
FeeDataList fee
Definition: DecoData.h:84
int utime_e
Definition: DecoData.h:75
std::map< unsigned int, SpillData > SpillDataMap
Definition: DecoData.h:161
int n_v1495
Definition: DecoData.h:101
unsigned int roc
Definition: DecoData.h:55
int vmeTime
Definition: DecoData.h:188
int utime_b
Definition: DecoData.h:74
unsigned int board
Definition: DecoData.h:56
short chan
Definition: DecoData.h:131
int n_v1495_d1ad
Definition: DecoData.h:102
std::vector< FeeData > FeeDataList
Definition: DecoData.h:70
int spillID
Definition: DecoData.h:186
unsigned int hard
Definition: DecoData.h:57
unsigned int bos_coda_id
Definition: DecoData.h:145
int fpga_prescale[5]
Definition: DecoData.h:79
int n_hit
Definition: DecoData.h:97
int n_spill
Definition: DecoData.h:90
int n_evt_dec
Definition: DecoData.h:92
int n_hit_bad
Definition: DecoData.h:99
std::vector< ScalerData > ScalerDataList
Definition: DecoData.h:138
std::vector< SlowControlData > SlowControlDataList
Definition: DecoData.h:124
unsigned int multihit_elim_enabled
Definition: DecoData.h:60
short ele
Definition: DecoData.h:174
std::map< unsigned int, EventData > EventDataMap
Definition: DecoData.h:219
unsigned int targ_pos
Definition: DecoData.h:144
int n_evt_all
Definition: DecoData.h:91
unsigned int n_eos_spill
Definition: DecoData.h:151
int n_t_hit
Definition: DecoData.h:98
unsigned int n_trig_c
Definition: DecoData.h:210
unsigned int segmentation
Definition: DecoData.h:59
virtual ~ScalerData()
Definition: DecoData.h:136
ScalerData()
Definition: DecoData.cc:51
int eventID
Definition: DecoData.h:183
int prescale[8]
Definition: DecoData.h:83
int runID
Definition: DecoData.h:185
std::string name
Definition: DecoData.h:133
int AfterInhMATRIX[5]
Definition: DecoData.h:190
virtual ~SpillData()
Definition: DecoData.h:159
int value
Definition: DecoData.h:132
unsigned int spill_id_slow
Definition: DecoData.h:142
int event
Definition: DecoData.h:168
int n_phys_evt_bad
Definition: DecoData.h:94
int RawMATRIX[5]
Definition: DecoData.h:189
short board
Definition: DecoData.h:171
std::string type
Definition: DecoData.h:119
int trigger_bits
Definition: DecoData.h:193
short flag_v1495
Definition: DecoData.h:199
unsigned int n_qie
Definition: DecoData.h:206
unsigned int falling_enabled
Definition: DecoData.h:58
unsigned int eos_vme_time
Definition: DecoData.h:148
unsigned int n_bos_spill
Definition: DecoData.h:150
int n_fee_event
Definition: DecoData.h:87
unsigned int rf[33]
Definition: DecoData.h:198
int codaEventID
Definition: DecoData.h:184
double time
Definition: DecoData.h:176
short roc
Definition: DecoData.h:170
ScalerDataList list_scaler
Definition: DecoData.h:156
SpillData()
Definition: DecoData.cc:57
EventInfo event
Definition: DecoData.h:212
int coda
Definition: DecoData.h:128
~EventData()
Definition: DecoData.h:217
short type
Definition: DecoData.h:127
std::string value
Definition: DecoData.h:118
unsigned int n_v1495
Definition: DecoData.h:207
unsigned int n_slow
Definition: DecoData.h:152
int n_fee_prescale
Definition: DecoData.h:88
unsigned int highLimit
Definition: DecoData.h:64
EventData()
Definition: DecoData.cc:89
int fpga_enabled[5]
Definition: DecoData.h:77
EventInfo()
Definition: DecoData.cc:76
unsigned int updating_enabled
Definition: DecoData.h:61
short lvl
Definition: DecoData.h:175
FeeData()
Definition: DecoData.cc:14
int n_flush_evt_bad
Definition: DecoData.h:96
short chan
Definition: DecoData.h:172
short det
Definition: DecoData.h:173
unsigned int lowLimit
Definition: DecoData.h:63
int n_flush_evt
Definition: DecoData.h:95
unsigned int rfOnset
Definition: DecoData.h:197
std::string name
Definition: DecoData.h:117
HitDataList list_hit_trig
Definition: DecoData.h:214
int nim_prescale[3]
Definition: DecoData.h:80
std::vector< HitData > HitDataList
Definition: DecoData.h:180
~EventInfo()
Definition: DecoData.h:202
int n_t_hit_bad
Definition: DecoData.h:100
int NIM[5]
Definition: DecoData.h:191
int nim_enabled[5]
Definition: DecoData.h:78
int id
Definition: DecoData.h:169
int trig_bit[10]
Definition: DecoData.h:82
unsigned int elim_window
Definition: DecoData.h:62
short board
Definition: DecoData.h:130
int dataQuality
Definition: DecoData.h:187
unsigned int n_tdc
Definition: DecoData.h:208
unsigned int spill_id
Definition: DecoData.h:141
short roc
Definition: DecoData.h:129
unsigned int run_id
Definition: DecoData.h:143
std::string run_desc
Definition: DecoData.h:85
virtual ~SlowControlData()
Definition: DecoData.h:122
virtual ~FeeData()
Definition: DecoData.h:68
int run_id
Definition: DecoData.h:73
int n_v1495_d2ad
Definition: DecoData.h:103
RunData()
Definition: DecoData.cc:22
std::string ts
Definition: DecoData.h:116
int MATRIX[5]
Definition: DecoData.h:192
unsigned int n_trig_b
Definition: DecoData.h:209
int n_run_desc
Definition: DecoData.h:89
HitDataList list_hit
Definition: DecoData.h:213
unsigned int triggerCount
Definition: DecoData.h:195
unsigned int bos_vme_time
Definition: DecoData.h:146
unsigned int sums[4]
Definition: DecoData.h:194
unsigned int n_scaler
Definition: DecoData.h:153
unsigned int turnOnset
Definition: DecoData.h:196
unsigned int eos_coda_id
Definition: DecoData.h:147