55 if (
input.regions.empty())
65 LogDebug(
"HGCPatternRecoByCA") <<
"Making Tracksters with CA" << std::endl;
73 std::vector<int> seedIndices;
74 std::vector<uint8_t> layer_cluster_usage(
input.layerClusters.size(), 0);
81 input.layerClustersTime,
106 std::set<unsigned int> effective_cluster_idx;
108 for (
auto const &doublet :
ntuplet) {
109 auto innerCluster =
doublets[doublet].innerClusterId();
110 auto outerCluster =
doublets[doublet].outerClusterId();
112 effective_cluster_idx.insert(innerCluster);
113 effective_cluster_idx.insert(outerCluster);
116 LogDebug(
"HGCPatternRecoByCA") <<
" New doublet " << doublet <<
" for trackster: " <<
result.size()
117 <<
" InnerCl " << innerCluster <<
" " <<
input.layerClusters[innerCluster].x()
118 <<
" " <<
input.layerClusters[innerCluster].y() <<
" " 119 <<
input.layerClusters[innerCluster].z() <<
" OuterCl " << outerCluster <<
" " 120 <<
input.layerClusters[outerCluster].x() <<
" " 121 <<
input.layerClusters[outerCluster].y() <<
" " 122 <<
input.layerClusters[outerCluster].z() <<
" " << tracksterId << std::endl;
125 unsigned showerMinLayerId = 99999;
126 std::vector<unsigned int> uniqueLayerIds;
127 uniqueLayerIds.reserve(effective_cluster_idx.size());
128 std::vector<std::pair<unsigned int, unsigned int>> lcIdAndLayer;
129 lcIdAndLayer.reserve(effective_cluster_idx.size());
130 for (
auto const i : effective_cluster_idx) {
131 auto const &haf =
input.layerClusters[
i].hitsAndFractions();
133 showerMinLayerId =
std::min(layerId, showerMinLayerId);
134 uniqueLayerIds.push_back(layerId);
135 lcIdAndLayer.emplace_back(
i, layerId);
137 std::sort(uniqueLayerIds.begin(), uniqueLayerIds.end());
138 uniqueLayerIds.erase(
std::unique(uniqueLayerIds.begin(), uniqueLayerIds.end()), uniqueLayerIds.end());
139 unsigned int numberOfLayersInTrackster = uniqueLayerIds.size();
141 int numberOfMissingLayers = 0;
142 unsigned int j = showerMinLayerId;
143 unsigned int indexInVec = 0;
144 for (
const auto &
layer : uniqueLayerIds) {
146 numberOfMissingLayers++;
149 numberOfLayersInTrackster = indexInVec;
150 for (
auto &llpair : lcIdAndLayer) {
151 if (llpair.second >=
layer) {
152 effective_cluster_idx.erase(llpair.first);
165 tmp.vertices().reserve(effective_cluster_idx.size());
166 tmp.vertex_multiplicity().resize(effective_cluster_idx.size(), 1);
169 tmp.setSeed(
input.regions[0].collectionID, seedIndices[tracksterId]);
171 std::copy(std::begin(effective_cluster_idx), std::end(effective_cluster_idx), std::back_inserter(
tmp.vertices()));
177 input.layerClustersTime,
const std::unique_ptr< HGCGraphT< TILES > > theGraph_
const bool computeLocalTime_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const float max_delta_time_
const unsigned int max_out_in_hops_
void assignPCAtoTracksters(std::vector< Trackster > &tracksters, const std::vector< reco::CaloCluster > &layerClusters, const edm::ValueMap< std::pair< float, float >> &layerClustersTime, double z_limit_em, hgcal::RecHitTools const &rhTools, bool computeLocalTime=false, bool energyWeight=true, bool clean=false, int minLayer=10, int maxLayer=10)
const std::vector< double > siblings_maxRSquared_
static std::string const input
const int min_clusters_per_ntuplet_
const float etaLimitIncreaseWindow_
const unsigned int min_layers_per_trackster_
def unique(seq, keepstr=True)
const float min_cos_pointing_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
bool check_missing_layers_
hgcal::RecHitTools rhtools_
const int max_missing_layers_in_trackster_
auto const & foundNtuplets
const float min_cos_theta_
static constexpr int nPhiBins
const unsigned int shower_start_max_layer_
const float root_doublet_max_distance_from_seed_squared_