130 edm::LogInfo(
"SiStripBadChannelPatcher") <<
"... creating dummy SiStripBadStrip Data";
133 auto obj = std::make_unique<SiStripBadStrip>();
139 std::vector<uint32_t> detids;
144 for (
const auto&
id : detids) {
147 edm::LogInfo(
"SiStripBadChannelPatcher") <<
"I AM GOING TO EXCLUDE DETID: " <<
id;
150 LogDebug(
"SiStripBadChannelPatcher") <<
"I AM GOING TO KEEP DETID: " <<
id;
156 edm::LogInfo(
"SiStripBadChannelPatcher") <<
"I AM GOING TO EXCLUDE DETID: " <<
id;
159 LogDebug(
"SiStripBadChannelPatcher") <<
"I AM GOING TO KEEP DETID: " <<
id;
163 std::vector<unsigned int> theSiStripVector;
164 unsigned int theBadStripRange;
165 for (std::vector<unsigned int>::const_iterator badStrip =
range.first; badStrip !=
range.second; ++badStrip) {
166 unsigned short firstBadStrip =
payload.decode(*badStrip).firstStrip;
167 unsigned short nConsecutiveBadStrips =
payload.decode(*badStrip).range;
168 theBadStripRange =
obj->encode(firstBadStrip, nConsecutiveBadStrips);
169 theSiStripVector.push_back(theBadStripRange);
172 if (!
obj->put(
id, outRange))
173 edm::LogError(
"SiStripBadChannelPatcher") <<
"[SiStripBadChannelPatcher::analyze] detid already exists";
176 const auto& detInfo =
180 const std::vector<uint32_t>& allDetIds = detInfo.
getAllDetIds();
185 edm::LogInfo(
"SiStripBadChannelPatcher") <<
"I AM GOING TO ADD MORE DETIDS";
187 std::stringstream
ss;
189 edm::LogInfo(
"SiStripBadChannelPatcher") <<
"I AM GOING TO ADD DETID: " << detid;
190 const auto& nAPVs = detInfo.getNumberOfApvsAndStripLength(detid).first;
192 std::vector<unsigned int> theSiStripVector;
193 unsigned short firstBadStrip{0}, nConsecutiveBadStrips{0};
194 unsigned int theBadStripRange;
196 for (
unsigned int n = 0;
n < nAPVs;
n++) {
199 theBadStripRange =
obj->encode(firstBadStrip, nConsecutiveBadStrips);
202 ss <<
"detid " << detid <<
" \t" 203 <<
" firstBadStrip " << firstBadStrip <<
"\t " 204 <<
" nConsecutiveBadStrips " << nConsecutiveBadStrips <<
"\t " 205 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec << std::endl;
208 theSiStripVector.push_back(theBadStripRange);
212 if (!
obj->put(detid, outRange))
213 edm::LogError(
"SiStripBadChannelPatcher") <<
"[SiStripBadChannelPatcher::analyze] detid already exists";
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void addDetIdsFromExcludedFEDs(const std::vector< uint32_t > &allDetIds)
const edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcd > badStripToken_
unsigned int fedFromDetId(const uint32_t &detid)
std::vector< unsigned int > fedsToExclude_
SiStripDetInfo read(std::string filePath)
Log< level::Info, false > LogInfo
std::vector< uint32_t > detIdsToExclude_
static const uint16_t STRIPS_PER_APV
std::pair< ContainerIterator, ContainerIterator > Range
static constexpr char const *const kDefaultFile
std::vector< uint32_t > detIdsToInclude_
const std::vector< uint32_t > & getAllDetIds() const noexcept
const edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > cablingToken_
const SiStripDetCabling * detCabling_