Make the pixel cluster container.
528 ATH_MSG_DEBUG(
"You are running the element-wise container creation method.");
532 std::make_unique<xAOD::PixelClusterContainer>(),
533 std::make_unique<xAOD::PixelClusterAuxContainer>()));
535 ATH_CHECK(pixelClustersHandle.isValid());
538 int rdoIndexCounter = 0;
540 for (
unsigned int i = 0;
i <
metadata->numOfPixelClusters;
i++) {
542 auto pixelCl = pixelClustersHandle->push_back(
543 std::make_unique<xAOD::PixelCluster>());
545 Eigen::Matrix<float, 2, 1> localPosition(
547 Eigen::Matrix<float, 2, 2> localCovariance;
548 localCovariance.setZero();
551 Eigen::Matrix<float, 3, 1> globalPosition(
555 std::vector<Identifier> RDOs;
558 for (
unsigned int j = 0; j <
metadata->pcRdoIndex[
i]; ++j) {
562 rdoIndexCounter +=
metadata->pcRdoIndex[
i];
564 pixelCl->setMeasurement<2>(pxAux.
idHash[
i], localPosition,
566 pixelCl->setIdentifier(pxAux.
id[
i]);
567 pixelCl->setRDOlist(RDOs);
568 pixelCl->globalPosition() = globalPosition;
575 return StatusCode::SUCCESS;
582 ATH_MSG_DEBUG(
"You are running the bulk copy container creation method.");
588 auto pixelCl = std::make_unique<xAOD::PixelClusterContainer>();
589 auto pixelClAux = std::make_unique<xAOD::PixelClusterAuxContainer>();
590 pixelCl->setStore(pixelClAux.get());
594 const size_t nClusters =
metadata->numOfPixelClusters;
595 pixelClAux->resize(nClusters);
596 pixelCl->reserve(nClusters);
602 for (
size_t i = 0;
i < nClusters; ++
i) {
603 pixelCl->push_back(std::make_unique<xAOD::PixelCluster>());
611 std::vector<long unsigned int> identifierBuffer(nClusters);
612 std::vector<unsigned int> idHashBuffer(nClusters);
613 std::vector<std::array<float, 3>> gpBuffer(nClusters);
614 std::vector<float> localPosX(nClusters);
615 std::vector<float> localPosY(nClusters);
616 std::vector<float> localCovXX(nClusters);
617 std::vector<float> localCovYY(nClusters);
618 std::vector<int> totalToTBuffer(nClusters);
619 std::vector<float> widthInEtaBuffer(nClusters);
620 std::vector<int> channelsInPhiBuffer(nClusters);
621 std::vector<int> channelsInEtaBuffer(nClusters);
623 for (
size_t i = 0;
i < nClusters; ++
i) {
626 identifierBuffer[
i] = pxAux.
id[
i];
679 auto idSpan = idAcc.getDataSpan(*pixelCl);
680 auto idHashSpan = idHashAcc.getDataSpan(*pixelCl);
681 auto locPosXSpan = localPosXAcc.getDataSpan(*pixelCl);
682 auto locPosYSpan = localPosYAcc.getDataSpan(*pixelCl);
683 auto locCovXXSpan = localCovXXAcc.getDataSpan(*pixelCl);
684 auto locCovYYSpan = localCovYYAcc.getDataSpan(*pixelCl);
685 auto totSpan = totAcc.getDataSpan(*pixelCl);
686 auto wEtaSpan = widthEtaAcc.getDataSpan(*pixelCl);
687 auto gpSpan = globalPosAcc.getDataSpan(*pixelCl);
688 auto channelsInPhiSpan = channelsInPhiAcc.getDataSpan(*pixelCl);
689 auto channelsInEtaSpan = channelsInEtaAcc.getDataSpan(*pixelCl);
712 auto rdoSpan = rdoListAcc.getDataSpan(*pixelCl);
714 int rdoIndexCounter = 0;
716 for (
size_t i = 0;
i < nClusters; ++
i) {
720 std::vector<unsigned long long> &rdosForThisCluster = rdoSpan[
i];
723 rdosForThisCluster.resize(nRDOs);
726 for (
size_t j = 0; j < nRDOs; ++j) {
727 rdosForThisCluster[j] = pxAux.
rdoList[rdoIndexCounter + j];
729 rdoIndexCounter += nRDOs;
736 ATH_CHECK(pixelClustersHandle.record(std::move(pixelCl), std::move(pixelClAux)));
739 return StatusCode::SUCCESS;