43 #include <boost/algorithm/string.hpp> 61 void readEvent(std::vector<uint32_t>& load32);
98 : filename_(iConfig.getUntrackedParameter<
std::
string>(
"filename",
"data.txt")),
99 fedId_(iConfig.getUntrackedParameter<
int>(
"fedId", 1)),
100 iAmc_(iConfig.getUntrackedParameter<
int>(
"iAmc", 1)),
101 boardId_(iConfig.getUntrackedParameter<
int>(
"boardId", 1)),
102 evType_(iConfig.getUntrackedParameter<
int>(
"eventType", 1)),
103 fwVer_(iConfig.getUntrackedParameter<
int>(
"fwVersion", 1)),
104 slinkHeaderSize_(iConfig.getUntrackedParameter<
int>(
"lenSlinkHeader", 8)),
105 slinkTrailerSize_(iConfig.getUntrackedParameter<
int>(
"lenSlinkTrailer", 8)) {
106 produces<FEDRawDataCollection>();
125 std::vector<uint32_t> load32;
151 std::istringstream iss(
line);
153 iss >> std::hex >>
d;
163 std::vector<uint64_t> load64;
164 for (
unsigned int i = 0;
i < load32.size();
i += 2) {
166 if (
i + 1 < load32.size())
167 word |= static_cast<uint64_t>(load32[
i + 1]) << 32;
168 load64.push_back(
word);
180 unsigned char* payload_start =
payload;
182 auto bxId =
iEvent.bunchCrossing();
183 auto evtId =
iEvent.id().event();
void produce(edm::Event &, const edm::EventSetup &) override
AMCDumpToRaw(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
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)
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)