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