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,
unsigned int rowSpan() const
unsigned int pixelRow(unsigned int i) const
unsigned int size() const
Log< level::Error, false > LogError
const std::vector< uint16_t > & pixelADC() const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int minPixelRow() const
int getDefaultRowDetSize() const
RPixClusterToHit(edm::ParameterSet const &conf)
void pixelRange(unsigned int arow, unsigned int acol, double &lower_x, double &higher_x, double &lower_y, double &higher_y) const
Log< level::Info, false > LogInfo
void buildHits(unsigned int detId, const std::vector< CTPPSPixelCluster > &clusters, std::vector< CTPPSPixelRecHit > &hits, const PPSPixelTopology &ppt)
int getROCId(const int col, const int row) const
unsigned int minPixelCol() const
void make_hit(CTPPSPixelCluster aCluster, std::vector< CTPPSPixelRecHit > &hits, const PPSPixelTopology &ppt)
unsigned int pixelCol(unsigned int i) const
int getDefaultColDetSize() const
unsigned int colSpan() const
unsigned int sizeCol() const
unsigned int sizeRow() const