00001 #ifndef ESDATAFORMATTERV4_H 00002 #define ESDATAFORMATTERV4_H 00003 00004 #include <iostream> 00005 #include <vector> 00006 #include <bitset> 00007 #include <sstream> 00008 #include <map> 00009 #include <fstream> 00010 00011 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" 00012 #include "DataFormats/EcalDigi/interface/ESDataFrame.h" 00013 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" 00014 #include "DataFormats/FEDRawData/interface/FEDRawData.h" 00015 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00016 #include "FWCore/ParameterSet/interface/FileInPath.h" 00017 #include "EventFilter/ESDigiToRaw/interface/ESDataFormatter.h" 00018 00019 class ESDigiToRaw; 00020 00021 class ESDataFormatterV4 : public ESDataFormatter { 00022 00023 public : 00024 00025 typedef ESDataFormatter::DetDigis DetDigis; 00026 typedef ESDataFormatter::Digis Digis; 00027 00028 typedef ESDataFormatter::Word8 Word8; 00029 typedef ESDataFormatter::Word16 Word16; 00030 typedef ESDataFormatter::Word32 Word32; 00031 typedef ESDataFormatter::Word64 Word64; 00032 00033 ESDataFormatterV4(const edm::ParameterSet& ps); 00034 ~ESDataFormatterV4(); 00035 00036 00037 void DigiToRaw(int fedId, Digis & digis, FEDRawData& fedRawData); 00038 00039 00040 private : 00041 00042 edm::FileInPath lookup_; 00043 int fedId_[2][2][40][40]; 00044 int kchipId_[2][2][40][40]; 00045 int paceId_[2][2][40][40]; 00046 int bundleId_[2][2][40][40]; 00047 int fiberId_[2][2][40][40]; 00048 int optoId_[2][2][40][40]; 00049 00050 bool fedIdOptoRx_[56][3]; 00051 bool fedIdOptoRxFiber_[56][3][12]; 00052 00053 protected : 00054 00055 static const int bDHEAD, bDH, bDEL, bDERR, bDRUN, bDRUNTYPE, bDTRGTYPE, bDCOMFLAG, bDORBIT; 00056 static const int bDVMINOR, bDVMAJOR, bDCH, bDOPTO; 00057 static const int sDHEAD, sDH, sDEL, sDERR, sDRUN, sDRUNTYPE, sDTRGTYPE, sDCOMFLAG, sDORBIT; 00058 static const int sDVMINOR, sDVMAJOR, sDCH, sDOPTO; 00059 00060 static const int bKEC, bKFLAG2, bKBC, bKFLAG1, bKET, bKCRC, bKCE, bKID, bFIBER, bKHEAD1, bKHEAD2; 00061 static const int sKEC, sKFLAG2, sKBC, sKFLAG1, sKET, sKCRC, sKCE, sKID, sFIBER, sKHEAD1, sKHEAD2; 00062 static const int bKHEAD; 00063 static const int sKHEAD; 00064 static const int bHEAD, bE1, bE0, bSTRIP, bPACE, bADC2, bADC1, bADC0; 00065 static const int sHEAD, sE1, sE0, sSTRIP, sPACE, sADC2, sADC1, sADC0; 00066 00067 static const int bOEMUTTCEC, bOEMUTTCBC, bOEMUKEC, bOHEAD ; 00068 static const int sOEMUTTCEC, sOEMUTTCBC, sOEMUKEC, sOHEAD ; 00069 00070 }; 00071 00072 #endif