111 desc.add<
bool>(
"skipRpc",
false);
112 desc.add<
bool>(
"skipCsc",
false);
113 desc.add<
bool>(
"skipDt",
false);
114 desc.add<
bool>(
"useRpcConnectionFile",
false);
117 descriptions.
add(
"omtfPacker",
desc);
149 std::list<unsigned int> amcIds = {1, 3, 5, 7, 9, 11};
150 std::list<unsigned int>
fedIds = {1380, 1381};
152 for (
auto& amcId : amcIds) {
153 raws[std::make_pair(
fedId, amcId)];
186 auto bxId =
ev.bunchCrossing();
187 auto evtId =
ev.id().event();
188 auto orbit =
ev.eventAuxiliary().orbitNumber();
195 for (
const auto& it : raws) {
196 if (
fedId != it.first.first)
198 const std::vector<Word64>& amcData = it.second;
199 unsigned int amcId = it.first.second;
200 for (
const auto& raw : amcData) {
201 std::ostringstream dataStr;
210 LogTrace(
"") <<
" fed: " <<
fedId <<
" amcId: " << amcId <<
" RAW DATA: " << dataStr.str() << std::endl;
212 amc13.add(amcId, 43981, evtId, orbit, bxId, amcData);
217 const unsigned int slinkHeaderSize = 8;
218 const unsigned int slinkTrailerSize = 8;
219 unsigned int size = (
amc13.size()) *
sizeof(
Word64) + slinkHeaderSize + slinkTrailerSize;
222 unsigned char* payload_start =
payload;
225 const unsigned int evtType = 1;
240 using namespace omtf;
T getParameter(std::string const &) const
std::map< std::pair< unsigned int, unsigned int >, std::vector< Word64 > > FedAmcRawsMap
std::string fullPath() const
edm::ESGetToken< RPCAMCLinkMap, RPCOMTFLinkMapRcd > theAmcMappingToken
#define DEFINE_FWK_MODULE(type)
T const * product() const
void produce(edm::Event &ev, const edm::EventSetup &es) override
edm::ParameterSet theConfig
void pack(const RPCDigiCollection *prod, FedAmcRawsMap &raws)
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
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.
edm::ESGetToken< RPCEMap, RPCEMapRcd > theRPCEMapToken
void init(const RPCEMap &readoutMapping, const RPCAMCLinkMap &linkMap)
OmtfPacker(const edm::ParameterSet &pset)
void resize(size_t newsize)
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
edm::EDGetTokenT< RPCDigiCollection > theRpcToken
void pack(const CSCCorrelatedLCTDigiCollection *prod, FedAmcRawsMap &raws)
bool getData(T &iHolder) const
void pack(const L1MuDTChambPhContainer *phCont, const L1MuDTChambThContainer *thCont, FedAmcRawsMap &raws)
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > theCscToken
edm::EDGetTokenT< L1MuDTChambThContainer > theDtThToken
unsigned long theEventCounter
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< L1MuDTChambPhContainer > theDtPhToken
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)