10 const std::vector<CTPPSPixelCluster> &
clusters,
11 std::vector<CTPPSPixelRecHit> &
hits,
14 edm::LogInfo(
"PPS") <<
" RPixClusterToHit " << detId <<
" received cluster array of size = " <<
clusters.size();
15 for (
unsigned int i = 0;
i <
clusters.size();
i++) {
21 std::vector<CTPPSPixelRecHit> &
hits,
29 unsigned int thisClusterSize = aCluster.
size();
30 unsigned int thisClusterRowSize = aCluster.
sizeRow();
31 unsigned int thisClusterColSize = aCluster.
sizeCol();
34 unsigned int thisClusterMinRow = aCluster.
minPixelRow();
35 unsigned int thisClusterMinCol = aCluster.
minPixelCol();
38 bool anEdgePixel =
false;
45 bool aBadPixel =
false;
46 for (
unsigned int i = 0;
i < thisClusterSize;
i++) {
55 for (
unsigned int i = 1;
i < thisClusterSize;
i++) {
63 double avgWLocalX = 0;
64 double avgWLocalY = 0;
66 double weightedVarianceX = 0.;
67 double weightedVarianceY = 0.;
73 for (
unsigned int i = 0;
i < thisClusterSize;
i++) {
84 double halfSizeX = (maxPxlX - minPxlX) / 2.;
85 double halfSizeY = (maxPxlY - minPxlY) / 2.;
86 double avgPxlX = minPxlX + halfSizeX;
87 double avgPxlY = minPxlY + halfSizeY;
89 weightedVarianceX += aCluster.
pixelADC(
i) * aCluster.
pixelADC(
i) * halfSizeX * halfSizeX / 3.;
90 weightedVarianceY += aCluster.
pixelADC(
i) * aCluster.
pixelADC(
i) * halfSizeY * halfSizeY / 3.;
92 avgWLocalX += avgPxlX * aCluster.
pixelADC(
i);
93 avgWLocalY += avgPxlY * aCluster.
pixelADC(
i);
98 edm::LogError(
"RPixClusterToHit") <<
" unexpected weights = 0 for cluster (Row_min, Row_max, Col_min, Col_max) = ("
105 double invWeights = 1. /
weights;
106 double avgLocalX = avgWLocalX * invWeights;
107 double avgLocalY = avgWLocalY * invWeights;
109 double varianceX = weightedVarianceX * invWeights * invWeights;
110 double varianceY = weightedVarianceY * invWeights * invWeights;
115 edm::LogInfo(
"PPS") <<
"RPixClusterToHit " << lp <<
" with error " << le;
117 hits.emplace_back(lp,