65 mutable std::atomic_flag
lock_ = ATOMIC_FLAG_INIT;
79 : tPixelDigi{consumes<edm::DetSetVector<PixelDigi>>(
pset.getParameter<
edm::InputTag>(
"InputLabel"))},
80 theBadPixelFEDChannelsToken{consumes<PixelFEDChannelCollection>(
pset.getParameter<
edm::InputTag>(
"InputLabel"))},
82 esConsumes<SiPixelFedCablingMap, SiPixelFedCablingMapRcd, edm::Transition::BeginLuminosityBlock>()),
83 putToken_{produces<FEDRawDataCollection>()},
84 usePhase1{
pset.getParameter<
bool>(
"UsePhase1")} {
88 edm::LogInfo(
"SiPixelRawToDigi") <<
" Use pilot blade data (FED 40)";
94 while (
lock_.test_and_set(std::memory_order_acquire))
96 auto rel = [](std::atomic_flag*
f) {
f->clear(std::memory_order_release); };
120 digiCounter += (di.data).
size();
121 digis[di.id] = di.data;
124 auto cache = luminosityBlockCache(
ev.getLuminosityBlock().index());
126 LogDebug(
"SiPixelDigiToRaw") <<
cache->cablingTree_->version();
131 for (
auto const& fedChannels : *pixelFEDChannelCollectionHandle) {
133 for (
const auto& fedChannel : fedChannels) {
135 if (
cache->cablingTree_->findItem(
path) !=
nullptr) {
136 detBadChannels.push_back(fedChannel);
139 <<
" FED " << fedChannel.fed <<
" Link " << fedChannel.link <<
" for module " << fedChannels.detId()
140 <<
" marked bad, but this channel does not exist in the cabling map" << endl;
143 if (!detBadChannels.empty())
144 badChannels.insert({fedChannels.detId(), std::move(detBadChannels)});
157 formatter.formatRawData(
ev.id().event(), rawdata, digis, badChannels);
160 for (
auto const* fed :
cache->cablingTree_->fedList()) {
161 LogDebug(
"SiPixelDigiToRaw") <<
" PRODUCE DATA FOR FED_id: " << fed->id();
163 PixelDataFormatter::RawData::iterator fedbuffer = rawdata.find(fed->id());
164 if (fedbuffer != rawdata.end())
169 LogDebug(
"SiPixelDigiToRaw").log([&](
auto&
l) {
170 l <<
"Words/Digis this ev: " << digiCounter <<
"(fm:" << formatter.nDigis() <<
")/" << formatter.nWords();
179 desc.add<
bool>(
"UsePhase1",
false);
180 desc.addUntracked<
bool>(
"Timing",
false)->setComment(
"deprecated");
181 descriptions.
add(
"siPixelRawData",
desc);