00001 /* @version $Revision: 1764 $ * @modifiedby $Author: lcdet $ * @lastmodified $Date: 2012-06-07 16:58:43 +0200 (Thu, 07 Jun 2012) $ */ 00002 00003 #ifndef MICROROCXDAQREADER_HH 00004 #define MICROROXDAQCREADER_HH 00005 00006 ////////////////////////////////////////////////////////////////////////// 00007 // // 00008 // MicrorocXDaqReader for MICROMEGAS READOUT // 00009 // From XDaq DAQ in lcio format 00010 // // 00011 ////////////////////////////////////////////////////////////////////////// 00012 00013 #include "mTypes.h" 00014 #include "MicrorocReader.hh" 00015 #include <map> 00016 #include <set> 00017 #include <list> 00018 00019 #define XDAQMR "xdaqMR" 00020 #define NBLINE 4 00021 #define NBCHIP 16 00022 #define NBCHANNEL 64 00023 00024 #include "IO/LCReader.h" 00025 #include "EVENT/LCEvent.h" 00026 00027 00028 00029 class Run; 00030 class Event; 00031 class Detector; 00032 00033 00034 00035 ////////////////////////////////////////////////////////////////////////// 00036 /// CLASS DATAREADER // 00037 ////////////////////////////////////////////////////////////////////////// 00038 class MicrorocXDaqReader : public MicrorocReader { 00039 public: 00040 MicrorocXDaqReader(Run& aRun, std::string aFilefullPath, ui32 lastEventId, bool forceAnalog,std::set<unsigned int>* = NULL); 00041 ~MicrorocXDaqReader(); 00042 static const char *type(const int subtype = 0) { return XDAQMR; }; 00043 00044 00045 int getScData(); 00046 int getNextEvent(Event& eventToFill) ; 00047 int getAcqData(Event& event, unsigned char *bufChar, bool tempExist = false) ; 00048 int getAnalogData(Event& event) ; 00049 unsigned int getData(const unsigned int nBytes); 00050 00051 00052 private: 00053 void localReset(); 00054 // void display(const int inc = 0) ; 00055 00056 00057 private: 00058 std::map<ui16,std::map<ui16,ui16> >analogData; //first key is chip Id, second one is channel Id. Data is channel analog value 00059 ui16 nbChipPerLine; 00060 bool analogDataActivate; 00061 bool analogDataActivatedLine[NBLINE]; 00062 std::list<unsigned char> rawdataList; 00063 std::list<unsigned char>::const_iterator itRawdata; 00064 std::set<unsigned int> *difList; 00065 00066 IO::LCReader *lcReader; 00067 bool firstEvent; 00068 ui32 debugEventId; 00069 bool slowControlSet; 00070 00071 ui32 hexTemperatureAsu1; 00072 ui32 hexTemperatureAsu2; 00073 ui16 hexTemperatureDif; 00074 00075 00076 bool forceAnalog; 00077 00078 00079 }; // class MicrorocXDaqReader 00080 00081 #endif