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};
151 for (
auto&
fedId : fedIds) {
152 for (
auto& amcId : amcIds) {
153 raws[std::make_pair(
fedId, amcId)];
190 for (
auto&
fedId : fedIds) {
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;
226 header.
set(payload, evtType, evtId, bxId,
fedId);
228 amc13.
write(ev, payload, slinkHeaderSize, size - slinkHeaderSize - slinkTrailerSize);
230 payload += slinkHeaderSize;
231 payload += amc13.
size() * 8;
240 using namespace omtf;
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::ESGetToken< RPCAMCLinkMap, RPCOMTFLinkMapRcd > theAmcMappingToken
#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)
void produce(edm::Event &ev, const edm::EventSetup &es) override
EventAuxiliary const & eventAuxiliary() const override
bool write(const edm::Event &ev, unsigned char *ptr, unsigned int skip, unsigned int size) const
edm::ParameterSet theConfig
bool getData(T &iHolder) const
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)
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
T getParameter(std::string const &) const
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.
std::string fullPath() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
tuple size
Write out results.