87 std::vector<std::vector<uint64_t>>
data_;
109 filename_(iConfig.getUntrackedParameter<
std::
string>(
"filename")),
110 outDir_(iConfig.getUntrackedParameter<
std::
string>(
"outDir")),
111 nChan_(iConfig.getUntrackedParameter<unsigned>(
"nChanPerQuad")),
112 nQuad_(iConfig.getUntrackedParameter<unsigned>(
"nQuads")),
113 nHeaderFrames_(iConfig.getUntrackedParameter<unsigned>(
"nHeaderFrames")),
114 nPayloadFrames_(iConfig.getUntrackedParameter<unsigned>(
"nPayloadFrames")),
115 nClearFrames_(iConfig.getUntrackedParameter<unsigned>(
"nClearFrames")) {
126 LogDebug(
"L1TDebug") <<
"Preparing for " <<
nLink_ <<
" links" << std::endl;
147 std::vector<l1t::PFCandidate>
const& pfCands = *pfHandle;
149 std::vector<l1t::PFCandidate> pfPartsA;
150 std::vector<l1t::PFCandidate> pfPartsB;
152 for (
auto const& pfc : pfCands) {
155 pfPartsA.push_back(pfc);
158 pfPartsB.push_back(pfc);
161 if (pfPartsA.empty() && pfPartsB.empty())
168 for (
unsigned iQuad = 0; iQuad <
nQuad_; ++iQuad) {
169 for (
unsigned iChan = 0; iChan <
nChan_; ++iChan) {
171 data_.at(iLink).push_back(0);
183 for (
unsigned iQuad = 0; iQuad <
nQuad_; ++iQuad) {
184 for (
unsigned iChan = 0; iChan <
nChan_; ++iChan) {
191 if (iLink < 24 && pfPartsA.size() > iLink) {
198 if (iLink < 24 && pfPartsB.size() > iLink) {
228 unsigned int nOutFiles =
ceil((
float)
nEvents_ / (
float)evPerFile);
232 LogDebug(
"L1TDebug") <<
"Writing " << nOutFiles <<
" files" << std::endl;
233 LogDebug(
"L1TDebug") <<
"Output directory: ./" <<
outDir_ <<
"/" << std::endl;
236 std::vector<std::ofstream> outFiles(nOutFiles);
239 for (
uint itFile = 0; itFile < nOutFiles; ++itFile) {
240 std::stringstream outFilename;
242 outFiles[itFile] = std::ofstream(outFilename.str());
243 LogDebug(
"L1TDebug") <<
"Writing to file: ./" << outFilename.str() << std::endl;
245 outFiles[itFile] <<
"Board SRNTY_TEST" << std::endl;
248 outFiles[itFile] <<
" Quad/Chan : ";
251 outFiles[itFile] <<
" q" << setfill(
'0') << setw(2) <<
i <<
"c" <<
j <<
" ";
254 outFiles[itFile] << std::endl;
257 outFiles[itFile] <<
" Link : ";
260 outFiles[itFile] <<
" " << setfill(
'0') << setw(2) << (
i *
nChan_) +
j <<
" ";
264 outFiles[itFile] << std::endl;
267 unsigned iFileFrame = 0;
270 outFiles[itFile] <<
"Frame " <<
std::dec << std::setw(4) << std::setfill(
'0') << iFileFrame <<
" : ";
271 for (
unsigned iQuad = 0; iQuad <
nQuad_; ++iQuad) {
272 for (
unsigned iChan = 0; iChan <
nChan_; ++iChan) {
273 unsigned iLink = (iQuad *
nChan_) + iChan;
274 if (iLink <
data_.size() && iFrame <
data_.at(iLink).size()) {
275 outFiles[itFile] << std::hex << ::std::setw(1) <<
dataValid_.at(iFrame) <<
"v" << std::hex
276 << std::setw(16) << std::setfill(
'0') <<
data_.at(iLink).at(iFrame) <<
" ";
278 outFiles[itFile] << std::hex << ::std::setw(1) << 0 <<
"v" << std::hex << std::setw(16)
279 << std::setfill(
'0') << 0 <<
" ";
284 outFiles[itFile] << std::endl;
287 outFiles[itFile].close();
294 desc.addUntracked<
unsigned int>(
"nPayloadFrames", 40);
295 desc.addUntracked<
unsigned int>(
"nHeaderFrames", 1);
298 desc.addUntracked<
unsigned int>(
"nChanPerQuad", 4);
299 desc.addUntracked<
unsigned int>(
"nClearFrames", 13);
300 desc.addUntracked<
unsigned int>(
"nQuads", 18);
301 descriptions.
add(
"l1tS2PFJetInputPatternWriter",
desc);
constexpr int32_t ceil(float num)
#define DEFINE_FWK_MODULE(type)
unsigned long long uint64_t
void add(std::string const &label, ParameterSetDescription const &psetDescription)
char data[epos_bytes_allocation]