321 const auto &tracksters =
input.tracksters;
325 std::vector<unsigned int> sortedTracksters(tracksters.size());
326 std::iota(sortedTracksters.begin(), sortedTracksters.end(), 0);
327 std::sort(sortedTracksters.begin(), sortedTracksters.end(), [&tracksters](
unsigned int i,
unsigned int j) {
328 return tracksters[
i].raw_energy() > tracksters[
j].raw_energy();
333 std::array<TICLLayerTile, 2> tracksterTile;
336 std::vector<std::array<ticl::Vector, 3>> skeletons(tracksters.size());
337 for (
auto const t_idx : sortedTracksters) {
338 const auto &trackster = tracksters[t_idx];
340 tracksterTile[trackster.barycenter().eta() > 0.f].fill(
341 trackster.barycenter().eta(), trackster.barycenter().phi(), t_idx);
343 std::vector<int> maskReceivedLink(tracksters.size(), 1);
344 std::vector<int> isRootTracksters(tracksters.size(), 1);
346 std::vector<Node> allNodes;
347 for (
size_t it = 0;
it < tracksters.size(); ++
it) {
348 allNodes.emplace_back(
it);
352 for (
auto const &t_idx : sortedTracksters) {
353 auto const &trackster = tracksters[t_idx];
354 auto const &
skeleton = skeletons[t_idx];
356 auto const bary = trackster.barycenter();
360 const auto &tiles = tracksterTile[
tileIndex];
361 std::array<int, 4> search_box = tiles.searchBoxEtaPhi(
eta_min,
eta_max, bary.phi() -
del_, bary.phi() +
del_);
362 if (search_box[2] > search_box[3]) {
366 for (
int eta_i = search_box[0]; eta_i <= search_box[1]; ++eta_i) {
367 for (
int phi_i = search_box[2]; phi_i <= search_box[3]; ++phi_i) {
369 for (
auto n : neighbours) {
372 if (maskReceivedLink[
n] == 0
or allNodes[t_idx].isInnerNeighbour(
n))
375 LogDebug(
"TracksterLinkingbySkeletons")
376 <<
"Trying to Link Trackster " << t_idx <<
" With Trackster " <<
n << std::endl;
378 LogDebug(
"TracksterLinkingbySkeletons")
379 <<
"\t==== LINK: Trackster " << t_idx <<
" Linked with Trackster " <<
n << std::endl;
380 maskReceivedLink[
n] = 0;
381 allNodes[t_idx].addOuterNeighbour(
n);
382 allNodes[
n].addInnerNeighbour(t_idx);
383 isRootTracksters[
n] = 0;
391 LogDebug(
"TracksterLinkingbySkeletons") <<
"**************** FINAL GRAPH **********************" << std::endl;
392 for (
auto const &node : allNodes) {
393 if (isRootTracksters[node.getId()]) {
394 LogDebug(
"TracksterLinkingbySkeletons")
396 <<
" Node " << node.getId() <<
" position " << tracksters[node.getId()].barycenter() <<
" energy " 397 << tracksters[node.getId()].raw_energy() << std::endl;
399 LogDebug(
"TracksterLinkingbySkeletons")
400 <<
"Node " << node.getId() <<
" position " << tracksters[node.getId()].barycenter() <<
" energy " 401 << tracksters[node.getId()].raw_energy() << std::endl;
404 LogDebug(
"TracksterLinkingbySkeletons") <<
"********************************************************" << std::endl;
406 TICLGraph graph(allNodes, isRootTracksters);
409 auto const &
components = graph.findSubComponents();
410 linkedTracksterIdToInputTracksterId.resize(
components.size());
412 LogDebug(
"TracksterLinkingbySkeletons") <<
"Component " << ic <<
" Node: ";
413 std::vector<unsigned int> linkedTracksters;
415 if (
comp.size() == 1) {
416 if (
input.tracksters[
comp[0]].vertices().size() <= 3) {
420 for (
auto const &node :
comp) {
421 LogDebug(
"TracksterLinkingbySkeletons") << node <<
" ";
422 linkedTracksterIdToInputTracksterId[ic].push_back(node);
425 linkedTracksters.push_back(resultTracksters.size());
426 resultTracksters.push_back(outTrackster);
427 linkedResultTracksters.push_back(linkedTracksters);
428 LogDebug(
"TracksterLinkingbySkeletons") <<
"\n";
static constexpr int nPhiBins
static constexpr float maxEta
bool areCompatible(const ticl::Trackster &myTrackster, const ticl::Trackster &otherTrackster, const std::array< ticl::Vector, 3 > &mySkeleton, const std::array< ticl::Vector, 3 > &otherSkeleton)
static std::string const input
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
void mergeTracksters(const Trackster &other)
std::array< ticl::Vector, 3 > findSkeletonNodes(const ticl::Trackster &trackster, float lower_percentage, float upper_percentage, const std::vector< reco::CaloCluster > &layerClusters, const hgcal::RecHitTools &rhtools)
hgcal::RecHitTools rhtools_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Abs< T >::type abs(const T &t)
static constexpr float minEta
float min_trackster_energy_
unsigned int min_num_lcs_