/[PAMELA software]/yoda/techmodel/ReaderAlgorithms.h
ViewVC logotype

Contents of /yoda/techmodel/ReaderAlgorithms.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2.2 - (show annotations) (download)
Fri Dec 3 22:08:01 2004 UTC (20 years, 2 months ago) by kusanagi
Branch: MAIN
Changes since 2.1: +42 -48 lines
File MIME type: text/plain
Finally added a real group of Exception classes
Re-strucuted all the log systems (for better performances on unpacking)
Minor changes following the packets changes

1 /** @file
2 * $Author: kusanagi $
3 * $Date: 2004/09/24 11:57:49 $
4 * $Revision: 2.1 $
5 *
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
16 #include "PhysEndRunEvent.h"
17 #include "CalibCalPulse1Event.h"
18 #include "CalibCalPulse2Event.h"
19 #include "physics/TrackerReader.h"
20 #include "physics/AnticounterReader.h"
21 #include "physics/CalorimeterReader.h"
22 #include "physics/NeutronDetectorReader.h"
23 #include "CalibTrkBothEvent.h"
24 #include "CalibTrk1Event.h"
25 #include "CalibTrk2Event.h"
26 #include "CalibTrdEvent.h"
27 #include "CalibTofEvent.h"
28 #include "CalibS4Event.h"
29 #include "CalibCalPedEvent.h"
30 #include "CalibAcEvent.h"
31 #include "RunHeaderEvent.h"
32 #include "RunTrailerEvent.h"
33 #include "CalibHeaderEvent.h"
34 #include "CalibTrailerEvent.h"
35 #include "InitHeaderEvent.h"
36 #include "InitTrailerEvent.h"
37 #include "EventTrkEvent.h"
38 #include "TestTrkEvent.h"
39 #include "TestTofEvent.h"
40 #include "log/LogEvent.h"
41 #include "varDump/VarDumpEvent.h"
42 #include "arrDump/ArrDumpEvent.h"
43 #include "tabDump/TabDumpEvent.h"
44 #include "tmtc/TmtcEvent.h"
45 #include "mcmd/McmdEvent.h"
46 #include "ForcedFECmdEvent.h"
47 #include "AcInitEvent.h"
48 #include "CalInitEvent.h"
49 #include "TrkInitEvent.h"
50 #include "TofInitEvent.h"
51 #include "TrgInitEvent.h"
52 #include "NdInitEvent.h"
53 #include "CalAlarmEvent.h"
54 #include "AcAlarmEvent.h"
55 #include "TrkAlarmEvent.h"
56 #include "TrgAlarmEvent.h"
57 #include "TofAlarmEvent.h"
58
59 using namespace std;
60
61 namespace pamela {
62 namespace techmodel {
63
64 /**********************************************
65 * Event reader algorithm for PhysEndRun events.
66 **********************************************/
67 class PhysEndRunReader: public TechmodelAlgorithm {
68 private:
69 /** The PhysEndRun event that is created in the reader. */
70 PhysEndRunEvent* physEndRun;
71 public:
72 PhysEndRunReader(void);
73 virtual void Init(PamelaRun *);
74 virtual void RunEvent(int, long int) throw (WrongCRCException);
75 //this type of RUNEvent should be the future develop.
76 //Pass the buffer not the pointer to file
77 //virtual void RunEvent(int, long int, char[]);
78 virtual std::string GetVersionInfo(void) const;
79 };
80
81
82 /**********************************************
83 * Event reader algorithm for CalibCalPulse1 events.
84 **********************************************/
85 class CalibCalPulse1Reader: public TechmodelAlgorithm {
86 private:
87 /** The CalibCalPulse1 event that is created in the reader. */
88 CalibCalPulse1Event* calibCalPulse1;
89 public:
90 CalibCalPulse1Reader(void);
91 virtual void Init(PamelaRun *);
92 virtual void RunEvent(int, long int) throw (Exception);
93 //this type of RUNEvent should be the future develop.
94 //Pass the buffer not the pointer to file
95 //virtual void RunEvent(int, long int, char[]);
96 virtual std::string GetVersionInfo(void) const;
97 };
98
99
100 /**********************************************
101 * Event reader algorithm for CalibCalPulse2 events.
102 **********************************************/
103 class CalibCalPulse2Reader: public TechmodelAlgorithm {
104 private:
105 /** The CalibCalPulse2 event that is created in the reader. */
106 CalibCalPulse2Event* calibCalPulse2;
107 public:
108 CalibCalPulse2Reader(void);
109 virtual void Init(PamelaRun *);
110 virtual void RunEvent(int, long int) throw (Exception);
111 //this type of RUNEvent should be the future develop.
112 //Pass the buffer not the pointer to file
113 //virtual void RunEvent(int, long int, char[]);
114 virtual std::string GetVersionInfo(void) const;
115 };
116
117
118 /**********************************************
119 * Event reader algorithm for physics events.
120 **********************************************/
121 class PhysicsReader: public TechmodelAlgorithm {
122 private:
123 /** The reader for tracker physics events. */
124 tracker::TrackerReader* trackerReader;
125 anticounter::AnticounterReader* anticounterReader;
126 calorimeter::CalorimeterReader* calorimeterReader;
127 neutron::NeutronDetectorReader* neutronReader;
128 public:
129 PhysicsReader(void);
130 virtual void Init(PamelaRun *);
131 virtual void RunEvent(int, long int) throw (Exception);
132 virtual std::string GetVersionInfo(void) const;
133 };
134
135
136 /**********************************************
137 * Event reader algorithm for CalibTrkBoth events.
138 **********************************************/
139 class CalibTrkBothReader: public TechmodelAlgorithm {
140 private:
141 /** The CalibTrkBoth event that is created in the reader. */
142 CalibTrkBothEvent* calibTrkBoth;
143 public:
144 CalibTrkBothReader(void);
145 virtual void Init(PamelaRun *);
146 virtual void RunEvent(int, long int) throw (Exception);
147 //this type of RUNEvent should be the future develop.
148 //Pass the buffer not the pointer to file
149 //virtual void RunEvent(int, long int, char[]);
150 virtual std::string GetVersionInfo(void) const;
151 };
152
153
154 /**********************************************
155 * Event reader algorithm for CalibTrk1 events.
156 **********************************************/
157 class CalibTrk1Reader: public TechmodelAlgorithm {
158 private:
159 /** The CalibTrk1 event that is created in the reader. */
160 CalibTrk1Event* calibTrk1;
161 public:
162 CalibTrk1Reader(void);
163 virtual void Init(PamelaRun *);
164 virtual void RunEvent(int, long int) throw (Exception);
165 //this type of RUNEvent should be the future develop.
166 //Pass the buffer not the pointer to file
167 //virtual void RunEvent(int, long int, char[]);
168 virtual std::string GetVersionInfo(void) const;
169 };
170
171
172 /**********************************************
173 * Event reader algorithm for CalibTrk2 events.
174 **********************************************/
175 class CalibTrk2Reader: public TechmodelAlgorithm {
176 private:
177 /** The CalibTrk2 event that is created in the reader. */
178 CalibTrk2Event* calibTrk2;
179 public:
180 CalibTrk2Reader(void);
181 virtual void Init(PamelaRun *);
182 virtual void RunEvent(int, long int) throw (Exception);
183 virtual std::string GetVersionInfo(void) const;
184 };
185
186
187 /**********************************************
188 * Event reader algorithm for CalibTrd events.
189 **********************************************/
190 class CalibTrdReader: public TechmodelAlgorithm {
191 private:
192 /** The CalibTrd event that is created in the reader. */
193 CalibTrdEvent* calibTrd;
194 public:
195 CalibTrdReader(void);
196 virtual void Init(PamelaRun *);
197 virtual void RunEvent(int, long int) throw (Exception);
198 virtual std::string GetVersionInfo(void) const;
199 };
200
201
202 /**********************************************
203 * Event reader algorithm for CalibTof events.
204 **********************************************/
205 class CalibTofReader: public TechmodelAlgorithm {
206 private:
207 /** The CalibTof event that is created in the reader. */
208 CalibTofEvent* CalibTof;
209 public:
210 CalibTofReader(void);
211 virtual void Init(PamelaRun *);
212 virtual void RunEvent(int, long int) throw (Exception);
213 virtual std::string GetVersionInfo(void) const;
214 };
215
216
217 /**********************************************
218 * Event reader algorithm for CalibS4 events.
219 **********************************************/
220 class CalibS4Reader: public TechmodelAlgorithm {
221 private:
222 /** The CalibCal event that is created in the reader. */
223 CalibS4Event* CalibS4;
224 public:
225 CalibS4Reader(void);
226 virtual void Init(PamelaRun *);
227 virtual void RunEvent(int, long int) throw (Exception);
228 virtual std::string GetVersionInfo(void) const;
229 };
230
231
232 /**********************************************
233 * Event reader algorithm for CalibCalPed events.
234 **********************************************/
235 class CalibCalPedReader: public TechmodelAlgorithm {
236 private:
237 /** The CalibCalPed event that is created in the reader. */
238 CalibCalPedEvent* calibCalPed;
239 public:
240 CalibCalPedReader(void);
241 virtual void Init(PamelaRun *);
242 virtual void RunEvent(int, long int) throw (Exception);
243 virtual std::string GetVersionInfo(void) const;
244 };
245
246
247 /***********************************************
248 * Event reader algorithm for CalibAc events.
249 **********************************************/
250 class CalibAcReader: public TechmodelAlgorithm {
251 private:
252 /** The CalibAc event that is created in the reader. */
253 CalibAcEvent* CalibAc;
254 public:
255 CalibAcReader(void);
256 virtual void Init(PamelaRun *);
257 virtual void RunEvent(int, long int) throw (Exception);
258 virtual std::string GetVersionInfo(void) const;
259 };
260
261
262 /**********************************************
263 * Event reader algorithm for RunHeader events.
264 **********************************************/
265 class RunHeaderReader: public TechmodelAlgorithm {
266 private:
267 /** The RunHeader event that is created in the reader. */
268 RunHeaderEvent* RunHeader;
269 public:
270 RunHeaderReader(void);
271 virtual void Init(PamelaRun *);
272 virtual void RunEvent(int, long int) throw (WrongCRCException);
273 virtual std::string GetVersionInfo(void) const;
274 };
275
276
277 /**********************************************
278 * Event reader algorithm for RunTrailer events.
279 **********************************************/
280 class RunTrailerReader: public TechmodelAlgorithm {
281 private:
282 /** The RunTrailer event that is created in the reader. */
283 RunTrailerEvent* RunTrailer;
284 public:
285 RunTrailerReader(void);
286 virtual void Init(PamelaRun *);
287 virtual void RunEvent(int, long int) throw (WrongCRCException);
288 virtual std::string GetVersionInfo(void) const;
289 };
290
291
292 /**********************************************
293 * Event reader algorithm for CalibHeader events.
294 **********************************************/
295 class CalibHeaderReader: public TechmodelAlgorithm {
296 private:
297 /** The CalibHeader event that is created in the reader. */
298 CalibHeaderEvent* calibHeader;
299 public:
300 CalibHeaderReader(void);
301 virtual void Init(PamelaRun *);
302 virtual void RunEvent(int, long int) throw (WrongCRCException);
303 virtual std::string GetVersionInfo(void) const;
304 };
305
306
307 /**********************************************
308 * Event reader algorithm for CalibTrailer events.
309 **********************************************/
310 class CalibTrailerReader: public TechmodelAlgorithm {
311 private:
312 /** The CalibTrailer event that is created in the reader. */
313 CalibTrailerEvent* calibTrailer;
314 public:
315 CalibTrailerReader(void);
316 virtual void Init(PamelaRun *);
317 virtual void RunEvent(int, long int) throw (WrongCRCException);
318 virtual std::string GetVersionInfo(void) const;
319 };
320
321
322 /**********************************************
323 * Event reader algorithm for InitHeader events.
324 **********************************************/
325 class InitHeaderReader: public TechmodelAlgorithm {
326 private:
327 /** The InitHeader event that is created in the reader. */
328 InitHeaderEvent* initHeader;
329 public:
330 InitHeaderReader(void);
331 virtual void Init(PamelaRun *);
332 virtual void RunEvent(int, long int) throw (WrongCRCException);
333 virtual std::string GetVersionInfo(void) const;
334 };
335
336
337 /**********************************************
338 * Event reader algorithm for InitTrailer events.
339 **********************************************/
340 class InitTrailerReader: public TechmodelAlgorithm {
341 private:
342 /** The InitTrailer event that is created in the reader. */
343 InitTrailerEvent* initTrailer;
344 public:
345 InitTrailerReader(void);
346 virtual void Init(PamelaRun *);
347 virtual void RunEvent(int, long int) throw (WrongCRCException);
348 virtual std::string GetVersionInfo(void) const;
349 };
350
351
352 /**********************************************
353 * Event reader algorithm for EventTrk events.
354 **********************************************/
355 class EventTrkReader: public TechmodelAlgorithm {
356 private:
357 /** The EventTrk event that is created in the reader. */
358 EventTrkEvent* eventTrk;
359 public:
360 EventTrkReader(void);
361 virtual void Init(PamelaRun *);
362 virtual void RunEvent(int, long int) throw (Exception);
363 virtual std::string GetVersionInfo(void) const;
364 };
365
366
367 /**********************************************
368 * Event reader algorithm for TestTrk events.
369 **********************************************/
370 class TestTrkReader: public TechmodelAlgorithm {
371 private:
372 /** The TestTrk event that is created in the reader. */
373 TestTrkEvent* testTrk;
374 public:
375 TestTrkReader(void);
376 virtual void Init(PamelaRun *);
377 virtual void RunEvent(int, long int) throw (Exception);
378 virtual std::string GetVersionInfo(void) const;
379 };
380
381 /**********************************************
382 * Event reader algorithm for TestTof events.
383 **********************************************/
384 class TestTofReader: public TechmodelAlgorithm {
385 private:
386 /** The TestTof event that is created in the reader. */
387 TestTofEvent* testTof;
388 public:
389 TestTofReader(void);
390 virtual void Init(PamelaRun *);
391 virtual void RunEvent(int, long int) throw (Exception);
392 virtual std::string GetVersionInfo(void) const;
393 };
394
395 /**********************************************
396 * Event reader algorithm for Log events.
397 **********************************************/
398 class LogReader: public TechmodelAlgorithm {
399 private:
400 /** The Log event that is created in the reader. */
401 LogEvent* Log;
402 public:
403 LogReader(void);
404 virtual void Init(PamelaRun *);
405 virtual void RunEvent(int, long int) throw (WrongCRCException);
406 virtual std::string GetVersionInfo(void) const;
407 };
408
409
410 /***********************************************
411 * Event reader algorithm for VarDump events.
412 **********************************************/
413 class VarDumpReader: public TechmodelAlgorithm {
414 private:
415 /** The VarDump event that is created in the reader. */
416 VarDumpEvent* VarDump;
417 public:
418 VarDumpReader(void);
419 virtual void Init(PamelaRun *);
420 virtual void RunEvent(int, long int) throw (WrongCRCException);
421 virtual std::string GetVersionInfo(void) const;
422 };
423
424
425 /**********************************************
426 * Event reader algorithm for ArrDump events.
427 **********************************************/
428 class ArrDumpReader: public TechmodelAlgorithm {
429 private:
430 /** The ArrDump event that is created in the reader. */
431 ArrDumpEvent* ArrDump;
432 public:
433 ArrDumpReader(void);
434 virtual void Init(PamelaRun *);
435 virtual void RunEvent(int, long int) throw (WrongCRCException);
436 virtual std::string GetVersionInfo(void) const;
437 };
438
439
440 /**********************************************
441 * Event reader algorithm for TabDump events.
442 **********************************************/
443 class TabDumpReader: public TechmodelAlgorithm {
444 private:
445 /** The TabDump event that is created in the reader. */
446 TabDumpEvent* TabDump;
447 public:
448 TabDumpReader(void);
449 virtual void Init(PamelaRun *);
450 virtual void RunEvent(int, long int) throw (WrongCRCException);
451 virtual std::string GetVersionInfo(void) const;
452 };
453
454
455 /**********************************************
456 * Event reader algorithm for TMTC events.
457 **********************************************/
458 class TmtcReader: public TechmodelAlgorithm {
459 //Length in bytes of the subPacket (that is te TmtcRecord excluded subCRC)
460 static const int TMTC_SUB_LENGTH = 57;
461 //Length in bytes of the subPacketCRC
462 static const int TMTC_SUBCRC_LENGTH = 1;
463 //Length in bytes of the PacketCRC
464 static const int TMTC_CRC_LENGTH = 2;
465 private:
466 /** The TMTC event that is created in the reader. */
467 TmtcEvent* Tmtc;
468 float convert_th(int);
469 public:
470 TmtcReader(void);
471 virtual void Init(PamelaRun *);
472 virtual void RunEvent(int, long int) throw (WrongCRCException);
473 virtual string GetVersionInfo(void) const;
474 };
475
476
477 /**********************************************
478 * Event reader algorithm for Mcmd events.
479 **********************************************/
480 class McmdReader: public TechmodelAlgorithm {
481 private:
482 /** The Mcmd event that is created in the reader. */
483 McmdEvent* Mcmd;
484 public:
485 McmdReader(void);
486 virtual void Init(PamelaRun *);
487 virtual void RunEvent(int, long int) throw (WrongCRCException);
488 virtual std::string GetVersionInfo(void) const;
489 };
490
491
492 /**********************************************
493 * Event reader algorithm for ForcedFECmd events.
494 **********************************************/
495 class ForcedFECmdReader: public TechmodelAlgorithm {
496 private:
497 /** The ForcedFECmd event that is created in the reader. */
498 ForcedFECmdEvent* forcedFECmd;
499 public:
500 ForcedFECmdReader(void);
501 virtual void Init(PamelaRun *);
502 virtual void RunEvent(int, long int) throw (WrongCRCException);
503 virtual std::string GetVersionInfo(void) const;
504 };
505
506
507 /**********************************************
508 * Event reader algorithm for AcInit events.
509 **********************************************/
510 class AcInitReader: public TechmodelAlgorithm {
511 private:
512 /** The AcInit event that is created in the reader. */
513 AcInitEvent* acInit;
514 public:
515 AcInitReader(void);
516 virtual void Init(PamelaRun *);
517 virtual void RunEvent(int, long int) throw (WrongCRCException);
518 virtual std::string GetVersionInfo(void) const;
519 };
520
521
522 /**********************************************
523 * Event reader algorithm for CalInit events.
524 **********************************************/
525 class CalInitReader: public TechmodelAlgorithm {
526 private:
527 /** The CalInit event that is created in the reader. */
528 CalInitEvent* calInit;
529 public:
530 CalInitReader(void);
531 virtual void Init(PamelaRun *);
532 virtual void RunEvent(int, long int) throw (WrongCRCException);
533 virtual std::string GetVersionInfo(void) const;
534 };
535
536
537 /**********************************************
538 * Event reader algorithm for TrkInit events.
539 **********************************************/
540 class TrkInitReader: public TechmodelAlgorithm {
541 private:
542 /** The TrkInit event that is created in the reader. */
543 TrkInitEvent* trkInit;
544 public:
545 TrkInitReader(void);
546 virtual void Init(PamelaRun *);
547 virtual void RunEvent(int, long int) throw (WrongCRCException);
548 virtual std::string GetVersionInfo(void) const;
549 };
550
551
552 /**********************************************
553 * Event reader algorithm for TofInit events.
554 **********************************************/
555 class TofInitReader: public TechmodelAlgorithm {
556 private:
557 /** The TofInit event that is created in the reader. */
558 TofInitEvent* tofInit;
559 public:
560 TofInitReader(void);
561 virtual void Init(PamelaRun *);
562 virtual void RunEvent(int, long int) throw (WrongCRCException);
563 virtual std::string GetVersionInfo(void) const;
564 };
565
566
567 /**********************************************
568 * Event reader algorithm for TrgInit events.
569 **********************************************/
570 class TrgInitReader: public TechmodelAlgorithm {
571 private:
572 /** The TrgInit event that is created in the reader. */
573 TrgInitEvent* trgInit;
574 public:
575 TrgInitReader(void);
576 virtual void Init(PamelaRun *);
577 virtual void RunEvent(int, long int) throw (WrongCRCException);
578 virtual std::string GetVersionInfo(void) const;
579 };
580
581 /**********************************************
582 * Event reader algorithm for NdInit events.
583 **********************************************/
584 class NdInitReader: public TechmodelAlgorithm {
585 private:
586 /** The NdInit event that is created in the reader. */
587 NdInitEvent* ndInit;
588 public:
589 NdInitReader(void);
590 virtual void Init(PamelaRun *);
591 virtual void RunEvent(int, long int) throw (WrongCRCException);
592 virtual std::string GetVersionInfo(void) const;
593 };
594
595
596 /**********************************************
597 * Event reader algorithm for CalAlarm events.
598 **********************************************/
599 class CalAlarmReader: public TechmodelAlgorithm {
600 private:
601 /** The CalAlarm event that is created in the reader. */
602 CalAlarmEvent* calAlarm;
603 public:
604 CalAlarmReader(void);
605 virtual void Init(PamelaRun *);
606 virtual void RunEvent(int, long int) throw (WrongCRCException);
607 virtual std::string GetVersionInfo(void) const;
608 };
609
610 /**********************************************
611 * Event reader algorithm for AcAlarm events.
612 **********************************************/
613 class AcAlarmReader: public TechmodelAlgorithm {
614 private:
615 /** The AcAlarm event that is created in the reader. */
616 AcAlarmEvent* acAlarm;
617 public:
618 AcAlarmReader(void);
619 virtual void Init(PamelaRun *);
620 virtual void RunEvent(int, long int) throw (WrongCRCException);
621 virtual std::string GetVersionInfo(void) const;
622 };
623
624 /**********************************************
625 * Event reader algorithm for TrkAlarm events.
626 **********************************************/
627 class TrkAlarmReader: public TechmodelAlgorithm {
628 private:
629 /** The TrkAlarm event that is created in the reader. */
630 TrkAlarmEvent* trkAlarm;
631 public:
632 TrkAlarmReader(void);
633 virtual void Init(PamelaRun *);
634 virtual void RunEvent(int, long int) throw (WrongCRCException);
635 virtual std::string GetVersionInfo(void) const;
636 };
637
638 /**********************************************
639 * Event reader algorithm for TrgAlarm events.
640 **********************************************/
641 class TrgAlarmReader: public TechmodelAlgorithm {
642 private:
643 /** The TrgAlarm event that is created in the reader. */
644 TrgAlarmEvent* trgAlarm;
645 public:
646 TrgAlarmReader(void);
647 virtual void Init(PamelaRun *);
648 virtual void RunEvent(int, long int) throw (WrongCRCException);
649 virtual std::string GetVersionInfo(void) const;
650 };
651
652 /**********************************************
653 * Event reader algorithm for TofAlarm events.
654 **********************************************/
655 class TofAlarmReader: public TechmodelAlgorithm {
656 private:
657 /** The TofAlarm event that is created in the reader. */
658 TofAlarmEvent* tofAlarm;
659 public:
660 TofAlarmReader(void);
661 virtual void Init(PamelaRun *);
662 virtual void RunEvent(int, long int) throw (WrongCRCException);
663 virtual std::string GetVersionInfo(void) const;
664 };
665
666 /**********************************************
667 * Event reader algorithm for PSCU events.
668 **********************************************/
669 class PscuReader: public TechmodelAlgorithm {
670 private:
671 /** The PSCU event that is created in the reader. */
672 PscuEvent* Pscu;
673 public:
674 PscuReader(void);
675 virtual void Init(PamelaRun *);
676 virtual void RunEvent(int, long int) throw (WrongCRCException);
677 virtual std::string GetVersionInfo(void) const;
678 };
679
680
681 }
682 }
683
684 #endif /* READER_ALGORITHM_H */
685
686

  ViewVC Help
Powered by ViewVC 1.1.23