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;
131 LogDebug(
"L1T") <<
"AMC13 size " << amc13.size();
139 LogDebug(
"L1T") <<
"Packing FED ID " <<
fedId_ <<
" size " << fed_data.size();
150 while (getline(
file_, line) && !line.empty()) {
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;
183 auto evtId = iEvent.
id().
event();
193 payload += amc13.
size() * 8;
EventNumber_t event() const
void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
AMCDumpToRaw(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
unsigned int size() const
int bunchCrossing() const
void add(unsigned int amc_no, unsigned int board, unsigned int lv1id, unsigned int orbit, unsigned int bx, const std::vector< uint64_t > &load, unsigned int user=0)
bool write(const edm::Event &ev, unsigned char *ptr, unsigned int skip, unsigned int size) const
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)
tuple size
Write out results.