12 if (dynamic_cast<const PixelGeomDetUnit*>(gdet) ==
nullptr) {
14 "TkPhase2OTMeasurementDet constructed with a GeomDet which is not a PixelGeomDetUnit");
40 std::vector<float>& diffs)
const {
44 auto oldSize =
result.size();
47 auto begin = &(
data.phase2OTData().handle()->data().front());
48 auto reject = [&](
auto ci) ->
bool {
49 return (!
data.phase2OTClustersToSkip().empty()) &&
data.phase2OTClustersToSkip()[ci - begin];
53 auto firstCluster = detSet.
begin();
54 auto lastCluster = detSet.
end();
73 int colMin =
ymin.y();
74 int colMax =
ymax.y();
76 return int(
hit.column()) >= colMin;
78 lastCluster = std::find_if(
82 while (firstCluster != lastCluster) {
83 auto const col = firstCluster->column();
84 auto endCluster = std::find_if(
87 auto rightCluster = std::find_if(
90 if (rightCluster != firstCluster) {
92 auto leftCluster = rightCluster;
93 while (--leftCluster >= firstCluster) {
94 if (reject(leftCluster))
102 diffs.push_back(diffEst.second);
105 for (; rightCluster != endCluster; rightCluster++) {
106 if (reject(rightCluster))
114 diffs.push_back(diffEst.second);
116 firstCluster = endCluster;
118 return result.size() > oldSize;
137 if (!
data.phase2OTData().handle()->data().empty()) {
138 begin = &(
data.phase2OTData().handle()->data().front());
144 edm::LogError(
"IndexMisMatch") <<
"TkPhase2OTMeasurementDet cannot create hit because of index mismatch.";
147 unsigned int index = ci - begin;
148 if (!
data.phase2OTClustersToSkip().empty() &&
index >=
data.phase2OTClustersToSkip().size()) {
149 edm::LogError(
"IndexMisMatch") <<
"TkPhase2OTMeasurementDet cannot create hit because of index mismatch. i.e "
150 <<
index <<
" >= " <<
data.phase2OTClustersToSkip().size();
153 if (
data.phase2OTClustersToSkip().empty()
or (not
data.phase2OTClustersToSkip()[
index])) {
157 LogDebug(
"TkPhase2OTMeasurementDet") <<
"skipping this cluster from last iteration on "