44 #include <boost/algorithm/string.hpp> 62 virtual void endJob()
override;
64 void readEvent(std::vector<uint32_t>& load32);
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)),
112 produces<FEDRawDataCollection>();
139 std::vector<uint32_t> load32;
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);
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
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
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.
size_t size() const
Lenght of the data buffer in bytes.
payload
payload postfix for testing
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void resize(size_t newsize)
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)