00001 #ifndef TSPADICSOURCE_H 00002 #define TSPADICSOURCE_H 00003 00004 #include "TGo4EventSource.h" 00005 00006 #include <stdint.h> 00007 #include <vector> 00008 #include <list> 00009 00010 00011 class TGo4UserSourceParameter; 00012 00013 namespace SuS { 00014 class SpadicLib; 00015 } 00016 00022 class TSpadicSource : public TGo4EventSource { 00023 public: 00024 00025 TSpadicSource(); 00026 00027 TSpadicSource(TGo4UserSourceParameter* par); 00028 00029 virtual ~TSpadicSource(); 00030 00032 Int_t Close(); 00033 00035 Int_t Open(); 00036 00037 virtual Bool_t CheckEventClass(TClass* cl); 00038 00040 virtual Bool_t BuildEvent(TGo4EventElement* dest); 00041 00042 private: 00043 00044 TString fArg; 00045 00046 Int_t fFullId; // roc number and format type, coded into mbs subevent fullid 00047 00048 SuS::SpadicLib* fLib; // pointer on spadic access library 00049 00050 std::list< std::vector<uint8_t> > fPackages; // buffer with received messages 00051 00052 int fBoardId; // Spadic Id 00053 int fHitDelay; // spadic hit delay 00054 00055 int fTriggerPerSecond; // how often trigger will be produced 00056 double fLastTrigger; 00057 00058 uint8_t fMsgBuffer[8192]; // take big-enough buffer to keep spadic message in raw format 00059 00060 ClassDef(TSpadicSource,1) 00061 }; 00062 00063 #endif //TGO4MBSRANDOM_H