44 #include <boost/algorithm/string.hpp>
62 virtual void endJob()
override;
64 void readEvent(std::vector<uint32_t>& load32);
102 filename_(iConfig.getUntrackedParameter<std::
string>(
"filename",
"data.txt")),
103 fedId_(iConfig.getUntrackedParameter<int>(
"fedId", 1)),
104 iAmc_(iConfig.getUntrackedParameter<int>(
"iAmc", 1)),
105 boardId_(iConfig.getUntrackedParameter<int>(
"boardId", 1)),
106 evType_(iConfig.getUntrackedParameter<int>(
"eventType", 1)),
107 fwVer_(iConfig.getUntrackedParameter<int>(
"fwVersion", 1)),
108 slinkHeaderSize_(iConfig.getUntrackedParameter<int>(
"lenSlinkHeader", 8)),
109 slinkTrailerSize_(iConfig.getUntrackedParameter<int>(
"lenSlinkTrailer", 8))
112 produces<FEDRawDataCollection>();
139 std::vector<uint32_t> load32;
145 LogDebug(
"L1T") <<
"AMC13 size " << amc13.size();
153 LogDebug(
"L1T") <<
"Packing FED ID " <<
fedId_ <<
" size " << fed_data.size();
156 iEvent.
put(raw_coll);
168 while (getline(
file_, line) && !line.empty() ) {
170 std::istringstream iss(line);
172 iss >> std::hex >>
d;
174 load32.push_back( d ) ;
187 std::vector<uint64_t> load64;
188 for (
unsigned int i = 0;
i < load32.size();
i += 2) {
190 if (
i + 1 < load32.size())
191 word |= static_cast<uint64_t>(load32[
i + 1]) << 32;
192 load64.push_back(word);
209 unsigned char * payload = fed_data.
data();
210 unsigned char * payload_start = payload;
213 auto evtId = iEvent.
id().
event();
223 payload += amc13.
size() * 8;
virtual void beginJob() override
EventNumber_t event() const
virtual void produce(edm::Event &, const edm::EventSetup &) override
AMCDumpToRaw(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
unsigned int size() const
int bunchCrossing() const
bool write(const edm::Event &ev, unsigned char *ptr, unsigned int skip, unsigned int size) const
static void set(unsigned char *trailer, int evt_lgth, int crc, int evt_stat, int tts, bool T=false)
Set all fields in the trailer.
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void resize(size_t newsize)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void endJob() override
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
unsigned long long uint64_t
void add(unsigned int amc_no, unsigned int board, unsigned int lv1id, unsigned int orbit, unsigned int bx, const std::vector< uint64_t > &load)
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.