pmt_slow_encoder.hh

Go to the documentation of this file.
00001 
00015 #ifndef PMT_SLOW_ENCODER_HH
00016 #define PMT_SLOW_ENCODER_HH
00017 
00018 #include "ana_base.hh"
00019 #include "../FileIO/FileIO-TypeDef.hh"
00020 #include "../Base/Base-TypeDef.hh"
00021 
00026 class pmt_slow_encoder : public ana_base{
00027 
00028 public:
00029 
00031   pmt_slow_encoder() : _bin_file() { _name="pmt_slow_encoder"; _fout=0;};
00032 
00034   virtual ~pmt_slow_encoder(){};
00035 
00039   virtual bool initialize();
00040 
00044   virtual bool analyze(storage_manager* storage);
00045 
00049   virtual bool finalize();
00050 
00051   void set_mode(bin_io_handler::MODE mode){_bin_file.set_mode(mode);};
00052 
00053   void set_filename(std::string name){_bin_file.set_filename(name);};
00054 
00055   virtual inline PMT::word_t format(PMT::PMT_WORD type,PMT::word_t word=0x0) const 
00056   {
00057     switch(type){
00058     case PMT::EVENT_HEADER:
00059       word = 0xffffffff;
00060       break;
00061     case PMT::FEM_HEADER:
00062       word = 0xf000 + (0xfff & word);
00063       break;
00064     case PMT::FEM_FIRST_WORD:
00065       word = 0x4000 + (0xfff & word);
00066       break;
00067     case PMT::CHANNEL_HEADER:
00068       word = 0x9000 + (0xfff & word);
00069       break;
00070     case PMT::CHANNEL_WORD:
00071       word = 0xa000 + (0xfff & word);
00072       break;
00073     case PMT::CHANNEL_LAST_WORD:
00074       word = 0xb000 + (0xfff & word);
00075       break;
00076     case PMT::FEM_LAST_WORD:
00077       word = 0xc000;
00078       break;
00079     case PMT::EVENT_LAST_WORD:
00080       word = 0xe000;
00081       break;
00082     case PMT::UNDEFINED_WORD:
00083       word = 0x0;
00084     }
00085     return word;
00086   };
00087 
00088 protected:
00089 
00090   virtual void encode_event_header(const pmt_wf_collection* data);
00091   virtual void encode_ch_word(const pmt_wf_collection* data);
00092 
00093   bin_io_handler _bin_file;
00094   PMT::word_t _words[60000];
00095   uint16_t    _index;
00096 
00097   
00098 };
00099 
00100 #endif
00101  // end of doxygen group 

Generated on Mon Apr 7 15:35:12 2014 for MyProject by  doxygen 1.4.7