204 {
205
208
209
210 const InDetDD::PixelModuleDesign* design = (
dynamic_cast<const InDetDD::PixelModuleDesign*
>(&element->
design()));
211 if (not design){
212 throw std::runtime_error( "Dynamic cast failed for design in ClusterMakerTool.cxx");
213 }
214 int rowMin = design->rows();
215 int rowMax = 0;
216 int colMin = design->columns();
217 int colMax = 0;
218 float qRowMin = 0; float qRowMax = 0;
219 float qColMin = 0; float qColMax = 0;
220 std::vector<float> chargeList;
221 int nRDO=rdoList.size();
222 if (calibData) {
223 chargeList.reserve(nRDO);
225 for (
int i=0;
i<nRDO;
i++) {
226 Identifier pixid=rdoList[
i];
228
231 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
234 InDetDD::PixelDiodeTree::DiodeProxy si_param ( design->diodeProxyFromIdx(diode_idx));
235 std::uint32_t feValue = design->getFE(si_param);
236 auto diode_type = design->getDiodeType(si_param);
238 && design->numberOfConnectedCells( design->readoutIdOfCell(InDetDD::SiCellId(diode_idx[0],diode_idx[1])))>1) {
240 }
241
244 charge = ToT/8.0*(8000.0-1200.0)+1200.0;
245 }
246 chargeList.push_back(
charge);
247 }
248 }
249
250 for (
int i=0;
i<nRDO;
i++) {
251 Identifier pixid=rdoList[
i];
253
255 if (calibData) {
charge=chargeList[
i]; }
256
257
260 if (row == rowMin) qRowMin +=
charge;
261 if (row < rowMin){
264 }
265
266 if (row == rowMax) qRowMax +=
charge;
267 if (row > rowMax){
270 }
271 if (col == colMin) qColMin +=
charge;
272 if (col < colMin){
273 colMin = col;
275 }
276
277 if (col == colMax) qColMax +=
charge;
278 if (col > colMax){
279 colMax = col;
281 }
282 }
283
284 Identifier newClusterID = pixelID.
pixel_id(pixelID.
wafer_id(clusterID),rowMin,colMin);
285
286
287 float omegax = -1;
288 float omegay = -1;
289 if(qRowMin+qRowMax > 0) omegax = qRowMax/
float(qRowMin+qRowMax);
290 if(qColMin+qColMax > 0) omegay = qColMax/
float(qColMin+qColMax);
291
293
294
297
299 double Ax[3] = {
T(0,0),
T(1,0),
T(2,0)};
300 double Ay[3] = {
T(0,1),
T(1,1),
T(2,1)};
301 double R [3] = {
T(0,3),
T(1,3),
T(2,3)};
302
304 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]);
305
306
308
310 errorMatrix.setIdentity();
311
312
313
314
315 double eta = std::abs(globalPos.eta());
316 double zPitch =
width.z()/colRow.y();
317
318 const AtlasDetectorID* aid = element->
getIdHelper();
319
321 throw std::runtime_error( "Wrong helper type in ClusterMakerTool.cxx.");
322 }
323 const PixelID*
pid =
static_cast<const PixelID*
>(aid);
324 int layer =
pid->layer_disk(clusterID);
326 switch (errorStrategy){
327 case 0:
328 errorMatrix.fillSymmetric(0,0,square(
width.phiR())*ONE_TWELFTH);
329 errorMatrix.fillSymmetric(1,1,square(
width.z())*ONE_TWELFTH);
330 break;
331 case 1:
332 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
333 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
334 break;
335 case 2:
336
337
338
339 if (!ganged && zPitch>399*micrometer && zPitch<401*micrometer) {
340 if (offlineCalibData) {
345 errorMatrix.fillSymmetric(0,0,
pow(phiError,2));
346 errorMatrix.fillSymmetric(1,1,
pow(etaError,2));
347 }
348 else {
352 errorMatrix.fillSymmetric(0,0,square(phiError));
353 errorMatrix.fillSymmetric(1,1,square(etaError));
354 }
355 }
356 }else{
357 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
358 errorMatrix.fillSymmetric(1,1,square(zPitch)*ONE_TWELFTH);
359 }
360 break;
361
362 case 10:
364 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
365 break;
366
367 default:
368 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
369 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
370 break;
371 }
372
373
374
375
376
377 static_assert(std::is_same_v<ClusterType, PixelCluster> ||
378 std::is_same_v<std::remove_pointer_t<ClusterType>,
380 "Not an InDet::PixelCluster or xAOD::PixelCluster");
381 if constexpr (std::is_same<ClusterType, InDet::PixelCluster>::value) {
382 return newInDetpixelCluster(newClusterID, locpos,
383 globalPos,
384 std::forward<IdentifierVec>(rdoList),
385 lvl1a,
386 std::forward<ToTList>(totList),
387 std::move(chargeList),
389 element,
390 std::move(errorMatrix),
391 omegax,
392 omegay,
394 splitProb1,
395 splitProb2);
396 } else{
397 return AddNewxAODpixelCluster(*cluster)(newClusterID,
398 locpos,
399 globalPos,
400 std::forward<IdentifierVec>(rdoList),
401 lvl1a,
402 std::forward<ToTList>(totList),
403 chargeList,
405 element,
406 errorMatrix,
408 splitProb1,
409 splitProb2);
410 }
411}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_VERBOSE(x)
double charge(const T &p)
virtual HelperType helper() const
Type of helper, defaulted to 'Unimplemented'.
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.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline).
Trk::Surface & surface()
Element Surface.
float getPixelEndcapRError(int ibin) const
float getPixelBarrelEtaError(int ibin) const
int getBarrelBin(double eta, int etaClusterSize, int phiClusterSize) const
int getEndcapBin(int etaClusterSize, int phiClusterSize) const
float getPixelEndcapPhiError(int ibin) const
float getPixelBarrelPhiError(int ibin) const
PixelClusterErrorData * getPixelClusterErrorData()
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
int eta_index(const Identifier &id) const
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
int phi_index(const Identifier &id) const
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
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)
phimod(flags, cells_name, *args, **kw)
float etaError(const U &p)
row
Appending html table to final .html summary file.
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the container.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.