8 static const HitList
dummy{};
19 std::vector<HitList>& finalClusts) {
20 if (filteredHits.empty())
return false;
21 finalClusts.reserve(filteredHits.size());
22 std::sort(filteredHits.begin(), filteredHits.end(),
24 const int gap1{m_tgcIdHelper->gasGap(h1->identify())}, gap2{m_tgcIdHelper->gasGap(h2->identify())};
25 if (gap1 != gap2)
return gap1 < gap2;
31 if (finalClusts.empty() ||
32 m_tgcIdHelper->channel(finalClusts.back().back()->identify()) +1 != m_tgcIdHelper->channel(prd->identify()) ||
33 m_tgcIdHelper->gasGap(finalClusts.back().back()->identify()) != m_tgcIdHelper->gasGap(prd->identify())) {
34 finalClusts.emplace_back();
36 finalClusts.back().push_back(prd);
39 [](
const HitList&
a,
const HitList& b){
40 return a.size() < b.size();
45 bool TgcHitClusteringObj::cluster(
const std::vector<const TgcPrepData*>& col ){
48 std::vector<const TgcPrepData*> etaHits{}, phiHits{};
49 etaHits.reserve(col.size());
50 phiHits.reserve(col.size());
53 std::copy_if(col.begin(),col.end(), std::back_inserter(etaHits), [
this](
const TgcPrepData* prd) {
54 return !m_tgcIdHelper->measuresPhi(prd->identify());
56 std::copy_if(col.begin(),col.end(), std::back_inserter(phiHits), [
this](
const TgcPrepData* prd){
57 return m_tgcIdHelper->measuresPhi(prd->identify());
60 if (!cluster(etaHits, clustersEta))
return false;
61 if (!cluster(phiHits, clustersPhi))
return false;
88 if( lastPhi != firstPhi ) {
91 cl3D.
getEdge(Edge::LowEtaHighPhi) = cl3D.
getEdge(Edge::LowEtaLowPhi);
93 if( lastEta != firstEta ) {
95 if( lastPhi != firstPhi ) {
98 cl3D.
getEdge(Edge::HighEtaHighPhi) = cl3D.
getEdge(Edge::HighEtaLowPhi);
101 cl3D.
getEdge(Edge::HighEtaLowPhi) = cl3D.
getEdge(Edge::LowEtaLowPhi);
102 cl3D.
getEdge(Edge::HighEtaHighPhi) = cl3D.
getEdge(Edge::LowEtaHighPhi);
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
virtual bool spacePointPosition(const Identifier &phiId, const Identifier &etaId, Amg::Vector2D &pos) const override
space point position for a given pair of phi and eta identifiers The LocalPosition is expressed in th...
Edge
Representation of the four edge points.
Amg::Vector3D & getEdge(const Edge e)
Class to represent TGC measurements.
virtual const MuonGM::TgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD The pointer will be zero if the det el is not ...
Identifier identify() const
return the identifier
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.
std::vector< TgcClusterObj3D > clusters3D
const HitList & bestEtaCluster() const
const HitList & bestPhiCluster() const
bool cluster(const HitList &col)
std::vector< HitList > clustersEta
std::vector< HitList > clustersPhi
const TgcIdHelper * m_tgcIdHelper
TgcClusterObj3D::HitList HitList