53 findingRecord<SiStripBadModuleRcd>();
76 auto quality = std::make_unique<SiStripQuality>();
81 edm::LogInfo(
"SiStripQualityConfigurableFakeESSource")<<
"[produce] number of selected dets to be removed " << selDetIds.size() <<std::endl;
84 for (
const auto selId : selDetIds ) {
87 unsigned short firstBadStrip{0};
88 unsigned short NconsecutiveBadStrips =
reader.getNumberOfApvsAndStripLength(selId).first * 128;
89 unsigned int theBadStripRange{
quality->encode(firstBadStrip,NconsecutiveBadStrips)};
92 ss <<
"detid " << selId <<
" \t" 93 <<
" firstBadStrip " << firstBadStrip <<
"\t " 94 <<
" NconsecutiveBadStrips " << NconsecutiveBadStrips <<
"\t " 95 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec 99 theSiStripVector.push_back(theBadStripRange);
102 edm::LogError(
"SiStripQualityConfigurableFakeESSource") <<
"[produce] detid already exists";
106 edm::LogInfo(
"SiStripQualityConfigurableFakeESSource") << ss.str();
112 std::stringstream ss1;
113 for (
const auto& badComp :
quality->getBadComponentList() ) {
114 ss1 <<
"bad module " << badComp.detid <<
" " << badComp.BadModule <<
"\n";
116 edm::LogInfo(
"SiStripQualityConfigurableFakeESSource") << ss1.str();
123 bool _isSel( uint32_t requested, uint32_t
i )
125 return ( requested == 0 ) || ( requested ==
i );
141 std::vector<uint32_t> selList;
142 std::stringstream ss;
145 if (
m_printDebug) ss <<
"Bad SubDet " << subDetStr <<
" \t";
148 const std::vector<uint32_t> genericBadDetIds{badComp.getUntrackedParameter<std::vector<uint32_t>>(
"detidList", std::vector<uint32_t>())};
149 const bool anySubDet{ ! genericBadDetIds.empty() };
151 std::cout <<
"genericBadDetIds.size() = " << genericBadDetIds.size() << std::endl;
153 using DetIdIt = std::vector<uint32_t>::const_iterator;
158 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList),
159 [&genericBadDetIds] ( uint32_t detId ) {
160 std::cout <<
"AnySubDet" << detId << std::endl;
161 return std::find(genericBadDetIds.begin(), genericBadDetIds.end(), detId) != genericBadDetIds.end();
166 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList),
167 [tTopo,&badComp] ( uint32_t detectorId ) {
168 const DetId detId{detectorId};
170 && _isSel(badComp.getParameter<uint32_t>(
"layer") , tTopo->
tibLayer(detId))
171 && _isSel(badComp.getParameter<uint32_t>(
"bkw_frw"), tTopo->
tibIsZPlusSide(detId) ? 2 : 1 )
172 && _isSel(badComp.getParameter<uint32_t>(
"int_ext"), tTopo->
tibIsInternalString(detId) ? 1 : 2 )
173 && _isSel(badComp.getParameter<uint32_t>(
"ster") , tTopo->
tibIsStereo(detId) ? 1 : ( tTopo->
tibIsRPhi(detId) ? 2 : -1 ))
174 && _isSel(badComp.getParameter<uint32_t>(
"string_"), tTopo->
tibString(detId))
175 && _isSel(badComp.getParameter<uint32_t>(
"detid") , detId.rawId())
180 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList),
181 [tTopo,&badComp] ( uint32_t detectorId ) {
182 const DetId detId{detectorId};
184 && _isSel(badComp.getParameter<uint32_t>(
"wheel"), tTopo->
tidWheel(detId))
185 && _isSel(badComp.getParameter<uint32_t>(
"side") , tTopo->
tidIsZPlusSide(detId) ? 2 : 1 )
186 && _isSel(badComp.getParameter<uint32_t>(
"ster") , tTopo->
tidIsStereo(detId) ? 1 : ( tTopo->
tidIsRPhi(detId) ? 2 : -1 ) )
187 && _isSel(badComp.getParameter<uint32_t>(
"ring") , tTopo->
tidRing(detId))
188 && _isSel(badComp.getParameter<uint32_t>(
"detid"), detId.rawId())
193 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList),
194 [tTopo,&badComp] ( uint32_t detectorId ) {
195 const DetId detId{detectorId};
197 && _isSel(badComp.getParameter<uint32_t>(
"layer") , tTopo->
tobLayer(detId))
198 && _isSel(badComp.getParameter<uint32_t>(
"bkw_frw"), tTopo->
tobIsZPlusSide(detId) ? 2 : 1)
199 && _isSel(badComp.getParameter<uint32_t>(
"ster") , tTopo->
tobIsStereo(detId) ? 1 : ( tTopo->
tobIsRPhi(detId) ? 2 : -1 ))
200 && _isSel(badComp.getParameter<uint32_t>(
"rod") , tTopo->
tobRod(detId))
201 && _isSel(badComp.getParameter<uint32_t>(
"detid") , detId.rawId())
206 std::copy_if(beginDetIt, endDetIt, std::back_inserter(selList),
207 [tTopo,&badComp] ( uint32_t detectorId ) {
208 const DetId detId{detectorId};
210 && _isSel(badComp.getParameter<uint32_t>(
"wheel") , tTopo->
tecWheel(detId))
211 && _isSel(badComp.getParameter<uint32_t>(
"side") , tTopo->
tecIsZPlusSide(detId) ? 2 : 1 )
212 && _isSel(badComp.getParameter<uint32_t>(
"ster") , tTopo->
tecIsStereo(detId) ? 1 : 2 )
213 && _isSel(badComp.getParameter<uint32_t>(
"petal_bkw_frw"), tTopo->
tecIsFrontPetal(detId) ? 2 : 2)
214 && _isSel(badComp.getParameter<uint32_t>(
"petal") , tTopo->
tecPetalNumber(detId))
215 && _isSel(badComp.getParameter<uint32_t>(
"ring") , tTopo->
tecRing(detId))
216 && _isSel(badComp.getParameter<uint32_t>(
"detid") , detId.rawId())
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int tibLayer(const DetId &id) const
unsigned int tibString(const DetId &id) const
unsigned int tidRing(const DetId &id) const
bool tobIsStereo(const DetId &id) const
std::vector< edm::ParameterSet > Parameters
unsigned int tecRing(const DetId &id) const
ring id
static const IOVSyncValue & endOfTime()
unsigned int tidWheel(const DetId &id) const
~SiStripBadModuleConfigurableFakeESSource() override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool tobIsRPhi(const DetId &id) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
bool tidIsStereo(const DetId &id) const
uint32_t rawId() const
get the raw id
const DepRecordT & getRecord() const
bool tibIsZPlusSide(const DetId &id) const
bool tecIsStereo(const DetId &id) const
std::unique_ptr< SiStripBadStrip > ReturnType
bool tibIsRPhi(const DetId &id) const
static const IOVSyncValue & beginOfTime()
bool tobIsZPlusSide(const DetId &id) const
SiStripBadModuleConfigurableFakeESSource(const edm::ParameterSet &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
bool tecIsFrontPetal(const DetId &id) const
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
bool tidIsRPhi(const DetId &id) const
bool tidIsZPlusSide(const DetId &id) const
std::vector< uint32_t > selectDetectors(const TrackerTopology *tTopo, const std::vector< uint32_t > &detIds) const
bool tibIsStereo(const DetId &id) const
bool tecIsZPlusSide(const DetId &id) const
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
unsigned int tecPetalNumber(const DetId &id) const
ReturnType produce(const SiStripBadModuleRcd &)
Parameters m_badComponentList
unsigned int tobRod(const DetId &id) const
bool tibIsInternalString(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
T const * product() const
unsigned int tobLayer(const DetId &id) const