1 |
kusanagi |
1.1 |
/** @file |
2 |
kusanagi |
1.2 |
* $Author: kusanagi $ |
3 |
kusanagi |
1.3 |
* $Date: 2004/07/06 13:31:18 $ |
4 |
|
|
* $Revision: 1.2 $ |
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 |
|
|
#include "VarDumpEvent.h" |
16 |
|
|
#include "ArrDumpEvent.h" |
17 |
|
|
#include "TabDumpEvent.h" |
18 |
|
|
|
19 |
|
|
#include "CalibCalEvent.h" |
20 |
kusanagi |
1.3 |
#include "CalibCalPedEvent.h" |
21 |
kusanagi |
1.2 |
#include "CalibTrk1Event.h" |
22 |
|
|
#include "CalibTrk2Event.h" |
23 |
kusanagi |
1.1 |
#include "CalibTrdEvent.h" |
24 |
|
|
#include "CalibTofEvent.h" |
25 |
|
|
#include "CalibS4Event.h" |
26 |
|
|
#include "RunHeaderEvent.h" |
27 |
|
|
#include "RunTrailerEvent.h" |
28 |
|
|
#include "ForcedPktEvent.h" |
29 |
|
|
#include "tmtc/TmtcEvent.h" |
30 |
|
|
#include "mcmd/McmdEvent.h" |
31 |
|
|
#include "log/LogEvent.h" |
32 |
|
|
|
33 |
|
|
#include "physics/TrackerReader.h" |
34 |
|
|
|
35 |
|
|
#define UINT32 unsigned int |
36 |
|
|
#define UINT16 unsigned short |
37 |
|
|
#define BYTE unsigned char |
38 |
|
|
|
39 |
|
|
using namespace std; |
40 |
|
|
|
41 |
|
|
namespace pamela { |
42 |
|
|
namespace techmodel { |
43 |
|
|
/** |
44 |
|
|
* Event reader algorithm for physics events. |
45 |
|
|
*/ |
46 |
|
|
class PhysicsReader: public TechmodelAlgorithm { |
47 |
|
|
private: |
48 |
|
|
/** The reader for tracker physics events. */ |
49 |
|
|
tracker::TrackerReader* trackerReader; |
50 |
|
|
/** The reader for anticoincidence physics events. */ |
51 |
|
|
//anticoinc::AnticounterReader* AcReader; |
52 |
|
|
/** The reader for calorimeter physics events. */ |
53 |
|
|
//calorimeter::CalorimeterReader* CalorimeterReader; |
54 |
|
|
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 |
|
|
CalibCalPedEvent* CalibCalPed; |
203 |
|
|
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 |
|
|
* Event reader algorithm for ForcedPkt events. |
315 |
|
|
*/ |
316 |
|
|
class ForcedPktReader: public TechmodelAlgorithm { |
317 |
|
|
private: |
318 |
|
|
/** The ForcedPkt event that is created in the reader. */ |
319 |
|
|
ForcedPktEvent* ForcedPkt; |
320 |
|
|
public: |
321 |
|
|
ForcedPktReader(void); |
322 |
|
|
virtual void Init(PamelaRun *); |
323 |
|
|
virtual void RunEvent(int, long int); |
324 |
|
|
virtual std::string GetVersionInfo(void) const; |
325 |
|
|
}; |
326 |
|
|
|
327 |
|
|
} |
328 |
|
|
} |
329 |
|
|
|
330 |
|
|
#endif /* READER_ALGORITHM_H */ |
331 |
|
|
|
332 |
|
|
|