23 #define EDM_ML_DEBUG 1
79 fedId_(config.getParameter<int>(
"FedId"))
82 produces<FEDRawDataCollection>();
111 auto bxId =
event.bunchCrossing();
112 auto evtId =
event.id().event();
113 auto orbit =
event.eventAuxiliary().orbitNumber();
117 auto amc_no = item.first.first;
118 auto board = item.first.second;
119 auto packers = item.second;
122 for (
const auto& packer: packers) {
123 LogDebug(
"L1T") <<
"Adding packed blocks";
125 block_load.insert(block_load.end(),
blocks.begin(),
blocks.end());
128 std::sort(block_load.begin(), block_load.end());
130 LogDebug(
"L1T") <<
"Concatenating blocks";
132 std::vector<uint32_t> load32;
136 load32.push_back(
fwId_);
137 for (
const auto&
block: block_load) {
138 LogDebug(
"L1T") <<
"Adding block " <<
block.header().getID() <<
" with size " <<
block.payload().size();
142 std::stringstream
s(
"");
143 s <<
"Block content:" << std::endl << std::hex << std::setfill(
'0');
144 for (
const auto& word:
load)
145 s << std::setw(8) << word << std::endl;
149 load32.push_back(
block.header().raw(
MP7));
150 load32.insert(load32.end(), load.begin(), load.end());
153 LogDebug(
"L1T") <<
"Converting payload";
155 std::vector<uint64_t> load64;
156 for (
unsigned int i = 0;
i < load32.size();
i += 2) {
158 if (
i + 1 < load32.size()) {
159 word |=
static_cast<uint64_t>(load32[
i + 1]) << 32;
161 word |=
static_cast<uint64_t>(0xffffffff) << 32;
163 load64.push_back(word);
166 LogDebug(
"L1T") <<
"Creating AMC packet";
168 amc13.add(amc_no, board, evtId, orbit, bxId, load64);
175 fed_data.resize(
size);
176 unsigned char * payload = fed_data.data();
177 unsigned char * payload_start = payload;
185 payload += amc13.size() * 8;
229 desc.
add<
unsigned int>(
"FWId", -1);
230 desc.
add<
int>(
"FedId");
239 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
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.