Make the pixel cluster container.
473 ATH_MSG_DEBUG(
"You are running the element-wise container creation method.");
477 std::make_unique<xAOD::PixelClusterContainer>(),
478 std::make_unique<xAOD::PixelClusterAuxContainer>()));
480 ATH_CHECK(pixelClustersHandle.isValid());
483 int rdoIndexCounter = 0;
485 for (
unsigned int i = 0;
i <
metadata->numOfPixelClusters;
i++) {
487 auto pixelCl = pixelClustersHandle->push_back(
488 std::make_unique<xAOD::PixelCluster>());
490 Eigen::Matrix<float, 2, 1> localPosition(
492 Eigen::Matrix<float, 2, 2> localCovariance;
493 localCovariance.setZero();
496 Eigen::Matrix<float, 3, 1> globalPosition(
500 std::vector<Identifier> RDOs;
503 for (
unsigned int j = 0; j <
metadata->pcRdoIndex[
i]; ++j) {
507 rdoIndexCounter +=
metadata->pcRdoIndex[
i];
509 pixelCl->setMeasurement<2>(pxAux.
idHash[
i], localPosition,
511 pixelCl->setIdentifier(pxAux.
id[
i]);
512 pixelCl->setRDOlist(RDOs);
513 pixelCl->globalPosition() = globalPosition;
520 return StatusCode::SUCCESS;
527 ATH_MSG_DEBUG(
"You are running the bulk copy container creation method.");
533 auto pixelCl = std::make_unique<xAOD::PixelClusterContainer>();
534 auto pixelClAux = std::make_unique<xAOD::PixelClusterAuxContainer>();
535 pixelCl->setStore(pixelClAux.get());
539 const size_t nClusters =
metadata->numOfPixelClusters;
540 pixelClAux->resize(nClusters);
541 pixelCl->reserve(nClusters);
547 for (
size_t i = 0;
i < nClusters; ++
i) {
548 pixelCl->push_back(std::make_unique<xAOD::PixelCluster>());
555 std::vector<long unsigned int> identifierBuffer(nClusters);
556 std::vector<unsigned int> idHashBuffer(nClusters);
557 std::vector<std::array<float, 3>> gpBuffer(nClusters);
558 std::vector<float> localPosX(nClusters);
559 std::vector<float> localPosY(nClusters);
560 std::vector<float> localCovXX(nClusters);
561 std::vector<float> localCovYY(nClusters);
562 std::vector<int> totalToTBuffer(nClusters);
563 std::vector<float> widthInEtaBuffer(nClusters);
564 std::vector<int> channelsInPhiBuffer(nClusters);
565 std::vector<int> channelsInEtaBuffer(nClusters);
567 for (
size_t i = 0;
i < nClusters; ++
i) {
570 identifierBuffer[
i] = pxAux.
id[
i];
623 auto idSpan = idAcc.getDataSpan(*pixelCl);
624 auto idHashSpan = idHashAcc.getDataSpan(*pixelCl);
625 auto locPosXSpan = localPosXAcc.getDataSpan(*pixelCl);
626 auto locPosYSpan = localPosYAcc.getDataSpan(*pixelCl);
627 auto locCovXXSpan = localCovXXAcc.getDataSpan(*pixelCl);
628 auto locCovYYSpan = localCovYYAcc.getDataSpan(*pixelCl);
629 auto totSpan = totAcc.getDataSpan(*pixelCl);
630 auto wEtaSpan = widthEtaAcc.getDataSpan(*pixelCl);
631 auto gpSpan = globalPosAcc.getDataSpan(*pixelCl);
632 auto channelsInPhiSpan = channelsInPhiAcc.getDataSpan(*pixelCl);
633 auto channelsInEtaSpan = channelsInEtaAcc.getDataSpan(*pixelCl);
656 auto rdoSpan = rdoListAcc.getDataSpan(*pixelCl);
658 int rdoIndexCounter = 0;
660 for (
size_t i = 0;
i < nClusters; ++
i) {
664 std::vector<unsigned long long> &rdosForThisCluster = rdoSpan[
i];
667 rdosForThisCluster.resize(nRDOs);
670 for (
size_t j = 0; j < nRDOs; ++j) {
671 rdosForThisCluster[j] = pxAux.
rdoList[rdoIndexCounter + j];
673 rdoIndexCounter += nRDOs;
680 ATH_CHECK(pixelClustersHandle.record(std::move(pixelCl), std::move(pixelClAux)));
683 return StatusCode::SUCCESS;