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

Enable calorimeter hit merging by functions #1668

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

Conversation

ruse-traveler
Copy link
Contributor

@ruse-traveler ruse-traveler commented Nov 6, 2024

Briefly, what does this PR introduce?

This PR extends the functionality of the CalorimeterHitsMerger algorithm. Previously, reconstructed hits could only be merged across a given field of the readout of a calorimeter. This presents a challenge for calorimeters such as the Barrel HCal where

  1. our readout has no segmentation beyond just eta & phi, and
  2. it could be useful to study the response of the detector as a function of how many readout channels we gang together after reconstruction.

This PR addresses this point by utilizing the EvaluatorSvc in a manner similar to the adjacencyMatrix, peakNeighbourhoodMatrix of the CalorimeterIslandClustering and the sampFrac of CalorimeterHitReco. Now the user has an option to specify a mapping for a specific field of the readout via the mappings option, which defines a function to map the indices of a field onto the desired reference indices.

For example:

app->Add(new JOmniFactoryGeneratorT<CalorimeterHitsMerger_factory>(
  "HcalBarrelMergedHits", {"HcalBarrelRecHits"}, {"HcalBarrelMergedHits"},
  {
    .readout = "HcalBarrelHits",
    .fields = {"phi"},
    .mappings = {"phi-fmod(phi,5)"}
  },
  app   // TODO: Remove me once fixed
));

The HcalBarrelMergedHits collection will merge 5 hits (i.e. scintillator tiles for the BHCal) adjacent in phi into a one with the position and cellID of the 1st of the 5. However, no hits will be merged along eta in this example.

If a mapping is provided, the algorithm will construct the map of which hits to merge according the provided functions. If not, it will attempt to merge hits across the provided fields into the indices defined by refs.

What kind of change does this PR introduce?

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

@github-actions github-actions bot added topic: calorimetry relates to calorimetry topic: barrel labels Nov 6, 2024
@ruse-traveler ruse-traveler marked this pull request as ready for review November 14, 2024 17:15
@ruse-traveler
Copy link
Contributor Author

I think this is ready to go. I'll post some plots here showing the test case in the BHCal at work shortly...

@ruse-traveler
Copy link
Contributor Author

Here are some (eta, phi) maps of the tiles before and after merging. I tried out two cases for merging (using the example map from the PR description): once with the no. of tiles to merge set to 1 (so in other words, don't merge the tiles, and once with the no. set to 5 (merge into an sPHENIX-style tower).

Broadly, things look like I would expect them to. Except for the giant hole in the hit map...
mergedHitPhiVsEta_nMerge5 e10pim d14m11y2024
recoHitPhiVsEta e10pim d14m11y2024
mergedHitPhiVsEta_nMerge1 e10pim d14m11y2024

@ruse-traveler
Copy link
Contributor Author

Then another odd feature I noticed is that even when the no. to merge is 1, there are still slight changes in the eta, phi distributions of the tiles even though it should just be copying one collection onto another...
recoVsMergedHitPhi_nMerge1 e10pim d14m11y2024
recoVsMergedHitEta_nMerge1 e10pim d14m11y2024

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

Successfully merging this pull request may close these issues.

1 participant