00001 /* @version $Revision: 1328 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2011-10-03 17:04:17 +0200 (Mon, 03 Oct 2011) $ */ 00002 00003 #ifndef HR2READER_HH 00004 #define HR2READER_HH 00005 00006 ////////////////////////////////////////////////////////////////////////// 00007 // // 00008 // Hardroc2Reader for MICROMEGAS READOUT // 00009 // // 00010 ////////////////////////////////////////////////////////////////////////// 00011 00012 #include "mTypes.h" 00013 #include "DifReader.hh" 00014 00015 00016 class Run; 00017 class Event; 00018 class Detector; 00019 00020 #include <set> 00021 00022 ////////////////////////////////////////////////////////////////////////// 00023 /// CLASS DATAREADER // 00024 ////////////////////////////////////////////////////////////////////////// 00025 class Hardroc2Reader : public DifReader { 00026 public: 00027 Hardroc2Reader(Run& aRun, FILE *aFile, ui32 lastEventId); 00028 ~Hardroc2Reader(); 00029 static const char *type(const int subtype = 0) ; 00030 virtual int getNextEvent(Event& eventToFill) = 0; 00031 00032 protected: 00033 virtual int getScData() = 0; 00034 virtual int getAcqData(Event& event) = 0; 00035 void reset(); 00036 int storeEvent(Event& event); 00037 int newHit(Event& event, const Detector& detector, int data, const int chNum, const int chipId, const int difId); 00038 00039 // ------ data members -------// 00040 protected: 00041 00042 // file header : data format 00043 unsigned short CRC; // current CRC for the whole file 00044 00045 // global header data 00046 int difId; // Id of the current DIF board 00047 ui32 difTriggerCounter; // trigger counter 00048 ui32 acqTriggerCounter; // trigger counter version >= 4 00049 ui32 globalTriggerCounter; // global trigger counter 00050 ui32 bcPeriod; // the BC period in nanoseconds, unless otherwise specified 00051 i64 bcId_Abs; // absolute bc Id for current DIF, in bcPeriods 00052 i64 bcId_AbsOrg; // the bcId origin, in bcPeriods, for the whole file 00053 i64 bcId_Dif; // current bcId for current DIF 00054 i64 bcId_Hit; // bcId du hit 00055 i64 eventTime; // event time in milliseconds 00056 i32 difSynchro; 00057 00058 int SkippedBcId; // the number of data skipped because of wrong bcId_Hit 00059 }; // class Hardroc2Reader 00060 00061 #endif 00062