-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable calorimeter hit merging by functions (#1668)
### 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 the ability to specify an (almost) arbitrarily complex transformation for a specific field of the readout via the `fieldTransformations` parameter, which defines both the field to transform and the function to map the indices of that field onto the desired reference indices. For example: ``` app->Add(new JOmniFactoryGeneratorT<CalorimeterHitsMerger_factory>( "HcalBarrelMergedHits", {"HcalBarrelRecHits"}, {"HcalBarrelMergedHits"}, { .readout = "HcalBarrelHits", .fieldTransformations = {"phi:phi-(5*((phi/5)-floor(phi/5)))"} }, app // TODO: Remove me once fixed )); ``` Here, 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, and no hits will be merged along eta. The previous behavior of the algorithm can be recovered by simply specifying the index to be mapped onto. For example: ``` app->Add(new JOmniFactoryGeneratorT<CalorimeterHitsMerger_factory>( "HcalEndcapNMergedHits", {"HcalEndcapNRecHits"}, {"HcalEndcapNMergedHits"}, { .readout = "HcalEndcapNHits", .fieldTransformations = {"layer:4", "slice:0"} }, app // TODO: Remove me once fixed )); ``` An example script of to change a transformation (and how to update the adjacency matrix accordingly) from the command-line is provided in the snippets repo [here](https://github.com/eic/snippets/blob/main/Calorimetery/CaloDebugTools/UtilityScripts/RunEICReconWithTileMerging.rb). ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #1669 ) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] 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. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <[email protected]>
- Loading branch information
1 parent
8fa634b
commit d96cbff
Showing
8 changed files
with
139 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters