97 desc.
add<
bool>(
"skipRpc",
false);
98 desc.
add<
bool>(
"skipCsc",
false);
99 desc.
add<
bool>(
"skipDt",
false);
100 desc.
add<
bool>(
"useRpcConnectionFile",
false);
103 descriptions.
add(
"omtfPacker", desc);
132 std::list<unsigned int> amcIds = {1, 3, 5, 7, 9, 11};
133 std::list<unsigned int>
fedIds = {1380, 1381};
134 for (
auto&
fedId : fedIds) {
135 for (
auto& amcId : amcIds) {
136 raws[std::make_pair(
fedId, amcId)];
173 for (
auto&
fedId : fedIds) {
178 for (
const auto& it : raws) {
179 if (
fedId != it.first.first)
181 const std::vector<Word64>& amcData = it.second;
182 unsigned int amcId = it.first.second;
183 for (
const auto& raw : amcData) {
184 std::ostringstream dataStr;
193 LogTrace(
"") <<
" fed: " <<
fedId <<
" amcId: " << amcId <<
" RAW DATA: " << dataStr.str() << std::endl;
195 amc13.
add(amcId, 43981, evtId, orbit, bxId, amcData);
200 const unsigned int slinkHeaderSize = 8;
201 const unsigned int slinkTrailerSize = 8;
202 unsigned int size = (amc13.
size()) *
sizeof(
Word64) + slinkHeaderSize + slinkTrailerSize;
205 unsigned char* payload_start =
payload;
208 const unsigned int evtType = 1;
209 header.
set(payload, evtType, evtId, bxId,
fedId);
211 amc13.
write(ev, payload, slinkHeaderSize, size - slinkHeaderSize - slinkTrailerSize);
213 payload += slinkHeaderSize;
214 payload += amc13.
size() * 8;
223 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.
std::map< std::pair< unsigned int, unsigned int >, std::vector< Word64 > > FedAmcRawsMap
EventAuxiliary const & eventAuxiliary() const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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)
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
#define DEFINE_FWK_MODULE(type)
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)