40 void endJob()
override;
50 std::map<l1t::demo::LinkId, std::vector<ap_uint<64>>>
linkData_;
54 template <
typename T, std::
size_t N>
55 static std::array<T, N>
convert(std::vector<T> vec,
const char*
name) {
56 if (vec.size() !=
N) {
58 <<
"The parameter '" <<
name <<
"' should have " <<
N <<
" elements, but has " << vec.size()
59 <<
" elements in the configuration.\n";
62 std::copy_n(std::make_move_iterator(vec.begin()),
N,
a.begin());
68 maxEvents_(
config.getUntrackedParameter<unsigned
int>(
"maxEvents")),
71 algoBitMask_(
convert<unsigned long long, 9>(
72 config.getUntrackedParameter<
std::
vector<unsigned long long>>(
"algoBitMask"),
"algoBitMask")),
80 config.getUntrackedParameter<unsigned
int>(
"maxFrames"),
83 for (
unsigned int channel :
channels) {
94 auto algoBlockIt = algoBlocks.begin();
99 linkData_[{
"Algos", channel}] = std::vector<ap_uint<64>>(18, 0);
103 ap_uint<64>
mask = algoMaskIt !=
algoBitMask_.end() ? *algoMaskIt++ : ~static_cast<
unsigned long long>(0);
105 for (std::size_t
idx = 0;
idx < 64 && algoBlockIt != algoBlocks.end();
idx++, algoBlockIt++) {
106 auto& [
algoName, algoBlock] = *algoBlockIt;
108 idx, algoBlock.decisionBeforeBxMaskAndPrescale() &&
mask.bit(
idx));
139 desc.addUntracked<
unsigned int>(
"maxEvents", 0);
140 desc.addUntracked<std::vector<unsigned int>>(
"channels");
141 desc.addUntracked<std::vector<unsigned long long>>(
"algoBitMask",
142 {0xffffffffffffffffull,
143 0xffffffffffffffffull,
144 0xffffffffffffffffull,
145 0xffffffffffffffffull,
146 0xffffffffffffffffull,
147 0xffffffffffffffffull,
148 0xffffffffffffffffull,
149 0xffffffffffffffffull,
150 0xffffffffffffffffull});
151 desc.addUntracked<
unsigned int>(
"maxFrames", 1024);
const std::array< unsigned long long, 9 > algoBitMask_
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
static std::array< T, N > convert(std::vector< T > vec, const char *name)
unsigned int eventCounter_
const edm::EDGetTokenT< P2GTAlgoBlockMap > algoBlocksToken_
void addEvent(const EventData &data)
std::map< std::string, P2GTAlgoBlock > P2GTAlgoBlockMap
FileFormat parseFileFormat(const std::string &)
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void analyze(const edm::Event &, const edm::EventSetup &) override
void addDefault(ParameterSetDescription const &psetDescription)
L1GTAlgoBoardWriter(const edm::ParameterSet &)
const std::array< unsigned int, 2 > channels_
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< LinkId, std::pair< ChannelSpec, std::vector< size_t > > > ChannelMap_t
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< l1t::demo::LinkId, std::vector< ap_uint< 64 > > > linkData_
Class representing information phase-2 ATCA I/O data corresponding to a single event, with logical channel IDs (essentially string-uint pairs, e.g. tracks-0 to tracks-17).
l1t::demo::BoardDataWriter boardDataWriter_