76{
77
79 int tot_acc = 0;
80
81 std::vector<float> chargeList;
82 if (calibData) chargeList.reserve(cluster.ids.size());
83
88 InDetDD::PixelDiodeTree::DiodeProxyWithPosition colmin_diode{};
89 InDetDD::PixelDiodeTree::DiodeProxyWithPosition colmax_diode{};
90 InDetDD::PixelDiodeTree::DiodeProxyWithPosition rowmin_diode{};
91 InDetDD::PixelDiodeTree::DiodeProxyWithPosition rowmax_diode{};
92
93
94
95
97
98 for (
size_t i = 0;
i < cluster.ids.size();
i++) {
99
100
101 Identifier id = Identifier(cluster.ids[i]);
102
103
104
105
106
107
108
109
110 int tot = cluster.tots.at(i);
112
113 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
117
118 if (calibData) {
119
120
121 std::uint32_t feValue = design.
getFE(si_param);
126 return StatusCode::FAILURE;
127 }
128
130 calibStrategy,
131 moduleHash,
132 feValue,
133 tot);
134 chargeList.push_back(
charge);
135 } else {
137 moduleHash,
138 feValue,
139 tot);
140
141
144 }
145 chargeList.push_back(
charge);
146 }
147 }
148
151 if (row>rowmax) {
153 rowmax_diode = si_param;
154 }
155 if (row<rowmin) {
157 rowmin_diode = si_param;
158 }
159 if (col>colmax) {
160 colmax=col;
161 colmax_diode = si_param;
162 }
163 if (col<colmin) {
164 colmin=col;
165 colmin_diode = si_param;
166 }
167
168
169
170
171
172
174 pos_acc +=
charge * si_param.position();
176 } else {
177 pos_acc += si_param.position();
178 tot_acc += 1;
179 }
180
181 }
182
183 if (tot_acc > 0)
184 pos_acc /= tot_acc;
185
186
187 const int colWidth = colmax - colmin + 1;
188 const int rowWidth = rowmax - rowmin + 1;
189
190 double etaWidth = colmax_diode.
xEtaMax() - colmin_diode.
xEtaMin();
192
193
196
198 double Ax[3] = {
T(0,0),
T(1,0),
T(2,0)};
199 double Ay[3] = {
T(0,1),
T(1,1),
T(2,1)};
200 double R [3] = {
T(0,3),
T(1,3),
T(2,3)};
201
203 Amg::Vector3D globalPos(M[0]*Ax[0]+M[1]*Ay[0]+R[0],M[0]*Ax[1]+M[1]*Ay[1]+R[1],M[0]*Ax[2]+M[1]*Ay[2]+R[2]);
204
205
206 float width0, width1;
208
210 width1 = etaWidth;
211 } else {
212
214 width1 = etaWidth / colWidth;
215 }
216
217
218
219 Eigen::Matrix<float,2,1> localPosition(locpos.x(), locpos.y());
220 Eigen::Matrix<float,2,2> localCovariance = Eigen::Matrix<float,2,2>::Zero();
221 localCovariance(0, 0) = width0 * width0 / 12.0f;
222 localCovariance(1, 1) = width1 * width1 / 12.0f;
223
224 xaodcluster.setMeasurement<2>(moduleHash, localPosition, localCovariance);
225 xaodcluster.setIdentifier( cluster.ids.front() );
226 xaodcluster.setRDOlist(std::move(cluster.ids));
227 xaodcluster.globalPosition() = globalPos.cast<float>();
229 xaodcluster.setToTlist(std::move(cluster.tots));
231 xaodcluster.setChargelist(std::move(chargeList));
232 xaodcluster.setLVL1A(cluster.lvl1min);
233 xaodcluster.setChannelsInPhiEta(rowWidth,colWidth);
234 xaodcluster.setWidthInEta(static_cast<float>(etaWidth));
235 xaodcluster.setIsSplit(false);
236 xaodcluster.setSplitProbabilities(0.0, 0.0);
237
238 return StatusCode::SUCCESS;
239}
double charge(const T &p)
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
PixelReadoutTechnology getReadoutTechnology() const
static InDetDD::PixelDiodeType getDiodeType(const PixelDiodeTree::DiodeProxy &diode_proxy)
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
Trk::Surface & surface()
Element Surface.
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
row
Appending html table to final .html summary file.
float computeTotalCharge(const SG::AuxElement &cluster)
int computeTotalToT(const SG::AuxElement &cluster)
double xPhiMax() const
for backward compatibility, return the position of the lower edge of the diode in local-y(phi,...
double xEtaMin() const
for backward compatibility, return the position of the lower edge of the diode in local-y(eta,...
double xPhiMin() const
for backward compatibility, return the position of the lower edge of the diode in local-x(phi,...
double xEtaMax() const
for backward compatibility, return the position of the upper edge of the diode in local-y(eta,...