File indexing completed on 2024-04-06 12:10:39
0001 #ifndef ESDATAFORMATTERV4_H
0002 #define ESDATAFORMATTERV4_H
0003
0004 #include <iostream>
0005 #include <vector>
0006 #include <bitset>
0007 #include <sstream>
0008 #include <map>
0009 #include <fstream>
0010
0011 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0012 #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
0013 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0014 #include "DataFormats/FEDRawData/interface/FEDRawData.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 #include "FWCore/ParameterSet/interface/FileInPath.h"
0017 #include "EventFilter/ESDigiToRaw/interface/ESDataFormatter.h"
0018
0019 class ESDigiToRaw;
0020
0021 class ESDataFormatterV4 : public ESDataFormatter {
0022 public:
0023 typedef ESDataFormatter::DetDigis DetDigis;
0024 typedef ESDataFormatter::Digis Digis;
0025
0026 typedef ESDataFormatter::Word8 Word8;
0027 typedef ESDataFormatter::Word16 Word16;
0028 typedef ESDataFormatter::Word32 Word32;
0029 typedef ESDataFormatter::Word64 Word64;
0030
0031 ESDataFormatterV4(const edm::ParameterSet& ps);
0032 ~ESDataFormatterV4() override;
0033
0034 void DigiToRaw(int fedId, Digis& digis, FEDRawData& fedRawData, Meta_Data const& meta_data) const override;
0035
0036 private:
0037 edm::FileInPath lookup_;
0038 int fedId_[2][2][40][40];
0039 int kchipId_[2][2][40][40];
0040 int paceId_[2][2][40][40];
0041 int bundleId_[2][2][40][40];
0042 int fiberId_[2][2][40][40];
0043 int optoId_[2][2][40][40];
0044
0045 bool fedIdOptoRx_[56][3];
0046 bool fedIdOptoRxFiber_[56][3][12];
0047
0048 protected:
0049 static const int bDHEAD, bDH, bDEL, bDERR, bDRUN, bDRUNTYPE, bDTRGTYPE, bDCOMFLAG, bDORBIT;
0050 static const int bDVMINOR, bDVMAJOR, bDCH, bDOPTO;
0051 static const int sDHEAD, sDH, sDEL, sDERR, sDRUN, sDRUNTYPE, sDTRGTYPE, sDCOMFLAG, sDORBIT;
0052 static const int sDVMINOR, sDVMAJOR, sDCH, sDOPTO;
0053
0054 static const int bKEC, bKFLAG2, bKBC, bKFLAG1, bKET, bKCRC, bKCE, bKID, bFIBER, bKHEAD1, bKHEAD2;
0055 static const int sKEC, sKFLAG2, sKBC, sKFLAG1, sKET, sKCRC, sKCE, sKID, sFIBER, sKHEAD1, sKHEAD2;
0056 static const int bKHEAD;
0057 static const int sKHEAD;
0058 static const int bHEAD, bE1, bE0, bSTRIP, bPACE, bADC2, bADC1, bADC0;
0059 static const int sHEAD, sE1, sE0, sSTRIP, sPACE, sADC2, sADC1, sADC0;
0060
0061 static const int bOEMUTTCEC, bOEMUTTCBC, bOEMUKEC, bOHEAD;
0062 static const int sOEMUTTCEC, sOEMUTTCBC, sOEMUKEC, sOHEAD;
0063 };
0064
0065 #endif