30 std::vector<Muon::sTgcPrepData>&& stripsVect,
31 std::vector<std::unique_ptr<Muon::sTgcPrepData>>& clustersVect)
const {
33 ATH_MSG_DEBUG(
"Size of the input vector: " << stripsVect.size());
35 if (stripsVect.empty())
return StatusCode::SUCCESS;
39 Identifier chanId = stripsVect.at(0).identify();
45 ATH_MSG_DEBUG(
" isStrip: " << isStrip <<
"Single channel resolution: " << resolution);
50 return StatusCode::FAILURE;
54 std::array<std::vector<Muon::sTgcPrepData>, 8> stgcPrdsPerLayer = stgcClusterCommon.
sortSTGCPrdPerLayer(std::move(stripsVect));
56 for (std::vector<Muon::sTgcPrepData>& layPrds : stgcPrdsPerLayer) {
58 std::vector<std::vector<Muon::sTgcPrepData>> layerClusters = stgcClusterCommon.
findStripCluster(std::move(layPrds),
62 for (
const std::vector<Muon::sTgcPrepData>& cluster: layerClusters) {
63 if (cluster.empty())
continue;
66 std::optional<Muon::STgcClusterPosition> optClusterPos = stgcClusterCommon.
weightedAverage(cluster, resolution, isStrip);
68 if (
msgLvl(MSG::VERBOSE)) {
69 std::stringstream sstr{};
73 <<
"), charge: " << prd.charge() <<
", time: " <<
static_cast<int>(prd.time())
76 ATH_MSG_VERBOSE(
"Reject invalid cluster..." << std::endl << std::endl << sstr.str());
81 Identifier clusterId = (*optClusterPos).getClusterId();
82 double posY = cluster[0].localPosition().y();
83 Amg::Vector2D localPosition((*optClusterPos).getMeanPosition(), posY);
85 covN(0,0) = (*optClusterPos).getErrorSquared();
87 std::vector<Identifier> rdoList;
88 std::vector<int> elementsCharge;
89 std::vector<short int> elementsTime;
90 std::vector<uint16_t> elementsChannel;
92 rdoList.push_back(prd.identify());
93 elementsCharge.push_back(prd.charge());
94 elementsChannel.push_back(
m_idHelperSvc->stgcIdHelper().channel(prd.identify()));
95 elementsTime.push_back(prd.time());
101 std::unique_ptr<sTgcPrepData> prdN = std::make_unique<sTgcPrepData>(
104 std::move(localPosition),
107 cluster.at(0).detectorElement(),
108 std::accumulate(elementsCharge.begin(), elementsCharge.end(), 0),
110 std::move(elementsChannel),
111 std::move(elementsTime),
112 std::move(elementsCharge));
115 clustersVect.push_back(std::move(prdN));
119 ATH_MSG_DEBUG(
"Size of the output cluster vector: " << clustersVect.size());
121 return StatusCode::SUCCESS;
std::array< std::vector< sTgcPrepData >, 8 > sortSTGCPrdPerLayer(std::vector< sTgcPrepData > &&stripPrds) const
Separate the sTGC PRDs by layer, from 0 to 7, and sort the PRDs per layer in ascending order of strip...
std::vector< std::vector< sTgcPrepData > > findStripCluster(std::vector< sTgcPrepData > &&strips, const int maxMissingStrip) const
Find strip clusters, assuming the input vector of PRDs are sorted in ascending order of strip number.