32 {{
"GTTPromptJets", 2, 6},
33 {
"GTTDisplacedJets", 6, 10},
34 {
"GTTPromptHtSum", 10, 11},
35 {
"GTTDisplacedHtSum", 11, 12},
37 {
"GTTHadronicTaus", 13, 16},
38 {
"CL2JetsSC4", 24, 28},
39 {
"CL2JetsSC8", 28, 32},
43 {
"GCTNonIsoEg", 48, 50},
49 {
"GMTSaPromptMuons", 60, 62},
50 {
"GMTSaDisplacedMuons", 62, 64},
51 {
"GMTTkMuons", 64, 67},
53 {
"CL2Electrons", 80, 83},
54 {
"CL2Photons", 83, 86},
55 {
"GTTPhiCandidates", 104, 107},
56 {
"GTTRhoCandidates", 107, 110},
57 {
"GTTBsCandidates", 110, 113},
58 {
"GTTPrimaryVert", 113, 115}}};
61 {{
"GTTPromptJets", 2, 6},
62 {
"GTTDisplacedJets", 6, 10},
63 {
"GTTPromptHtSum", 10, 11},
64 {
"GTTDisplacedHtSum", 11, 12},
66 {
"GTTHadronicTaus", 13, 16},
67 {
"GCTNonIsoEg", 26, 28},
70 {
"CL2JetsSC4", 32, 36},
71 {
"CL2JetsSC8", 36, 40},
75 {
"GMTSaPromptMuons", 68, 70},
76 {
"GMTSaDisplacedMuons", 70, 72},
77 {
"GMTTkMuons", 72, 75},
79 {
"CL2Electrons", 80, 83},
80 {
"CL2Photons", 83, 86},
83 {
"GCTEtSum", 99, 100},
84 {
"GTTPhiCandidates", 112, 115},
85 {
"GTTRhoCandidates", 115, 118},
86 {
"GTTBsCandidates", 118, 121},
87 {
"GTTPrimaryVert", 121, 123}}};
97 std::vector<std::unique_ptr<L1TGT_BaseInterface>> fillCollection(
100 void endJob()
override;
141 gmtSaDisplacedMuonsToken_(
153 gttDisplacedHtSumToken_(
170 config.getParameter<unsigned
int>(
"maxLines"),
175 channelMap.insert({{
name,
i -
start}, {{1, 0}, {
i}}});
211 desc.add<
unsigned int>(
"maxLines", 1024);
216 edm::allowedValues<std::string>(
"VU9P",
"VU13P"));
221 template <
typename T>
224 std::vector<std::unique_ptr<L1TGT_BaseInterface>> outputCollection;
227 outputCollection.push_back(std::make_unique<T>(T::from_GTObject(
object)));
230 return outputCollection;
233 template <
typename...
Args>
234 static std::vector<ap_uint<64>>
vpack(
const Args&... vobjects) {
235 std::vector<ap_uint<64>> vpacked;
238 [&vpacked](
const std::vector<std::unique_ptr<l1t::L1TGT_BaseInterface>>&
objects) {
239 std::optional<ap_uint<64>> next_packed;
240 for (
const auto&
object :
objects) {
241 if (
object->packed_width() == 64) {
243 vpacked.emplace_back(interface_obj.
pack());
244 }
else if (
object->packed_width() == 96) {
246 ap_uint<96> packed = interface_obj.
pack();
247 if (next_packed.has_value()) {
248 vpacked.emplace_back(packed(95, 64) << 32 | next_packed.value());
251 next_packed = packed(95, 64);
254 vpacked.emplace_back(packed(63, 0));
256 }
else if (
object->packed_width() == 128) {
258 ap_uint<128> packed = interface_obj.
pack();
259 vpacked.emplace_back(packed(63, 0));
260 vpacked.emplace_back(packed(127, 64));
270 std::map<std::string, std::vector<std::unique_ptr<L1TGT_BaseInterface>>> outputObjects;
275 outputObjects.emplace(
"GCTTaus", fillCollection<L1TGT_GCT_tau6p6>(
event,
gctTausToken_));
278 outputObjects.emplace(
"GMTSaPromptMuons",
280 outputObjects.emplace(
"GMTSaDisplacedMuons",
282 outputObjects.emplace(
"GMTTkMuons", fillCollection<L1TGT_GMT_TrackMatchedmuon>(
event,
gmtTkMuonsToken_));
283 outputObjects.emplace(
"GMTTopo", fillCollection<L1TGT_GMT_TopoObject>(
event,
gmtTopoToken_));
296 outputObjects.emplace(
"CL2Taus", fillCollection<L1TGT_CL2_Tau>(
event,
cl2TausToken_));
302 std::map<demo::LinkId, std::vector<ap_uint<64>>> eventData;
306 std::size_t numChannels =
end -
start;
308 for (std::size_t
j =
i -
start;
j <
data.size();
j += numChannels) {
312 while (eventData[{
name,
i -
start}].size() < 9) {
const edm::EDGetTokenT< P2GTCandidateCollection > gttPromptHtSumToken_
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static constexpr std::array< std::tuple< const char *, std::size_t, std::size_t >, 27 > OUTPUT_CHANNELS_VU13P
const edm::EDGetTokenT< P2GTCandidateCollection > gttEtSumToken_
const edm::EDGetTokenT< P2GTCandidateCollection > cl2HtSumToken_
static std::vector< ap_uint< 64 > > vpack(const Args &... vobjects)
const edm::EDGetTokenT< P2GTCandidateCollection > gctEtSumToken_
std::vector< P2GTCandidate > P2GTCandidateCollection
const edm::EDGetTokenT< P2GTCandidateCollection > gmtSaDisplacedMuonsToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gttBsCandidatesToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gttDisplacedJetsToken_
const edm::EDGetTokenT< P2GTCandidateCollection > cl2TausToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< P2GTCandidateCollection > gttDisplacedHtSumToken_
const edm::EDGetTokenT< P2GTCandidateCollection > cl2EtSumToken_
l1t::demo::BoardDataWriter boardDataWriter_
void addEvent(const EventData &data)
const edm::EDGetTokenT< P2GTCandidateCollection > gmtTkMuonsToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gctTausToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gctNonIsoEgToken_
FileFormat parseFileFormat(const std::string &)
const edm::EDGetTokenT< P2GTCandidateCollection > cl2ElectronsToken_
const edm::EDGetTokenT< P2GTCandidateCollection > cl2JetsSc4Token_
const edm::EDGetTokenT< P2GTCandidateCollection > cl2JetsSc8Token_
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< P2GTCandidateCollection > gctIsoEgToken_
std::vector< std::unique_ptr< L1TGT_BaseInterface > > fillCollection(const edm::Event &event, const edm::EDGetTokenT< P2GTCandidateCollection > &token) const
const edm::EDGetTokenT< P2GTCandidateCollection > gttPromptJetsToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gctHtSumToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gttPhiCandidatesToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gctJetsToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gttHadronicTausToken_
const edm::EDGetTokenT< P2GTCandidateCollection > gmtSaPromptMuonsToken_
#define DEFINE_FWK_MODULE(type)
L1GTOutputObjectWriter(const edm::ParameterSet &)
const edm::EDGetTokenT< P2GTCandidateCollection > cl2PhotonsToken_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::map< LinkId, std::pair< ChannelSpec, std::vector< size_t > > > ChannelMap_t
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< P2GTCandidateCollection > gmtTopoToken_
const std::array< std::tuple< const char *, std::size_t, std::size_t >, 27 > outputChannelDef_
virtual ap_uint< N > pack() const =0
char data[epos_bytes_allocation]
const edm::EDGetTokenT< P2GTCandidateCollection > gttRhoCandidatesToken_
static constexpr std::array< std::tuple< const char *, std::size_t, std::size_t >, 27 > OUTPUT_CHANNELS_VU9P
const edm::EDGetTokenT< P2GTCandidateCollection > gttPrimaryVertToken_