19 maskBad128StripBlocks(conf.getParameter<
bool>(
"MaskBadAPVFibers")),
34 desc.add<
bool>(
"useSiStripQuality",
false);
35 desc.add<
bool>(
"MaskBadAPVFibers",
false);
36 desc.add<
bool>(
"doMatching",
true);
60 for (
auto const& DS : *inputhandle) {
67 bool bad128StripBlocks[6];
71 for (
auto const& cluster : DS) {
72 if (
isMasked(cluster, bad128StripBlocks))
80 if (collector.
empty())
90 struct CollectorHelper {
96 Collector& m_collector;
97 CollectorMatched& m_collectorMatched;
99 std::vector<SiStripRecHit2D::ClusterRef::key_type>& m_matchedSteroClusters;
108 Add(CollectorHelper& ih) :
h(ih) {}
113 CollectorHelper& collector() {
return *
this; }
117 CollectorHelper(Collector& i_collector,
118 CollectorMatched& i_collectorMatched,
120 std::vector<SiStripRecHit2D::ClusterRef::key_type>& i_matchedSteroClusters)
122 m_collector(i_collector),
123 m_collectorMatched(i_collectorMatched),
124 m_fillerRphiUnm(i_fillerRphiUnm),
125 m_matchedSteroClusters(i_matchedSteroClusters) {}
128 if (!m_collectorMatched.empty()) {
129 nmatch += m_collectorMatched.
size();
131 edm = m_collectorMatched.end();
134 m_collector.push_back(*itm);
136 m_matchedSteroClusters.push_back(itm->stereoClusterRef().key());
138 m_collectorMatched.clear();
156 std::vector<SiStripRecHit2D::ClusterRef::key_type> matchedSteroClusters;
165 if (partnerId == 0) {
167 if (!rphiHits.
empty()) {
178 if (itStereoDet == edStereoDet) {
180 if (!rphiHits.
empty()) {
199 matchedSteroClusters.clear();
202 CollectorHelper chelper(collector, collectorMatched, fillerRphiUnm, matchedSteroClusters);
204 rphiHits.
begin(), rphiHits.
end(), stereoHits.
begin(), stereoHits.
end(), gluedDet, trackdirection, chelper);
205 nmatch += chelper.nmatch;
210 stereoSimpleHits.reserve(stereoHits.
size());
213 stereoSimpleHits.push_back(&*it);
218 &(*it), stereoSimpleHits.begin(), stereoSimpleHits.end(), collectorMatched, gluedDet, trackdirection);
219 if (collectorMatched.
size() > 0) {
220 nmatch += collectorMatched.
size();
222 edm = collectorMatched.
end();
225 collector.push_back(*itm);
227 matchedSteroClusters.push_back(itm->stereoClusterRef().key());
229 collectorMatched.
clear();
232 fillerRphiUnm.push_back(*it);
239 if (collector.empty())
243 if (fillerRphiUnm.empty())
244 fillerRphiUnm.abort();
248 std::sort(matchedSteroClusters.begin(), matchedSteroClusters.end());
251 if (!std::binary_search(matchedSteroClusters.begin(), matchedSteroClusters.end(), it->cluster().key())) {
252 fillerStereoUnm.push_back(*it);
255 if (fillerStereoUnm.empty())
256 fillerStereoUnm.abort();
267 if (itRPhiDet == edRPhiDet) {
268 if (!stereoHits.
empty()) {
276 edm::LogInfo(
"SiStripRecHitConverter") <<
"found\n" << nmatch <<
" matched RecHits\n";
283 for (
int j = 0;
j < 6;
j++) {
284 bad128StripBlocks[
j] = (badApvs & (1 <<
j));
286 for (
int j = 0;
j < 3;
j++) {
287 if (badFibers & (1 <<
j)) {
288 bad128StripBlocks[2 *
j + 0] =
true;
289 bad128StripBlocks[2 *
j + 1] =
true;
297 if (bad128StripBlocks[cluster.
firstStrip() >> 7]) {
299 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter() - 0.499999) >> 7]) {
304 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter() - 0.499999) >> 7]) {
314 if (stripdet ==
nullptr)
315 edm::LogWarning(
"SiStripRecHitConverter") <<
"Detid=" <<
id <<
" not found";