1 |
kusanagi |
1.1 |
/** @file |
2 |
kusanagi |
1.2 |
* $Author: kusanagi $ |
3 |
kusanagi |
1.6 |
* $Date: 2004/07/17 20:03:38 $ |
4 |
|
|
* $Revision: 1.5 $ |
5 |
kusanagi |
1.1 |
* |
6 |
|
|
* Header file for the algorithms used to read the techmodel data file. |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
#ifndef READER_ALGORITHM_H |
10 |
|
|
#define READER_ALGORITHM_H |
11 |
|
|
|
12 |
|
|
#include "TechmodelAlgorithm.h" |
13 |
|
|
#include "PscuEvent.h" |
14 |
|
|
|
15 |
kusanagi |
1.4 |
#include "varDump/VarDumpEvent.h" |
16 |
|
|
#include "arrDump/ArrDumpEvent.h" |
17 |
|
|
#include "tabDump/TabDumpEvent.h" |
18 |
kusanagi |
1.1 |
|
19 |
|
|
#include "CalibCalEvent.h" |
20 |
kusanagi |
1.3 |
#include "CalibCalPedEvent.h" |
21 |
kusanagi |
1.4 |
#include "CalibAcEvent.h" |
22 |
kusanagi |
1.2 |
#include "CalibTrk1Event.h" |
23 |
|
|
#include "CalibTrk2Event.h" |
24 |
kusanagi |
1.1 |
#include "CalibTrdEvent.h" |
25 |
|
|
#include "CalibTofEvent.h" |
26 |
|
|
#include "CalibS4Event.h" |
27 |
|
|
#include "RunHeaderEvent.h" |
28 |
|
|
#include "RunTrailerEvent.h" |
29 |
|
|
#include "tmtc/TmtcEvent.h" |
30 |
|
|
#include "mcmd/McmdEvent.h" |
31 |
|
|
#include "log/LogEvent.h" |
32 |
|
|
|
33 |
|
|
#include "physics/TrackerReader.h" |
34 |
kusanagi |
1.5 |
#include "physics/AnticounterReader.h" |
35 |
|
|
#include "physics/CalorimeterReader.h" |
36 |
kusanagi |
1.1 |
|
37 |
|
|
#define UINT32 unsigned int |
38 |
|
|
#define UINT16 unsigned short |
39 |
|
|
#define BYTE unsigned char |
40 |
|
|
|
41 |
|
|
using namespace std; |
42 |
|
|
|
43 |
|
|
namespace pamela { |
44 |
|
|
namespace techmodel { |
45 |
|
|
/** |
46 |
|
|
* Event reader algorithm for physics events. |
47 |
|
|
*/ |
48 |
|
|
class PhysicsReader: public TechmodelAlgorithm { |
49 |
|
|
private: |
50 |
|
|
/** The reader for tracker physics events. */ |
51 |
kusanagi |
1.5 |
tracker::TrackerReader* trackerReader; |
52 |
|
|
anticounter::AnticounterReader* anticounterReader; |
53 |
|
|
calorimeter::CalorimeterReader* calorimeterReader; |
54 |
kusanagi |
1.1 |
public: |
55 |
|
|
PhysicsReader(void); |
56 |
|
|
virtual void Init(PamelaRun *); |
57 |
|
|
virtual void RunEvent(int, long int); |
58 |
|
|
virtual std::string GetVersionInfo(void) const; |
59 |
|
|
}; |
60 |
|
|
|
61 |
|
|
/** |
62 |
|
|
* Event reader algorithm for housekeeping events. |
63 |
|
|
*/ |
64 |
|
|
/* |
65 |
|
|
class HousekeepingReader: public TechmodelAlgorithm { |
66 |
|
|
private: |
67 |
|
|
public: |
68 |
|
|
HousekeepingReader(void); |
69 |
|
|
virtual void Init(PamelaRun *); |
70 |
|
|
virtual void RunEvent(int); |
71 |
|
|
virtual string GetVersionInfo(void) const; |
72 |
|
|
}; |
73 |
|
|
*/ |
74 |
|
|
|
75 |
|
|
|
76 |
|
|
/** |
77 |
|
|
* Event reader algorithm for TMTC events. |
78 |
|
|
*/ |
79 |
|
|
class TmtcReader: public TechmodelAlgorithm { |
80 |
|
|
//Length in bytes of the subPacket (that is te TmtcRecord excluded subCRC) |
81 |
|
|
static const int TMTC_SUB_LENGTH = 57; |
82 |
|
|
//Length in bytes of the subPacketCRC |
83 |
|
|
static const int TMTC_SUBCRC_LENGTH = 1; |
84 |
|
|
//Length in bytes of the PacketCRC |
85 |
|
|
static const int TMTC_CRC_LENGTH = 2; |
86 |
|
|
private: |
87 |
|
|
/** The TMTC event that is created in the reader. */ |
88 |
|
|
TmtcEvent* Tmtc; |
89 |
|
|
float convert_th(int); |
90 |
|
|
public: |
91 |
|
|
TmtcReader(void); |
92 |
|
|
virtual void Init(PamelaRun *); |
93 |
|
|
virtual void RunEvent(int, long int); |
94 |
|
|
virtual string GetVersionInfo(void) const; |
95 |
|
|
}; |
96 |
|
|
|
97 |
|
|
|
98 |
|
|
/** |
99 |
|
|
* Event reader algorithm for PSCU events. |
100 |
|
|
*/ |
101 |
|
|
class PscuReader: public TechmodelAlgorithm { |
102 |
|
|
private: |
103 |
|
|
/** The PSCU event that is created in the reader. */ |
104 |
|
|
PscuEvent* Pscu; |
105 |
|
|
public: |
106 |
|
|
PscuReader(void); |
107 |
|
|
virtual void Init(PamelaRun *); |
108 |
|
|
virtual void RunEvent(int, long int); |
109 |
|
|
virtual std::string GetVersionInfo(void) const; |
110 |
|
|
}; |
111 |
|
|
|
112 |
|
|
/** |
113 |
|
|
* Event reader algorithm for VarDump events. |
114 |
|
|
*/ |
115 |
|
|
class VarDumpReader: public TechmodelAlgorithm { |
116 |
|
|
private: |
117 |
|
|
/** The VarDump event that is created in the reader. */ |
118 |
|
|
VarDumpEvent* VarDump; |
119 |
|
|
public: |
120 |
|
|
VarDumpReader(void); |
121 |
|
|
virtual void Init(PamelaRun *); |
122 |
|
|
virtual void RunEvent(int, long int); |
123 |
|
|
virtual std::string GetVersionInfo(void) const; |
124 |
|
|
}; |
125 |
|
|
|
126 |
|
|
/** |
127 |
|
|
* Event reader algorithm for ArrDump events. |
128 |
|
|
*/ |
129 |
|
|
class ArrDumpReader: public TechmodelAlgorithm { |
130 |
|
|
private: |
131 |
|
|
/** The ArrDump event that is created in the reader. */ |
132 |
|
|
ArrDumpEvent* ArrDump; |
133 |
|
|
public: |
134 |
|
|
ArrDumpReader(void); |
135 |
|
|
virtual void Init(PamelaRun *); |
136 |
|
|
virtual void RunEvent(int, long int); |
137 |
|
|
virtual std::string GetVersionInfo(void) const; |
138 |
|
|
}; |
139 |
|
|
|
140 |
|
|
/** |
141 |
|
|
* Event reader algorithm for TabDump events. |
142 |
|
|
*/ |
143 |
|
|
class TabDumpReader: public TechmodelAlgorithm { |
144 |
|
|
private: |
145 |
|
|
/** The TabDump event that is created in the reader. */ |
146 |
|
|
TabDumpEvent* TabDump; |
147 |
|
|
public: |
148 |
|
|
TabDumpReader(void); |
149 |
|
|
virtual void Init(PamelaRun *); |
150 |
|
|
virtual void RunEvent(int, long int); |
151 |
|
|
virtual std::string GetVersionInfo(void) const; |
152 |
|
|
}; |
153 |
|
|
|
154 |
|
|
/** |
155 |
|
|
* Event reader algorithm for Mcmd events. |
156 |
|
|
*/ |
157 |
|
|
class McmdReader: public TechmodelAlgorithm { |
158 |
|
|
private: |
159 |
|
|
/** The Mcmd event that is created in the reader. */ |
160 |
|
|
McmdEvent* Mcmd; |
161 |
|
|
public: |
162 |
|
|
McmdReader(void); |
163 |
|
|
virtual void Init(PamelaRun *); |
164 |
|
|
virtual void RunEvent(int, long int); |
165 |
|
|
virtual std::string GetVersionInfo(void) const; |
166 |
|
|
}; |
167 |
|
|
|
168 |
|
|
/** |
169 |
|
|
* Event reader algorithm for Log events. |
170 |
|
|
*/ |
171 |
|
|
class LogReader: public TechmodelAlgorithm { |
172 |
|
|
private: |
173 |
|
|
/** The Log event that is created in the reader. */ |
174 |
|
|
LogEvent* Log; |
175 |
|
|
public: |
176 |
|
|
LogReader(void); |
177 |
|
|
virtual void Init(PamelaRun *); |
178 |
|
|
virtual void RunEvent(int, long int); |
179 |
|
|
virtual std::string GetVersionInfo(void) const; |
180 |
|
|
}; |
181 |
|
|
|
182 |
|
|
/** |
183 |
|
|
* Event reader algorithm for CalibCal events. |
184 |
|
|
*/ |
185 |
|
|
class CalibCalReader: public TechmodelAlgorithm { |
186 |
|
|
private: |
187 |
|
|
/** The CalibCal event that is created in the reader. */ |
188 |
|
|
CalibCalEvent* CalibCal; |
189 |
|
|
public: |
190 |
|
|
CalibCalReader(void); |
191 |
|
|
virtual void Init(PamelaRun *); |
192 |
|
|
virtual void RunEvent(int, long int); |
193 |
|
|
virtual std::string GetVersionInfo(void) const; |
194 |
|
|
}; |
195 |
|
|
|
196 |
|
|
/** |
197 |
kusanagi |
1.3 |
* Event reader algorithm for CalibCalPed events. |
198 |
|
|
*/ |
199 |
|
|
class CalibCalPedReader: public TechmodelAlgorithm { |
200 |
|
|
private: |
201 |
|
|
/** The CalibCalPed event that is created in the reader. */ |
202 |
kusanagi |
1.5 |
CalibCalPedEvent* calibCalPed; |
203 |
kusanagi |
1.3 |
public: |
204 |
|
|
CalibCalPedReader(void); |
205 |
|
|
virtual void Init(PamelaRun *); |
206 |
|
|
virtual void RunEvent(int, long int); |
207 |
|
|
virtual std::string GetVersionInfo(void) const; |
208 |
|
|
}; |
209 |
|
|
|
210 |
|
|
|
211 |
|
|
/** |
212 |
kusanagi |
1.2 |
* Event reader algorithm for CalibTrk1 events. |
213 |
kusanagi |
1.1 |
*/ |
214 |
kusanagi |
1.2 |
class CalibTrk1Reader: public TechmodelAlgorithm { |
215 |
kusanagi |
1.1 |
private: |
216 |
kusanagi |
1.2 |
/** The CalibTrk1 event that is created in the reader. */ |
217 |
|
|
CalibTrk1Event* calibTrk1; |
218 |
kusanagi |
1.1 |
public: |
219 |
kusanagi |
1.2 |
CalibTrk1Reader(void); |
220 |
kusanagi |
1.1 |
virtual void Init(PamelaRun *); |
221 |
|
|
virtual void RunEvent(int, long int); |
222 |
|
|
//this type of RUNEvent should be the future develop. |
223 |
|
|
//Pass the buffer not the pointer to file |
224 |
|
|
//virtual void RunEvent(int, long int, char[]); |
225 |
|
|
virtual std::string GetVersionInfo(void) const; |
226 |
|
|
}; |
227 |
|
|
|
228 |
|
|
/** |
229 |
kusanagi |
1.2 |
* Event reader algorithm for CalibTrk2 events. |
230 |
kusanagi |
1.1 |
*/ |
231 |
kusanagi |
1.2 |
class CalibTrk2Reader: public TechmodelAlgorithm { |
232 |
kusanagi |
1.1 |
private: |
233 |
kusanagi |
1.2 |
/** The CalibTrk2 event that is created in the reader. */ |
234 |
|
|
CalibTrk2Event* calibTrk2; |
235 |
kusanagi |
1.1 |
public: |
236 |
kusanagi |
1.2 |
CalibTrk2Reader(void); |
237 |
kusanagi |
1.1 |
virtual void Init(PamelaRun *); |
238 |
|
|
virtual void RunEvent(int, long int); |
239 |
|
|
virtual std::string GetVersionInfo(void) const; |
240 |
|
|
}; |
241 |
|
|
|
242 |
|
|
/** |
243 |
|
|
* Event reader algorithm for CalibTrd events. |
244 |
|
|
*/ |
245 |
|
|
class CalibTrdReader: public TechmodelAlgorithm { |
246 |
|
|
private: |
247 |
|
|
/** The CalibTrd event that is created in the reader. */ |
248 |
|
|
CalibTrdEvent* CalibTrd; |
249 |
|
|
public: |
250 |
|
|
CalibTrdReader(void); |
251 |
|
|
virtual void Init(PamelaRun *); |
252 |
|
|
virtual void RunEvent(int, long int); |
253 |
|
|
virtual std::string GetVersionInfo(void) const; |
254 |
|
|
}; |
255 |
|
|
|
256 |
|
|
/** |
257 |
|
|
* Event reader algorithm for CalibTof events. |
258 |
|
|
*/ |
259 |
|
|
class CalibTofReader: public TechmodelAlgorithm { |
260 |
|
|
private: |
261 |
|
|
/** The CalibTof event that is created in the reader. */ |
262 |
|
|
CalibTofEvent* CalibTof; |
263 |
|
|
public: |
264 |
|
|
CalibTofReader(void); |
265 |
|
|
virtual void Init(PamelaRun *); |
266 |
|
|
virtual void RunEvent(int, long int); |
267 |
|
|
virtual std::string GetVersionInfo(void) const; |
268 |
|
|
}; |
269 |
|
|
|
270 |
|
|
/** |
271 |
|
|
* Event reader algorithm for CalibS4 events. |
272 |
|
|
*/ |
273 |
|
|
class CalibS4Reader: public TechmodelAlgorithm { |
274 |
|
|
private: |
275 |
|
|
/** The CalibCal event that is created in the reader. */ |
276 |
|
|
CalibS4Event* CalibS4; |
277 |
|
|
public: |
278 |
|
|
CalibS4Reader(void); |
279 |
|
|
virtual void Init(PamelaRun *); |
280 |
|
|
virtual void RunEvent(int, long int); |
281 |
|
|
virtual std::string GetVersionInfo(void) const; |
282 |
|
|
}; |
283 |
|
|
|
284 |
|
|
|
285 |
|
|
/** |
286 |
|
|
* Event reader algorithm for RunTrailer events. |
287 |
|
|
*/ |
288 |
|
|
class RunTrailerReader: public TechmodelAlgorithm { |
289 |
|
|
private: |
290 |
|
|
/** The RunTrailer event that is created in the reader. */ |
291 |
|
|
RunTrailerEvent* RunTrailer; |
292 |
|
|
public: |
293 |
|
|
RunTrailerReader(void); |
294 |
|
|
virtual void Init(PamelaRun *); |
295 |
|
|
virtual void RunEvent(int, long int); |
296 |
|
|
virtual std::string GetVersionInfo(void) const; |
297 |
|
|
}; |
298 |
|
|
|
299 |
|
|
/** |
300 |
|
|
* Event reader algorithm for RunHeader events. |
301 |
|
|
*/ |
302 |
|
|
class RunHeaderReader: public TechmodelAlgorithm { |
303 |
|
|
private: |
304 |
|
|
/** The RunHeader event that is created in the reader. */ |
305 |
|
|
RunHeaderEvent* RunHeader; |
306 |
|
|
public: |
307 |
|
|
RunHeaderReader(void); |
308 |
|
|
virtual void Init(PamelaRun *); |
309 |
|
|
virtual void RunEvent(int, long int); |
310 |
|
|
virtual std::string GetVersionInfo(void) const; |
311 |
|
|
}; |
312 |
|
|
|
313 |
|
|
|
314 |
kusanagi |
1.4 |
/** |
315 |
|
|
* Event reader algorithm for ForcedPkt events. |
316 |
|
|
*/ |
317 |
|
|
class CalibAcReader: public TechmodelAlgorithm { |
318 |
|
|
private: |
319 |
|
|
/** The CalibAc event that is created in the reader. */ |
320 |
|
|
CalibAcEvent* CalibAc; |
321 |
|
|
public: |
322 |
|
|
CalibAcReader(void); |
323 |
|
|
virtual void Init(PamelaRun *); |
324 |
|
|
virtual void RunEvent(int, long int); |
325 |
|
|
virtual std::string GetVersionInfo(void) const; |
326 |
|
|
}; |
327 |
kusanagi |
1.1 |
} |
328 |
|
|
} |
329 |
|
|
|
330 |
|
|
#endif /* READER_ALGORITHM_H */ |
331 |
|
|
|
332 |
|
|
|