10 const std::vector<CTPPSPixelCluster> &
clusters,
11 std::vector<CTPPSPixelRecHit> &
hits) {
13 edm::LogInfo(
"RPixClusterToHit") <<
" RPixClusterToHit " << detId
14 <<
" received cluster array of size = " <<
clusters.size();
15 for (
unsigned int i = 0;
i <
clusters.size();
i++) {
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.;
72 for (
unsigned int i = 0;
i < thisClusterSize;
i++) {
82 double halfSizeX = (maxPxlX - minPxlX) / 2.;
83 double halfSizeY = (maxPxlY - minPxlY) / 2.;
84 double avgPxlX = minPxlX + halfSizeX;
85 double avgPxlY = minPxlY + halfSizeY;
87 weightedVarianceX += aCluster.
pixelADC(
i) * aCluster.
pixelADC(
i) * halfSizeX * halfSizeX / 3.;
88 weightedVarianceY += aCluster.
pixelADC(
i) * aCluster.
pixelADC(
i) * halfSizeY * halfSizeY / 3.;
90 avgWLocalX += avgPxlX * aCluster.
pixelADC(
i);
91 avgWLocalY += avgPxlY * aCluster.
pixelADC(
i);
96 edm::LogError(
"RPixClusterToHit") <<
" unexpected weights = 0 for cluster (Row_min, Row_max, Col_min, Col_max) = ("
103 double invWeights = 1. /
weights;
104 double avgLocalX = avgWLocalX * invWeights;
105 double avgLocalY = avgWLocalY * invWeights;
107 double varianceX = weightedVarianceX * invWeights * invWeights;
108 double varianceY = weightedVarianceY * invWeights * invWeights;
123 edm::LogInfo(
"RPixClusterToHit") << lp <<
" with error " << le;