Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DC clustering updates #419

Open
wants to merge 17 commits into
base: development
Choose a base branch
from
Open

DC clustering updates #419

wants to merge 17 commits into from

Conversation

tongtongcao
Copy link
Collaborator

Main updates include:

  1. Fix a bug in the splitter for complicated hit clumps, and update resolver for hit-overlapped clusters from the splitter.
  2. Loose limit for clusters with consideration of real hit lost due to dead strips, AI-denoising, edge effect, etc.
  3. Fix issues for hits shared by multiple clusters.
    See details from
    New DC Clustering.pdf

@zieglerv
Copy link
Collaborator

zieglerv commented Jan 8, 2025

isExceptionalCluster and isExceptionalFittedCluster are basically copies of each other.
It may be better to use only one method for the algorithm to decide if the cluster is exceptional and apply it to Hit or Fittedhit, something like:
/**

  • Check if one or more layers are skipped in the cluster

  • @param hitsInClus the hits in a cluster (can be either Hit or FittedHit)

  • @param nlayr the number of layers

  • @return true if one or more layers are skipped in the cluster
    */
    private boolean isExceptionalClusterHelper(List<? extends Hit> hitsInClus, int nlayr) {
    // Initialize array to count hits in each layer
    int[] nlayers = new int[nlayr];

    // Count hits for each layer in a single pass through the hits
    for (Hit hit : hitsInClus) {
    int layer = hit.get_Layer() - 1; // layer numbering starts from 1
    if (layer >= 0 && layer < nlayr) {
    nlayers[layer]++;
    }
    }

    // Check for skipped layers (special cases for layer pairs)
    if ((nlayers[0] == 0 && nlayers[1] == 0) || (nlayers[4] == 0 && nlayers[5] == 0)) {
    return true;
    }

    // Check for skipped layers in the middle (layers 0 to 3)
    for (int l = 0; l < 4; l++) {
    if (nlayers[l] > 0 && nlayers[l + 1] == 0) {
    return true;
    }
    }

    return false;
    }

/**

  • Wrapper for checking if a cluster of Hit objects is exceptional.
    */
    public boolean isExceptionalCluster(List hitsInClus) {
    return isExceptionalClusterHelper(hitsInClus, 6); // 6 layers for Hit objects
    }

/**

  • Wrapper for checking if a cluster of FittedHit objects is exceptional.
    */
    public boolean isExceptionalFittedCluster(List hitsInClus) {
    return isExceptionalClusterHelper(hitsInClus, 6); // 6 layers for FittedHit objects
    }

@zieglerv
Copy link
Collaborator

zieglerv commented Jan 8, 2025

A lot of 3-hit clusters are noise. Which is why on the plot of the cluster size on page 11 of the document, there is a spike at 3. What is the fraction of these 3-hit clusters on track after AI inference? Also the problem with using clusters with only 3 layers is that the left-right ambiguity can be hard to resolve. For example, on page 4, Exc1 it is 100 ambiguous unless it is in region3 which has the minstagger; Exc2 has ambiguities for the small docas, and it does not matter that much in this case. It would be nice to include in this document a MC study of the left-right ambiguity accuracy as a function of cluster size for special cluster type1 (exc1) and type2 (exc2).
In the exceptional clusters you may want to add a constraint that the left-right ambiguity (LR) is solvable. For instance, for type1 clusters, you may want to require a double hit in a layer for regions 1 and 2 to pin down LR.
It may be better to toss out a 3-layer cluster with wrong left-right ambiguity and rely on 5 super layer tracking than to keep it and possibly bias the track.

Copy link
Collaborator

@zieglerv zieglerv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments in the conversation section about 3-hit clusters. I suggest requiring a double hit in a layer for type 1 exceptional clusters (where the first or last 2 layers are lost) that are in region 1 or 2 to assist resolving the left-right ambiguity for those cases. In region 3 the mini stagger does that job.

Suggestions for code tidiness: isExceptionalCluster and isExceptionalFittedCluster are basically copies of each other.
It may be better to use only one method for the algorithm to decide if the cluster is exceptional and apply it to Hit or Fittedhit, something like:
/**

Check if one or more layers are skipped in the cluster

@param hitsInClus the hits in a cluster (can be either Hit or FittedHit)

@param nlayr the number of layers

@return true if one or more layers are skipped in the cluster
*/
private boolean isExceptionalClusterHelper(List<? extends Hit> hitsInClus, int nlayr) {
// Initialize array to count hits in each layer
int[] nlayers = new int[nlayr];

// Count hits for each layer in a single pass through the hits
for (Hit hit : hitsInClus) {
int layer = hit.get_Layer() - 1; // layer numbering starts from 1
if (layer >= 0 && layer < nlayr) {
nlayers[layer]++;
}
}

// Check for skipped layers (special cases for layer pairs)
if ((nlayers[0] == 0 && nlayers[1] == 0) || (nlayers[4] == 0 && nlayers[5] == 0)) {
return true;
}

// Check for skipped layers in the middle (layers 0 to 3)
for (int l = 0; l < 4; l++) {
if (nlayers[l] > 0 && nlayers[l + 1] == 0) {
return true;
}
}

return false;
}

/**

Wrapper for checking if a cluster of Hit objects is exceptional.
/
public boolean isExceptionalCluster(List hitsInClus) {
return isExceptionalClusterHelper(hitsInClus, 6); // 6 layers for Hit objects
}
/
*

Wrapper for checking if a cluster of FittedHit objects is exceptional.
*/
public boolean isExceptionalFittedCluster(List hitsInClus) {
return isExceptionalClusterHelper(hitsInClus, 6); // 6 layers for FittedHit objects
}

@tongtongcao
Copy link
Collaborator Author

tongtongcao commented Jan 9, 2025

Nice suggestion to use wrapper to combine two similar functions.
Page 11 in the shared document shows distributions of clusters directly from DC clustering before AI prediction of cluster combo.
It is not surprise that there are plenty of low-size clusters. So we just looser cluster limit for so-called exceptional clusters.
Indeed, there is LR ambiguous for some of exceptional clusters.
Most likely, low-size clusters have more chance to get LR ambiguous than high-size clusters.
Regards to LR ambiguity of clusters, we actually handle it during TB tracking by build two-folder clusters for a cluster with LR ambiguity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants