43 #include <boost/algorithm/string.hpp> 61 void readEvent(std::vector<uint32_t>& load32);
93 : filename_(iConfig.getUntrackedParameter<
std::
string>(
"filename",
"data.txt")),
94 fedId_(iConfig.getUntrackedParameter<
int>(
"fedId", 1)),
95 iAmc_(iConfig.getUntrackedParameter<
int>(
"iAmc", 1)),
96 boardId_(iConfig.getUntrackedParameter<
int>(
"boardId", 1)),
97 evType_(iConfig.getUntrackedParameter<
int>(
"eventType", 1)),
98 fwVer_(iConfig.getUntrackedParameter<
int>(
"fwVersion", 1)),
99 slinkHeaderSize_(iConfig.getUntrackedParameter<
int>(
"lenSlinkHeader", 8)),
100 slinkTrailerSize_(iConfig.getUntrackedParameter<
int>(
"lenSlinkTrailer", 8)) {
101 produces<FEDRawDataCollection>();
120 std::vector<uint32_t> load32;
146 std::istringstream iss(
line);
148 iss >> std::hex >>
d;
158 std::vector<uint64_t> load64;
159 for (
unsigned int i = 0;
i < load32.size();
i += 2) {
161 if (
i + 1 < load32.size())
162 word |= static_cast<uint64_t>(load32[
i + 1]) << 32;
163 load64.push_back(
word);
175 unsigned char* payload_start =
payload;
177 auto bxId =
iEvent.bunchCrossing();
178 auto evtId =
iEvent.id().event();
void produce(edm::Event &, const edm::EventSetup &) override
AMCDumpToRaw(const edm::ParameterSet &)
size_t size() const
Lenght of the data buffer in bytes.
void addDefault(ParameterSetDescription const &psetDescription)
static void set(unsigned char *trailer, uint32_t lenght, uint16_t crc, uint8_t evt_stat, uint8_t tts, bool moreTrailers=false)
Set all fields in the trailer.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void resize(size_t newsize)
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
#define DEFINE_FWK_MODULE(type)
Log< level::Info, false > LogInfo
unsigned long long uint64_t
void readEvent(std::vector< uint32_t > &load32)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void formatAMC(amc13::Packet &amc13, const std::vector< uint32_t > &load32)
void formatRaw(edm::Event &iEvent, amc13::Packet &amc13, FEDRawData &fed_data)