23 #define EDM_ML_DEBUG 1
80 fedId_(config.getParameter<int>(
"FedId"))
83 produces<FEDRawDataCollection>();
112 auto bxId =
event.bunchCrossing();
113 auto evtId =
event.id().event();
114 auto orbit =
event.eventAuxiliary().orbitNumber();
118 auto amc_no = item.first.first;
119 auto board = item.first.second;
120 auto packers = item.second;
123 for (
const auto& packer: packers) {
124 LogDebug(
"L1T") <<
"Adding packed blocks";
126 block_load.insert(block_load.end(),
blocks.begin(),
blocks.end());
129 std::sort(block_load.begin(), block_load.end());
131 LogDebug(
"L1T") <<
"Concatenating blocks";
133 std::vector<uint32_t> load32;
137 load32.push_back(
fwId_);
138 for (
const auto&
block: block_load) {
139 LogDebug(
"L1T") <<
"Adding block " <<
block.header().getID() <<
" with size " <<
block.payload().size();
143 std::stringstream
s(
"");
144 s <<
"Block content:" << std::endl << std::hex << std::setfill(
'0');
145 for (
const auto& word:
load)
146 s << std::setw(8) << word << std::endl;
150 load32.push_back(
block.header().raw(
MP7));
151 load32.insert(load32.end(), load.begin(), load.end());
154 LogDebug(
"L1T") <<
"Converting payload";
156 std::vector<uint64_t> load64;
157 for (
unsigned int i = 0;
i < load32.size();
i += 2) {
159 if (
i + 1 < load32.size()) {
160 word |=
static_cast<uint64_t>(load32[
i + 1]) << 32;
162 word |=
static_cast<uint64_t>(0xffffffff) << 32;
164 load64.push_back(word);
167 LogDebug(
"L1T") <<
"Creating AMC packet";
169 amc13.add(amc_no, board, evtId, orbit, bxId, load64);
176 fed_data.resize(
size);
177 unsigned char * payload = fed_data.data();
178 unsigned char * payload_start = payload;
186 payload += amc13.size() * 8;
230 desc.
add<
unsigned int>(
"FWId", -1);
231 desc.
add<
int>(
"FedId");
240 descriptions.
add(
"l1tDigiToRaw", desc);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< PackerTokens > tokens_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
std::auto_ptr< PackingSetup > setup_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
#define DEFINE_FWK_MODULE(type)
std::auto_ptr< PackingSetup > make(const std::string &) const
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
static void set(unsigned char *trailer, int evt_lgth, int crc, int evt_stat, int tts, bool T=false)
Set all fields in the trailer.
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void fillDescription(edm::ParameterSetDescription &) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
std::vector< Block > Blocks
L1TDigiToRaw(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
unsigned long long uint64_t
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static const PackingSetupFactory * get()
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
tuple size
Write out results.