102 desc.
add<
bool>(
"skipRpc",
false);
103 desc.
add<
bool>(
"skipCsc",
false);
104 desc.
add<
bool>(
"skipDt",
false);
105 desc.
add<
bool>(
"useRpcConnectionFile",
false);
108 descriptions.
add(
"omtfPacker",desc);
139 std::list<unsigned int> amcIds = { 1, 3, 5, 7, 9, 11};
140 std::list<unsigned int> fedIds = { 1380, 1381};
141 for (
auto &
fedId : fedIds) {
for (
auto & amcId : amcIds) { raws[std::make_pair(
fedId, amcId)]; } }
176 for (
auto &
fedId : fedIds) {
182 for (
const auto & it : raws) {
183 if (
fedId != it.first.first)
continue;
184 const std::vector<Word64> & amcData = it.second;
185 unsigned int amcId = it.first.second;
186 for (
const auto & raw : amcData) {
187 std::ostringstream dataStr;
192 LogTrace(
"")<<
" fed: "<<
fedId <<
" amcId: "<<amcId<<
" RAW DATA: " << dataStr.str() << std::endl;
194 amc13.
add(amcId, 43981, evtId, orbit, bxId, amcData);
199 const unsigned int slinkHeaderSize = 8;
200 const unsigned int slinkTrailerSize = 8;
201 unsigned int size = (amc13.
size()) *
sizeof(
Word64)+slinkHeaderSize+slinkTrailerSize;
204 unsigned char * payload_start =
payload;
207 const unsigned int evtType = 1;
208 header.
set(payload, evtType, evtId, bxId,
fedId);
210 amc13.
write(ev, payload, slinkHeaderSize, size - slinkHeaderSize - slinkTrailerSize);
212 payload += slinkHeaderSize;
213 payload += amc13.
size() * 8;
224 using namespace omtf;
T getParameter(std::string const &) const
EventNumber_t event() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
EventAuxiliary const & eventAuxiliary() const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#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)
std::map< std::pair< unsigned int, unsigned int >, std::vector< Word64 > > FedAmcRawsMap
void produce(edm::Event &ev, const edm::EventSetup &es) override
bool write(const edm::Event &ev, unsigned char *ptr, unsigned int skip, unsigned int size) const
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.
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)
void pack(const L1MuDTChambPhContainer *phCont, const L1MuDTChambThContainer *thCont, FedAmcRawsMap &raws)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > theCscToken
edm::EDGetTokenT< L1MuDTChambThContainer > theDtThToken
T const * product() const
unsigned long theEventCounter
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< L1MuDTChambPhContainer > theDtPhToken
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
std::string fullPath() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void init(const edm::EventSetup &es)