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

Diff of /yoda/techmodel/ReaderAlgorithms.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.2 by kusanagi, Fri Dec 3 22:08:01 2004 UTC revision 6.1 by kusanagi, Wed Feb 15 15:47:14 2006 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Author: kusanagi $   * $Author: kusanagi $
3   * $Date: 2004/09/24 11:57:49 $   * $Date: 2006/02/07 17:11:10 $
4   * $Revision: 2.1 $   * $Revision: 6.0 $
5   *   *
6   * Header file for the algorithms used to read the techmodel data file.   * Header file for the algorithms used to read the techmodel data file.
7   */   */
# Line 13  Line 13 
13  #include "PscuEvent.h"  #include "PscuEvent.h"
14    
15    
16  #include "PhysEndRunEvent.h"  #include "endrun/PhysEndRunEvent.h"
17  #include "CalibCalPulse1Event.h"  #include "CalibCalPulse1Event.h"
18  #include "CalibCalPulse2Event.h"  #include "CalibCalPulse2Event.h"
19  #include "physics/TrackerReader.h"  #include "physics/TrackerReader.h"
20  #include "physics/AnticounterReader.h"  #include "physics/AnticounterReader.h"
21  #include "physics/CalorimeterReader.h"  #include "physics/CalorimeterReader.h"
22  #include "physics/NeutronDetectorReader.h"  #include "physics/NeutronDetectorReader.h"
23  #include "CalibTrkBothEvent.h"  #include "physics/S4Reader.h"
24    #include "physics/TofReader.h"
25    #include "physics/TriggerReader.h"
26  #include "CalibTrk1Event.h"  #include "CalibTrk1Event.h"
27  #include "CalibTrk2Event.h"  #include "CalibTrk2Event.h"
 #include "CalibTrdEvent.h"  
28  #include "CalibTofEvent.h"  #include "CalibTofEvent.h"
29  #include "CalibS4Event.h"  #include "CalibS4Event.h"
30  #include "CalibCalPedEvent.h"  #include "CalibCalPedEvent.h"
31  #include "CalibAcEvent.h"  #include "Calib1_Ac1Event.h"
32    #include "Calib1_Ac2Event.h"
33    #include "Calib2_Ac1Event.h"
34    #include "Calib2_Ac2Event.h"
35  #include "RunHeaderEvent.h"  #include "RunHeaderEvent.h"
36  #include "RunTrailerEvent.h"  #include "RunTrailerEvent.h"
37  #include "CalibHeaderEvent.h"  #include "CalibHeaderEvent.h"
# Line 35  Line 39 
39  #include "InitHeaderEvent.h"  #include "InitHeaderEvent.h"
40  #include "InitTrailerEvent.h"  #include "InitTrailerEvent.h"
41  #include "EventTrkEvent.h"  #include "EventTrkEvent.h"
 #include "TestTrkEvent.h"  
 #include "TestTofEvent.h"  
42  #include "log/LogEvent.h"  #include "log/LogEvent.h"
43  #include "varDump/VarDumpEvent.h"  #include "varDump/VarDumpEvent.h"
44  #include "arrDump/ArrDumpEvent.h"  #include "arrDump/ArrDumpEvent.h"
45  #include "tabDump/TabDumpEvent.h"  #include "tabDump/TabDumpEvent.h"
46    #include "tsbt/TsbTEvent.h"
47    #include "tsbb/TsbBEvent.h"
48  #include "tmtc/TmtcEvent.h"  #include "tmtc/TmtcEvent.h"
49  #include "mcmd/McmdEvent.h"  #include "mcmd/McmdEvent.h"
50  #include "ForcedFECmdEvent.h"  #include "ForcedFECmdEvent.h"
51  #include "AcInitEvent.h"  #include "Ac1InitEvent.h"
52  #include "CalInitEvent.h"  #include "CalInitEvent.h"
53  #include "TrkInitEvent.h"  #include "TrkInitEvent.h"
54  #include "TofInitEvent.h"  #include "TofInitEvent.h"
55  #include "TrgInitEvent.h"  #include "TrgInitEvent.h"
56  #include "NdInitEvent.h"  #include "NdInitEvent.h"
57    #include "S4InitEvent.h"
58    #include "Ac2InitEvent.h"
59  #include "CalAlarmEvent.h"  #include "CalAlarmEvent.h"
60  #include "AcAlarmEvent.h"  #include "AcAlarmEvent.h"
61  #include "TrkAlarmEvent.h"  #include "TrkAlarmEvent.h"
62  #include "TrgAlarmEvent.h"  #include "TrgAlarmEvent.h"
63  #include "TofAlarmEvent.h"  #include "TofAlarmEvent.h"
64    #include "S4AlarmEvent.h"
65    #include <fstream>
66    #include <log4cxx/logger.h>
67    
68    extern "C" {
69            #include "CRC.h"
70    }
71    
72  using namespace std;  using namespace std;
73    
74  namespace pamela {  namespace pamela {
75    namespace techmodel {    namespace techmodel {
76    
77  /**********************************************  /**
78  * Event reader algorithm for PhysEndRun events.   Event reader algorithm for PhysEndRun events.
79  **********************************************/   *
80     */
81      class PhysEndRunReader: public TechmodelAlgorithm {      class PhysEndRunReader: public TechmodelAlgorithm {
82      private:      private:
83        /** The PhysEndRun event that is created in the reader. */        /** The PhysEndRun event that is created in the reader. */
84        PhysEndRunEvent* physEndRun;        PhysEndRunEvent* physEndRun;
85      public:      public:
86          /**
87           * Constructor
88           * @param  
89           * @return
90           */
91        PhysEndRunReader(void);        PhysEndRunReader(void);
92        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
93        virtual void RunEvent(int, long int) throw (WrongCRCException);        virtual void RunEvent(int, long int) throw (WrongCRCException);
# Line 125  namespace pamela { Line 144  namespace pamela {
144        anticounter::AnticounterReader*   anticounterReader;        anticounter::AnticounterReader*   anticounterReader;
145        calorimeter::CalorimeterReader*   calorimeterReader;        calorimeter::CalorimeterReader*   calorimeterReader;
146        neutron::NeutronDetectorReader*   neutronReader;        neutron::NeutronDetectorReader*   neutronReader;
147          S4::S4Reader*                     s4Reader;
148          tof::TofReader*                   tofReader;
149          trigger::TriggerReader*           triggerReader;
150      public:      public:
151        PhysicsReader(void);        PhysicsReader(void);
152        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
# Line 134  namespace pamela { Line 156  namespace pamela {
156    
157    
158  /**********************************************  /**********************************************
 * Event reader algorithm for CalibTrkBoth events.  
 **********************************************/  
     class CalibTrkBothReader: public TechmodelAlgorithm {  
     private:  
       /** The CalibTrkBoth event that is created in the reader. */  
       CalibTrkBothEvent* calibTrkBoth;  
     public:  
       CalibTrkBothReader(void);  
       virtual void Init(PamelaRun *);  
       virtual void RunEvent(int, long int) throw (Exception);  
       //this type of RUNEvent should be the future develop.  
       //Pass the buffer not the pointer to file  
       //virtual void RunEvent(int, long int, char[]);  
       virtual std::string GetVersionInfo(void) const;  
     };  
   
   
 /**********************************************  
159  * Event reader algorithm for CalibTrk1 events.  * Event reader algorithm for CalibTrk1 events.
160  **********************************************/  **********************************************/
161      class CalibTrk1Reader: public TechmodelAlgorithm {      class CalibTrk1Reader: public TechmodelAlgorithm {
# Line 185  namespace pamela { Line 189  namespace pamela {
189    
190    
191  /**********************************************  /**********************************************
 * Event reader algorithm for CalibTrd events.  
 **********************************************/  
     class CalibTrdReader: public TechmodelAlgorithm {  
     private:  
       /** The CalibTrd event that is created in the reader. */  
       CalibTrdEvent* calibTrd;  
     public:  
       CalibTrdReader(void);  
       virtual void Init(PamelaRun *);  
       virtual void RunEvent(int, long int) throw (Exception);  
       virtual std::string GetVersionInfo(void) const;  
     };  
   
   
 /**********************************************  
192  * Event reader algorithm for CalibTof events.  * Event reader algorithm for CalibTof events.
193  **********************************************/  **********************************************/
194      class CalibTofReader: public TechmodelAlgorithm {      class CalibTofReader: public TechmodelAlgorithm {
# Line 220  namespace pamela { Line 209  namespace pamela {
209      class CalibS4Reader: public TechmodelAlgorithm {      class CalibS4Reader: public TechmodelAlgorithm {
210      private:      private:
211        /** The CalibCal event that is created in the reader. */        /** The CalibCal event that is created in the reader. */
212        CalibS4Event* CalibS4;        CalibS4Event* calibS4;
213      public:      public:
214        CalibS4Reader(void);        CalibS4Reader(void);
215        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
216        virtual void RunEvent(int, long int) throw (Exception);        virtual void RunEvent(int, long int) throw (WrongCRCException);
217        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
218      };      };
219    
# Line 245  namespace pamela { Line 234  namespace pamela {
234    
235    
236  /***********************************************  /***********************************************
237  * Event reader algorithm for CalibAc events.  * Event reader algorithm for Calib1_Ac1 events.
238  **********************************************/  **********************************************/
239      class CalibAcReader: public TechmodelAlgorithm {      class Calib1_Ac1Reader: public TechmodelAlgorithm {
240      private:      private:
241        /** The CalibAc event that is created in the reader. */        /** The CalibAc event that is created in the reader. */
242        CalibAcEvent* CalibAc;        Calib1_Ac1Event* calib1_Ac1;
243        public:
244          Calib1_Ac1Reader(void);
245          virtual void Init(PamelaRun *);
246          virtual void RunEvent(int, long int) throw (Exception);
247          virtual std::string GetVersionInfo(void) const;
248        };
249    
250    
251    /***********************************************
252    * Event reader algorithm for Calib1_Ac2 events.
253    **********************************************/
254        class Calib1_Ac2Reader: public TechmodelAlgorithm {
255        private:
256          /** The Calib1_Ac2 event that is created in the reader. */
257          Calib1_Ac2Event* calib1_Ac2;
258      public:      public:
259        CalibAcReader(void);        Calib1_Ac2Reader(void);
260          virtual void Init(PamelaRun *);
261          virtual void RunEvent(int, long int) throw (Exception);
262          virtual std::string GetVersionInfo(void) const;
263        };
264    
265    /***********************************************
266    * Event reader algorithm for Calib2_Ac1 events.
267    **********************************************/
268        class Calib2_Ac1Reader: public TechmodelAlgorithm {
269        private:
270          /** The Calib2_Ac1 event that is created in the reader. */
271          Calib2_Ac1Event* calib2_Ac1;
272        public:
273          Calib2_Ac1Reader(void);
274          virtual void Init(PamelaRun *);
275          virtual void RunEvent(int, long int) throw (Exception);
276          virtual std::string GetVersionInfo(void) const;
277        };
278    
279    /***********************************************
280    * Event reader algorithm for Calib2_Ac2 events.
281    **********************************************/
282        class Calib2_Ac2Reader: public TechmodelAlgorithm {
283        private:
284          /** The Calib2_Ac2 event that is created in the reader. */
285          Calib2_Ac2Event* calib2_Ac2;
286        public:
287          Calib2_Ac2Reader(void);
288        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
289        virtual void RunEvent(int, long int) throw (Exception);        virtual void RunEvent(int, long int) throw (Exception);
290        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
# Line 365  namespace pamela { Line 397  namespace pamela {
397    
398    
399  /**********************************************  /**********************************************
 * Event reader algorithm for TestTrk events.  
 **********************************************/  
     class TestTrkReader: public TechmodelAlgorithm {  
     private:  
       /** The TestTrk event that is created in the reader. */  
       TestTrkEvent* testTrk;  
     public:  
       TestTrkReader(void);  
       virtual void Init(PamelaRun *);  
       virtual void RunEvent(int, long int) throw (Exception);  
       virtual std::string GetVersionInfo(void) const;  
     };  
   
 /**********************************************  
 * Event reader algorithm for TestTof events.  
 **********************************************/  
     class TestTofReader: public TechmodelAlgorithm {  
     private:  
       /** The TestTof event that is created in the reader. */  
       TestTofEvent* testTof;  
     public:  
       TestTofReader(void);  
       virtual void Init(PamelaRun *);  
       virtual void RunEvent(int, long int) throw (Exception);  
       virtual std::string GetVersionInfo(void) const;  
     };  
   
 /**********************************************  
400  * Event reader algorithm for Log events.  * Event reader algorithm for Log events.
401  **********************************************/  **********************************************/
402      class LogReader: public TechmodelAlgorithm {      class LogReader: public TechmodelAlgorithm {
# Line 457  namespace pamela { Line 461  namespace pamela {
461  **********************************************/  **********************************************/
462      class TmtcReader: public TechmodelAlgorithm {      class TmtcReader: public TechmodelAlgorithm {
463      //Length in bytes of the subPacket (that is te TmtcRecord excluded subCRC)      //Length in bytes of the subPacket (that is te TmtcRecord excluded subCRC)
464      static const int TMTC_SUB_LENGTH = 57;      static const int TMTC_SUB_LENGTH = 44;
465      //Length in bytes of the subPacketCRC      //Length in bytes of the subPacketCRC
466      static const int TMTC_SUBCRC_LENGTH = 1;      static const int TMTC_SUBCRC_LENGTH = 1;
467      //Length in bytes of the PacketCRC      //Length in bytes of the PacketCRC
# Line 465  namespace pamela { Line 469  namespace pamela {
469      private:      private:
470        /** The TMTC event that is created in the reader. */        /** The TMTC event that is created in the reader. */
471        TmtcEvent* Tmtc;        TmtcEvent* Tmtc;
472        float convert_th(int);        //float convert_th(int);
473      public:      public:
474      TmtcReader(void);      TmtcReader(void);
475      virtual void Init(PamelaRun *);      virtual void Init(PamelaRun *);
# Line 505  namespace pamela { Line 509  namespace pamela {
509    
510    
511  /**********************************************  /**********************************************
512  * Event reader algorithm for AcInit events.  * Event reader algorithm for Ac1Init events.
513  **********************************************/  **********************************************/
514      class AcInitReader: public TechmodelAlgorithm {      class Ac1InitReader: public TechmodelAlgorithm {
515      private:      private:
516        /** The AcInit event that is created in the reader. */        /** The Ac1Init event that is created in the reader. */
517        AcInitEvent* acInit;        Ac1InitEvent* ac1Init;
518      public:      public:
519        AcInitReader(void);        Ac1InitReader(void);
520        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
521        virtual void RunEvent(int, long int) throw (WrongCRCException);        virtual void RunEvent(int, long int) throw (WrongCRCException);
522        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
# Line 592  namespace pamela { Line 596  namespace pamela {
596        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
597      };      };
598    
599    /**********************************************
600    * Event reader algorithm for S4Init events.
601    **********************************************/
602        class S4InitReader: public TechmodelAlgorithm {
603        private:
604          /** The S4Init event that is created in the reader. */
605          S4InitEvent* s4Init;
606        public:
607          S4InitReader(void);
608          virtual void Init(PamelaRun *);
609          virtual void RunEvent(int, long int) throw (WrongCRCException);
610          virtual std::string GetVersionInfo(void) const;
611        };
612    
613    
614    /**********************************************
615    * Event reader algorithm for Ac2Init events.
616    **********************************************/
617        class Ac2InitReader: public TechmodelAlgorithm {
618        private:
619          /** The Ac2Init event that is created in the reader. */
620          Ac2InitEvent* ac2Init;
621        public:
622          Ac2InitReader(void);
623          virtual void Init(PamelaRun *);
624          virtual void RunEvent(int, long int) throw (WrongCRCException);
625          virtual std::string GetVersionInfo(void) const;
626        };
627    
628    
629  /**********************************************  /**********************************************
630  * Event reader algorithm for CalAlarm events.  * Event reader algorithm for CalAlarm events.
# Line 664  namespace pamela { Line 697  namespace pamela {
697      };      };
698    
699  /**********************************************  /**********************************************
700    * Event reader algorithm for S4Alarm events.
701    **********************************************/
702        class S4AlarmReader: public TechmodelAlgorithm {
703        private:
704          /** The S4Alarm event that is created in the reader. */
705          S4AlarmEvent* s4Alarm;
706        public:
707          S4AlarmReader(void);
708          virtual void Init(PamelaRun *);
709          virtual void RunEvent(int, long int) throw (WrongCRCException);
710          virtual std::string GetVersionInfo(void) const;
711        };
712    
713    /**********************************************
714    * Event reader algorithm for TsbT events.
715    **********************************************/
716        class TsbTReader: public TechmodelAlgorithm {
717        private:
718          /** The TsbT event that is created in the reader. */
719          TsbTEvent* TsbT;
720        public:
721          TsbTReader(void);
722          virtual void Init(PamelaRun *);
723          virtual void RunEvent(int, long int) throw (WrongCRCException);
724          virtual std::string GetVersionInfo(void) const;
725        };
726    
727    /**********************************************
728    * Event reader algorithm for TsbB events.
729    **********************************************/
730        class TsbBReader: public TechmodelAlgorithm {
731        private:
732          /** The TsbB event that is created in the reader. */
733          TsbBEvent* TsbB;
734        public:
735          TsbBReader(void);
736          virtual void Init(PamelaRun *);
737          virtual void RunEvent(int, long int) throw (WrongCRCException);
738          virtual std::string GetVersionInfo(void) const;
739        };
740    
741    /**********************************************
742  * Event reader algorithm for PSCU events.  * Event reader algorithm for PSCU events.
743  **********************************************/  **********************************************/
744      class PscuReader: public TechmodelAlgorithm {      class PscuReader: public TechmodelAlgorithm {
# Line 684  namespace pamela { Line 759  namespace pamela {
759  #endif /* READER_ALGORITHM_H */  #endif /* READER_ALGORITHM_H */
760    
761    
762    
763    

Legend:
Removed from v.2.2  
changed lines
  Added in v.6.1

  ViewVC Help
Powered by ViewVC 1.1.23