/[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 5.1 by kusanagi, Sat Feb 4 12:37:45 2006 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Author: kusanagi $   * $Author: Maurizio Nagni $
3   * $Date: 2004/09/24 11:57:49 $   * $Date: 2005/08/29 09:46:13 $
4   * $Revision: 2.1 $   * $Revision: 5.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"
38  #include "CalibTrailerEvent.h"  #include "CalibTrailerEvent.h"
39  #include "InitHeaderEvent.h"  #include "InitHeaderEvent.h"
40  #include "InitTrailerEvent.h"  #include "InitTrailerEvent.h"
 #include "EventTrkEvent.h"  
 #include "TestTrkEvent.h"  
 #include "TestTofEvent.h"  
41  #include "log/LogEvent.h"  #include "log/LogEvent.h"
42  #include "varDump/VarDumpEvent.h"  #include "varDump/VarDumpEvent.h"
43  #include "arrDump/ArrDumpEvent.h"  #include "arrDump/ArrDumpEvent.h"
44  #include "tabDump/TabDumpEvent.h"  #include "tabDump/TabDumpEvent.h"
45    #include "tsbt/TsbTEvent.h"
46    #include "tsbb/TsbBEvent.h"
47  #include "tmtc/TmtcEvent.h"  #include "tmtc/TmtcEvent.h"
48  #include "mcmd/McmdEvent.h"  #include "mcmd/McmdEvent.h"
49  #include "ForcedFECmdEvent.h"  #include "ForcedFECmdEvent.h"
50  #include "AcInitEvent.h"  #include "Ac1InitEvent.h"
51  #include "CalInitEvent.h"  #include "CalInitEvent.h"
52  #include "TrkInitEvent.h"  #include "TrkInitEvent.h"
53  #include "TofInitEvent.h"  #include "TofInitEvent.h"
54  #include "TrgInitEvent.h"  #include "TrgInitEvent.h"
55  #include "NdInitEvent.h"  #include "NdInitEvent.h"
56    #include "S4InitEvent.h"
57    #include "Ac2InitEvent.h"
58  #include "CalAlarmEvent.h"  #include "CalAlarmEvent.h"
59  #include "AcAlarmEvent.h"  #include "AcAlarmEvent.h"
60  #include "TrkAlarmEvent.h"  #include "TrkAlarmEvent.h"
61  #include "TrgAlarmEvent.h"  #include "TrgAlarmEvent.h"
62  #include "TofAlarmEvent.h"  #include "TofAlarmEvent.h"
63    #include "S4AlarmEvent.h"
64    #include <fstream>
65    #include <log4cxx/logger.h>
66    
67    extern "C" {
68            #include "CRC.h"
69    }
70    
71  using namespace std;  using namespace std;
72    
73  namespace pamela {  namespace pamela {
74    namespace techmodel {    namespace techmodel {
75    
76  /**********************************************  /**
77  * Event reader algorithm for PhysEndRun events.   Event reader algorithm for PhysEndRun events.
78  **********************************************/   *
79     */
80      class PhysEndRunReader: public TechmodelAlgorithm {      class PhysEndRunReader: public TechmodelAlgorithm {
81      private:      private:
82        /** The PhysEndRun event that is created in the reader. */        /** The PhysEndRun event that is created in the reader. */
83        PhysEndRunEvent* physEndRun;        PhysEndRunEvent* physEndRun;
84      public:      public:
85          /**
86           * Constructor
87           * @param  
88           * @return
89           */
90        PhysEndRunReader(void);        PhysEndRunReader(void);
91        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
92        virtual void RunEvent(int, long int) throw (WrongCRCException);        virtual void RunEvent(int, long int) throw (WrongCRCException);
# Line 125  namespace pamela { Line 143  namespace pamela {
143        anticounter::AnticounterReader*   anticounterReader;        anticounter::AnticounterReader*   anticounterReader;
144        calorimeter::CalorimeterReader*   calorimeterReader;        calorimeter::CalorimeterReader*   calorimeterReader;
145        neutron::NeutronDetectorReader*   neutronReader;        neutron::NeutronDetectorReader*   neutronReader;
146          S4::S4Reader*                     s4Reader;
147          tof::TofReader*                   tofReader;
148          trigger::TriggerReader*           triggerReader;
149      public:      public:
150        PhysicsReader(void);        PhysicsReader(void);
151        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
# Line 134  namespace pamela { Line 155  namespace pamela {
155    
156    
157  /**********************************************  /**********************************************
 * 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;  
     };  
   
   
 /**********************************************  
158  * Event reader algorithm for CalibTrk1 events.  * Event reader algorithm for CalibTrk1 events.
159  **********************************************/  **********************************************/
160      class CalibTrk1Reader: public TechmodelAlgorithm {      class CalibTrk1Reader: public TechmodelAlgorithm {
# Line 185  namespace pamela { Line 188  namespace pamela {
188    
189    
190  /**********************************************  /**********************************************
 * 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;  
     };  
   
   
 /**********************************************  
191  * Event reader algorithm for CalibTof events.  * Event reader algorithm for CalibTof events.
192  **********************************************/  **********************************************/
193      class CalibTofReader: public TechmodelAlgorithm {      class CalibTofReader: public TechmodelAlgorithm {
# Line 220  namespace pamela { Line 208  namespace pamela {
208      class CalibS4Reader: public TechmodelAlgorithm {      class CalibS4Reader: public TechmodelAlgorithm {
209      private:      private:
210        /** The CalibCal event that is created in the reader. */        /** The CalibCal event that is created in the reader. */
211        CalibS4Event* CalibS4;        CalibS4Event* calibS4;
212      public:      public:
213        CalibS4Reader(void);        CalibS4Reader(void);
214        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
215        virtual void RunEvent(int, long int) throw (Exception);        virtual void RunEvent(int, long int) throw (WrongCRCException);
216        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
217      };      };
218    
# Line 245  namespace pamela { Line 233  namespace pamela {
233    
234    
235  /***********************************************  /***********************************************
236  * Event reader algorithm for CalibAc events.  * Event reader algorithm for Calib1_Ac1 events.
237  **********************************************/  **********************************************/
238      class CalibAcReader: public TechmodelAlgorithm {      class Calib1_Ac1Reader: public TechmodelAlgorithm {
239      private:      private:
240        /** The CalibAc event that is created in the reader. */        /** The CalibAc event that is created in the reader. */
241        CalibAcEvent* CalibAc;        Calib1_Ac1Event* calib1_Ac1;
242      public:      public:
243        CalibAcReader(void);        Calib1_Ac1Reader(void);
244          virtual void Init(PamelaRun *);
245          virtual void RunEvent(int, long int) throw (Exception);
246          virtual std::string GetVersionInfo(void) const;
247        };
248    
249    
250    /***********************************************
251    * Event reader algorithm for Calib1_Ac2 events.
252    **********************************************/
253        class Calib1_Ac2Reader: public TechmodelAlgorithm {
254        private:
255          /** The Calib1_Ac2 event that is created in the reader. */
256          Calib1_Ac2Event* calib1_Ac2;
257        public:
258          Calib1_Ac2Reader(void);
259          virtual void Init(PamelaRun *);
260          virtual void RunEvent(int, long int) throw (Exception);
261          virtual std::string GetVersionInfo(void) const;
262        };
263    
264    /***********************************************
265    * Event reader algorithm for Calib2_Ac1 events.
266    **********************************************/
267        class Calib2_Ac1Reader: public TechmodelAlgorithm {
268        private:
269          /** The Calib2_Ac1 event that is created in the reader. */
270          Calib2_Ac1Event* calib2_Ac1;
271        public:
272          Calib2_Ac1Reader(void);
273          virtual void Init(PamelaRun *);
274          virtual void RunEvent(int, long int) throw (Exception);
275          virtual std::string GetVersionInfo(void) const;
276        };
277    
278    /***********************************************
279    * Event reader algorithm for Calib2_Ac2 events.
280    **********************************************/
281        class Calib2_Ac2Reader: public TechmodelAlgorithm {
282        private:
283          /** The Calib2_Ac2 event that is created in the reader. */
284          Calib2_Ac2Event* calib2_Ac2;
285        public:
286          Calib2_Ac2Reader(void);
287        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
288        virtual void RunEvent(int, long int) throw (Exception);        virtual void RunEvent(int, long int) throw (Exception);
289        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
# Line 350  namespace pamela { Line 381  namespace pamela {
381    
382    
383  /**********************************************  /**********************************************
 * Event reader algorithm for EventTrk events.  
 **********************************************/  
     class EventTrkReader: public TechmodelAlgorithm {  
     private:  
       /** The EventTrk event that is created in the reader. */  
       EventTrkEvent* eventTrk;  
     public:  
       EventTrkReader(void);  
       virtual void Init(PamelaRun *);  
       virtual void RunEvent(int, long int) throw (Exception);  
       virtual std::string GetVersionInfo(void) const;  
     };  
   
   
 /**********************************************  
 * 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;  
     };  
   
 /**********************************************  
384  * Event reader algorithm for Log events.  * Event reader algorithm for Log events.
385  **********************************************/  **********************************************/
386      class LogReader: public TechmodelAlgorithm {      class LogReader: public TechmodelAlgorithm {
# Line 457  namespace pamela { Line 445  namespace pamela {
445  **********************************************/  **********************************************/
446      class TmtcReader: public TechmodelAlgorithm {      class TmtcReader: public TechmodelAlgorithm {
447      //Length in bytes of the subPacket (that is te TmtcRecord excluded subCRC)      //Length in bytes of the subPacket (that is te TmtcRecord excluded subCRC)
448      static const int TMTC_SUB_LENGTH = 57;      static const int TMTC_SUB_LENGTH = 44;
449      //Length in bytes of the subPacketCRC      //Length in bytes of the subPacketCRC
450      static const int TMTC_SUBCRC_LENGTH = 1;      static const int TMTC_SUBCRC_LENGTH = 1;
451      //Length in bytes of the PacketCRC      //Length in bytes of the PacketCRC
# Line 465  namespace pamela { Line 453  namespace pamela {
453      private:      private:
454        /** The TMTC event that is created in the reader. */        /** The TMTC event that is created in the reader. */
455        TmtcEvent* Tmtc;        TmtcEvent* Tmtc;
456        float convert_th(int);        //float convert_th(int);
457      public:      public:
458      TmtcReader(void);      TmtcReader(void);
459      virtual void Init(PamelaRun *);      virtual void Init(PamelaRun *);
# Line 505  namespace pamela { Line 493  namespace pamela {
493    
494    
495  /**********************************************  /**********************************************
496  * Event reader algorithm for AcInit events.  * Event reader algorithm for Ac1Init events.
497  **********************************************/  **********************************************/
498      class AcInitReader: public TechmodelAlgorithm {      class Ac1InitReader: public TechmodelAlgorithm {
499      private:      private:
500        /** The AcInit event that is created in the reader. */        /** The Ac1Init event that is created in the reader. */
501        AcInitEvent* acInit;        Ac1InitEvent* ac1Init;
502      public:      public:
503        AcInitReader(void);        Ac1InitReader(void);
504        virtual void Init(PamelaRun *);        virtual void Init(PamelaRun *);
505        virtual void RunEvent(int, long int) throw (WrongCRCException);        virtual void RunEvent(int, long int) throw (WrongCRCException);
506        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
# Line 592  namespace pamela { Line 580  namespace pamela {
580        virtual std::string GetVersionInfo(void) const;        virtual std::string GetVersionInfo(void) const;
581      };      };
582    
583    /**********************************************
584    * Event reader algorithm for S4Init events.
585    **********************************************/
586        class S4InitReader: public TechmodelAlgorithm {
587        private:
588          /** The S4Init event that is created in the reader. */
589          S4InitEvent* s4Init;
590        public:
591          S4InitReader(void);
592          virtual void Init(PamelaRun *);
593          virtual void RunEvent(int, long int) throw (WrongCRCException);
594          virtual std::string GetVersionInfo(void) const;
595        };
596    
597    
598    /**********************************************
599    * Event reader algorithm for Ac2Init events.
600    **********************************************/
601        class Ac2InitReader: public TechmodelAlgorithm {
602        private:
603          /** The Ac2Init event that is created in the reader. */
604          Ac2InitEvent* ac2Init;
605        public:
606          Ac2InitReader(void);
607          virtual void Init(PamelaRun *);
608          virtual void RunEvent(int, long int) throw (WrongCRCException);
609          virtual std::string GetVersionInfo(void) const;
610        };
611    
612    
613  /**********************************************  /**********************************************
614  * Event reader algorithm for CalAlarm events.  * Event reader algorithm for CalAlarm events.
# Line 664  namespace pamela { Line 681  namespace pamela {
681      };      };
682    
683  /**********************************************  /**********************************************
684    * Event reader algorithm for S4Alarm events.
685    **********************************************/
686        class S4AlarmReader: public TechmodelAlgorithm {
687        private:
688          /** The S4Alarm event that is created in the reader. */
689          S4AlarmEvent* s4Alarm;
690        public:
691          S4AlarmReader(void);
692          virtual void Init(PamelaRun *);
693          virtual void RunEvent(int, long int) throw (WrongCRCException);
694          virtual std::string GetVersionInfo(void) const;
695        };
696    
697    /**********************************************
698    * Event reader algorithm for TsbT events.
699    **********************************************/
700        class TsbTReader: public TechmodelAlgorithm {
701        private:
702          /** The TsbT event that is created in the reader. */
703          TsbTEvent* TsbT;
704        public:
705          TsbTReader(void);
706          virtual void Init(PamelaRun *);
707          virtual void RunEvent(int, long int) throw (WrongCRCException);
708          virtual std::string GetVersionInfo(void) const;
709        };
710    
711    /**********************************************
712    * Event reader algorithm for TsbB events.
713    **********************************************/
714        class TsbBReader: public TechmodelAlgorithm {
715        private:
716          /** The TsbB event that is created in the reader. */
717          TsbBEvent* TsbB;
718        public:
719          TsbBReader(void);
720          virtual void Init(PamelaRun *);
721          virtual void RunEvent(int, long int) throw (WrongCRCException);
722          virtual std::string GetVersionInfo(void) const;
723        };
724    
725    /**********************************************
726  * Event reader algorithm for PSCU events.  * Event reader algorithm for PSCU events.
727  **********************************************/  **********************************************/
728      class PscuReader: public TechmodelAlgorithm {      class PscuReader: public TechmodelAlgorithm {
# Line 684  namespace pamela { Line 743  namespace pamela {
743  #endif /* READER_ALGORITHM_H */  #endif /* READER_ALGORITHM_H */
744    
745    
746    
747    

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

  ViewVC Help
Powered by ViewVC 1.1.23