51 std::vector<std::pair<uint32_t, std::vector<uint32_t>>>
selectAPVs()
const;
60 findingRecord<SiStripBadModuleRcd>();
85 auto quality = std::make_unique<SiStripQuality>();
90 <<
"[produce] number of selected dets to be removed " << selDetIds.size() << std::endl;
93 for (
const auto selId : selDetIds) {
96 unsigned short firstBadStrip{0};
98 unsigned int theBadStripRange{
quality->encode(firstBadStrip, NconsecutiveBadStrips)};
101 ss <<
"detid " << selId <<
" \t"
102 <<
" firstBadStrip " << firstBadStrip <<
"\t "
103 <<
" NconsecutiveBadStrips " << NconsecutiveBadStrips <<
"\t "
104 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec << std::endl;
107 theSiStripVector.push_back(theBadStripRange);
110 edm::LogError(
"SiStripQualityConfigurableFakeESSource") <<
"[produce] detid already exists";
114 edm::LogInfo(
"SiStripQualityConfigurableFakeESSource") <<
ss.str();
119 std::vector<std::pair<uint32_t, std::vector<uint32_t>>> selAPVs{
selectAPVs()};
121 <<
"[produce] number of selected dets to be removed " << selAPVs.size() << std::endl;
123 std::stringstream
ss;
124 for (
const auto& selId : selAPVs) {
126 auto the_detid = selId.first;
128 for (
const auto apv : selId.second) {
129 unsigned short firstBadStrip = apv * 128;
130 unsigned short NconsecutiveBadStrips = 128;
131 unsigned int theBadStripRange{
quality->encode(firstBadStrip, NconsecutiveBadStrips)};
134 ss <<
"detid " << the_detid <<
" \t"
135 <<
" firstBadStrip " << firstBadStrip <<
"\t "
136 <<
" NconsecutiveBadStrips " << NconsecutiveBadStrips <<
"\t "
137 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec << std::endl;
140 theSiStripVector.push_back(theBadStripRange);
144 edm::LogError(
"SiStripQualityConfigurableFakeESSource") <<
"[produce] detid already exists";
149 edm::LogInfo(
"SiStripQualityConfigurableFakeESSource") <<
ss.str();
156 std::stringstream ss1;
157 for (
const auto& badComp :
quality->getBadComponentList()) {
158 ss1 <<
"bad module " << badComp.detid <<
" " << badComp.BadModule <<
"\n";
160 edm::LogInfo(
"SiStripQualityConfigurableFakeESSource") << ss1.str();
167 bool _isSel(uint32_t requested,
169 return (requested == 0) || (requested ==
i);
174 if (subDetStr ==
"TIB")
176 else if (subDetStr ==
"TID")
178 else if (subDetStr ==
"TOB")
180 else if (subDetStr ==
"TEC")
187 std::vector<std::pair<uint32_t, std::vector<uint32_t>>> selList;
191 const uint32_t det{badAPV.getParameter<uint32_t>(
"DetId")};
192 std::vector<uint32_t> apvs{badAPV.getParameter<std::vector<uint32_t>>(
"APVs")};
193 auto pair = std::make_pair(det, apvs);
194 selList.push_back(pair);
200 const TrackerTopology* tTopo,
const std::vector<uint32_t>& detIds)
const {
201 std::vector<uint32_t> selList;
202 std::stringstream
ss;
206 ss <<
"Bad SubDet " << subDetStr <<
" \t";
209 const std::vector<uint32_t> genericBadDetIds{
210 badComp.getUntrackedParameter<std::vector<uint32_t>>(
"detidList", std::vector<uint32_t>())};
211 const bool anySubDet{!genericBadDetIds.empty()};
213 std::cout <<
"genericBadDetIds.size() = " << genericBadDetIds.size() << std::endl;
215 using DetIdIt = std::vector<uint32_t>::const_iterator;
222 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList), [&genericBadDetIds](uint32_t detId) {
223 std::cout <<
"AnySubDet" << detId << std::endl;
224 return std::find(genericBadDetIds.begin(), genericBadDetIds.end(), detId) != genericBadDetIds.end();
229 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList), [tTopo, &badComp](uint32_t detectorId) {
230 const DetId detId{detectorId};
232 _isSel(badComp.getParameter<uint32_t>(
"layer"), tTopo->
tibLayer(detId)) &&
233 _isSel(badComp.getParameter<uint32_t>(
"bkw_frw"), tTopo->
tibIsZPlusSide(detId) ? 2 : 1) &&
234 _isSel(badComp.getParameter<uint32_t>(
"int_ext"), tTopo->
tibIsInternalString(detId) ? 1 : 2) &&
235 _isSel(badComp.getParameter<uint32_t>(
"ster"),
237 _isSel(badComp.getParameter<uint32_t>(
"string_"), tTopo->
tibString(detId)) &&
238 _isSel(badComp.getParameter<uint32_t>(
"detid"), detId.rawId()));
242 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList), [tTopo, &badComp](uint32_t detectorId) {
243 const DetId detId{detectorId};
245 _isSel(badComp.getParameter<uint32_t>(
"wheel"), tTopo->
tidWheel(detId)) &&
246 _isSel(badComp.getParameter<uint32_t>(
"side"), tTopo->
tidIsZPlusSide(detId) ? 2 : 1) &&
247 _isSel(badComp.getParameter<uint32_t>(
"ster"),
249 _isSel(badComp.getParameter<uint32_t>(
"ring"), tTopo->
tidRing(detId)) &&
250 _isSel(badComp.getParameter<uint32_t>(
"detid"), detId.rawId()));
254 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList), [tTopo, &badComp](uint32_t detectorId) {
255 const DetId detId{detectorId};
257 _isSel(badComp.getParameter<uint32_t>(
"layer"), tTopo->
tobLayer(detId)) &&
258 _isSel(badComp.getParameter<uint32_t>(
"bkw_frw"), tTopo->
tobIsZPlusSide(detId) ? 2 : 1) &&
259 _isSel(badComp.getParameter<uint32_t>(
"ster"),
261 _isSel(badComp.getParameter<uint32_t>(
"rod"), tTopo->
tobRod(detId)) &&
262 _isSel(badComp.getParameter<uint32_t>(
"detid"), detId.rawId()));
266 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList), [tTopo, &badComp](uint32_t detectorId) {
267 const DetId detId{detectorId};
269 _isSel(badComp.getParameter<uint32_t>(
"wheel"), tTopo->
tecWheel(detId)) &&
270 _isSel(badComp.getParameter<uint32_t>(
"side"), tTopo->
tecIsZPlusSide(detId) ? 2 : 1) &&
271 _isSel(badComp.getParameter<uint32_t>(
"ster"), tTopo->
tecIsStereo(detId) ? 1 : 2) &&
272 _isSel(badComp.getParameter<uint32_t>(
"petal_bkw_frw"), tTopo->
tecIsFrontPetal(detId) ? 2 : 2) &&
273 _isSel(badComp.getParameter<uint32_t>(
"petal"), tTopo->
tecPetalNumber(detId)) &&
274 _isSel(badComp.getParameter<uint32_t>(
"ring"), tTopo->
tecRing(detId)) &&
275 _isSel(badComp.getParameter<uint32_t>(
"detid"), detId.rawId()));