1 |
/** @file |
/** @file |
2 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
3 |
* $Date: 2004/12/09 08:48:41 $ |
* $Date: 2006/02/07 17:11:10 $ |
4 |
* $Revision: 2.3 $ |
* $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 |
*/ |
*/ |
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" |
21 |
#include "physics/CalorimeterReader.h" |
#include "physics/CalorimeterReader.h" |
22 |
#include "physics/NeutronDetectorReader.h" |
#include "physics/NeutronDetectorReader.h" |
23 |
#include "physics/S4Reader.h" |
#include "physics/S4Reader.h" |
24 |
#include "CalibTrkBothEvent.h" |
#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" |
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" |
62 |
#include "TrgAlarmEvent.h" |
#include "TrgAlarmEvent.h" |
63 |
#include "TofAlarmEvent.h" |
#include "TofAlarmEvent.h" |
64 |
#include "S4AlarmEvent.h" |
#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); |
145 |
calorimeter::CalorimeterReader* calorimeterReader; |
calorimeter::CalorimeterReader* calorimeterReader; |
146 |
neutron::NeutronDetectorReader* neutronReader; |
neutron::NeutronDetectorReader* neutronReader; |
147 |
S4::S4Reader* s4Reader; |
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 *); |
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 { |
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 { |
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 |
|
|
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 { |
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 |
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 *); |
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 { |