30 bx_min_(
config.getParameter<
int>(
"bxMin")),
31 bx_max_(
config.getParameter<
int>(
"bxMax")),
32 ignore_eod_(
config.getParameter<
bool>(
"ignoreEOD")),
33 event_type_(
config.getParameter<
int>(
"eventType")),
34 ufov_(
config.getParameter<unsigned
int>(
"uFOV")) {
35 produces<FEDRawDataCollection>();
44 desc.add<
int>(
"bxMin", -2);
45 desc.add<
int>(
"bxMax", 2);
46 desc.add<
bool>(
"ignoreEOD",
true);
47 desc.add<
int>(
"eventType", 1);
48 desc.add<
unsigned int>(
"uFOV", 1);
49 descs.
add(
"RPCTwinMuxDigiToRaw",
desc);
56 for (
auto const& tm_link : es_tm_link_map->
getMap()) {
62 std::sort(fed_amcs.second.begin(), fed_amcs.second.end());
63 fed_amcs.second.erase(
std::unique(fed_amcs.second.begin(), fed_amcs.second.end()), fed_amcs.second.end());
80 std::map<RPCAMCLink, std::vector<std::pair<int, rpctwinmux::RPCRecord> > > amc_bx_tmrecord;
85 event.bunchCrossing(),
90 std::map<int, FEDRawData> fed_data;
92 for (std::pair<
const int, std::vector<RPCAMCLink> >
const& fed_amcs :
fed_amcs_) {
103 std::memcpy(
data.data() +
size * 8, &block_header.getRecord(), 8);
107 data.resize((
size + fed_amcs.second.size()) * 8);
108 unsigned int block_content_size(0);
110 std::map<RPCAMCLink, std::vector<std::pair<int, rpctwinmux::RPCRecord> > >::const_iterator bx_tmrecord(
111 amc_bx_tmrecord.find(
amc));
112 unsigned int block_amc_size(3 + 2 * (bx_tmrecord == amc_bx_tmrecord.end() ? 0 : bx_tmrecord->second.size()));
113 block_content_size += block_amc_size;
115 true,
true,
true,
true,
true,
true,
true, block_amc_size, 0,
amc.getAMCNumber(), 0);
116 std::memcpy(
data.data() +
size * 8, &amc_content.getRecord(), 8);
121 data.resize((
size + block_content_size) * 8);
124 std::map<RPCAMCLink, std::vector<std::pair<int, rpctwinmux::RPCRecord> > >::const_iterator bx_tmrecord(
125 amc_bx_tmrecord.find(
amc));
126 unsigned int block_amc_size(3 + 2 * (bx_tmrecord == amc_bx_tmrecord.end() ? 0 : bx_tmrecord->second.size()));
130 event.bunchCrossing(),
132 event.eventAuxiliary().orbitNumber(),
135 std::memcpy(
data.data() +
size * 8, tm_header.getRecord(), 16);
138 if (bx_tmrecord != amc_bx_tmrecord.end()) {
139 for (
std::vector<std::pair<int, rpctwinmux::RPCRecord> >::const_iterator tmrecord = bx_tmrecord->second.begin();
140 tmrecord != bx_tmrecord->second.end();
142 std::memcpy(
data.data() +
size * 8, tmrecord->second.getRecord(), 16);
148 std::memcpy(
data.data() +
size * 8, &tm_trailer.getRecord(), 8);
157 std::memcpy(
data.data() +
size * 8, &block_trailer.getRecord(), 8);