public final class ClusterUtilities extends Object
Cluster
,
BaseCluster
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ClusterUtilities.ClusterEnergyComparator
Comparator of cluster energies.
|
(package private) static class |
ClusterUtilities.ClusterSeedComparator
Comparator of cluster energies.
|
(package private) static class |
ClusterUtilities.UniqueEnergyComparator
Compare CalorimeterHit energies and disambiguate equal values using the crystal position.
|
Modifier | Constructor and Description |
---|---|
private |
ClusterUtilities() |
Modifier and Type | Method and Description |
---|---|
static void |
applyCorrections(HPSEcal3 ecal,
org.lcsim.event.Cluster cluster,
boolean isMC)
Apply HPS-specific energy and position corrections to a cluster without track information.
|
static void |
applyCorrections(HPSEcal3 ecal,
org.lcsim.event.Cluster cluster,
double ypos,
boolean isMC)
Apply HPS-specific energy and position corrections to a cluster with track information.
|
static void |
applyCorrections(HPSEcal3 ecal,
List<org.lcsim.event.Cluster> clusters,
boolean isMC)
Apply HPS-specific energy and position corrections to a list of clusters in place.
|
static void |
calculateProperties(List<org.lcsim.event.Cluster> clusters,
org.lcsim.event.base.ClusterPropertyCalculator calc)
Call
BaseCluster.calculateProperties()
on all clusters in the list using the given calculator. |
static double |
computeEnergySum(List<org.lcsim.event.CalorimeterHit> hits)
Compute the energy sum for a set of CalorimeterHits by adding all their corrected energies.
|
static double |
computeRawEnergy(org.lcsim.event.Cluster cluster)
Compute the raw energy of a cluster which is just the sum of all its hit energies.
|
static org.lcsim.event.Cluster |
createBasicCluster(List<org.lcsim.event.CalorimeterHit> clusterHits)
Create a basic cluster object from a list of hits.
|
static Map<Long,org.lcsim.event.CalorimeterHit> |
createHitMap(List<org.lcsim.event.CalorimeterHit> hits)
Create a map of IDs to their hits.
|
static Map<org.lcsim.event.MCParticle,List<org.lcsim.event.SimCalorimeterHit>> |
createParticleHitMap(org.lcsim.event.Cluster cluster)
Create a map between a particle and its list of hits from a Cluster.
|
static org.lcsim.event.Cluster |
findHighestEnergyCluster(List<org.lcsim.event.Cluster> clusters)
Find the highest energy cluster from the list.
|
static org.lcsim.event.CalorimeterHit |
findHighestEnergyHit(org.lcsim.event.Cluster cluster)
Find the hit with the highest energy value.
|
static Set<org.lcsim.event.MCParticle> |
findMCParticles(org.lcsim.event.Cluster cluster)
Find the unique set of MCParticles that are referenced by the hits of the Cluster.
|
static Set<Long> |
findNeighborHitIDs(HPSEcal3 ecal,
org.lcsim.event.CalorimeterHit hit,
Map<Long,org.lcsim.event.CalorimeterHit> hitMap)
Given a hit, find the list of neighboring crystal IDs that also have hits.
|
static List<org.lcsim.event.CalorimeterHit> |
findRejectedHits(List<org.lcsim.event.Cluster> clusters,
List<org.lcsim.event.CalorimeterHit> hits)
Find CalorimeterHits that are not present in a collection of Clusters.
|
static org.lcsim.event.CalorimeterHit |
findSeedHit(org.lcsim.event.Cluster cluster)
Find the seed hit of a Cluster.
|
static List<org.lcsim.event.CalorimeterHit> |
findSharedHits(org.lcsim.event.Cluster cluster)
This method will determine which hits are likely shared with
other clusters, by comparing a hit's energy to its contribution.
|
static List<org.lcsim.event.CalorimeterHit> |
findSharedHits(org.lcsim.event.Cluster cluster,
List<org.lcsim.event.Cluster> clusters)
Find hits in a cluster that are shared with other Clusters.
|
static List<org.lcsim.event.CalorimeterHit> |
findUnsharedHits(org.lcsim.event.Cluster cluster)
This method will determine which hits are likely not shared
other clusters, by comparing a hit's energy to its contribution.
|
static List<org.lcsim.event.CalorimeterHit> |
findUnsharedHits(org.lcsim.event.Cluster cluster,
List<org.lcsim.event.Cluster> clusters)
Find hits in a Cluster that are not shared with other Clusters.
|
static Set<org.lcsim.event.CalorimeterHit> |
getHits(List<org.lcsim.event.Cluster> clusters)
Get the set of hits from a list of clusters.
|
static double |
getSeedHitTime(org.lcsim.event.Cluster cluster)
Return the time of the seed hit.
|
static boolean |
isHardwareCluster(org.lcsim.event.Cluster cluster)
True if cluster has a type code that indicates it was generated by a hardware clustering algorithm.
|
static List<org.lcsim.event.Cluster> |
sort(List<org.lcsim.event.Cluster> clusters,
Comparator<org.lcsim.event.Cluster> comparator,
boolean inPlace,
boolean reverse)
Sort a list of clusters.
|
static List<org.lcsim.event.CalorimeterHit> |
sortedHits(org.lcsim.event.Cluster cluster,
Comparator<org.lcsim.event.CalorimeterHit> comparator,
boolean reverseOrder)
Sort the hits in the cluster using a
Comparator . |
static void |
sortHitsUniqueEnergy(List<org.lcsim.event.CalorimeterHit> hits)
Sort in place a list of hits by their corrected energy.
|
static void |
sortReconClusterHits(List<org.lcsim.event.Cluster> clusters)
Sort in place the CalorimeterHit list of a set of clusters,
disambiguating when the energies are exactly the same.
|
public static Map<Long,org.lcsim.event.CalorimeterHit> createHitMap(List<org.lcsim.event.CalorimeterHit> hits)
public static Set<Long> findNeighborHitIDs(HPSEcal3 ecal, org.lcsim.event.CalorimeterHit hit, Map<Long,org.lcsim.event.CalorimeterHit> hitMap)
hit
- The input hit.hitMap
- The hit map with all the collection's hits.public static org.lcsim.event.Cluster createBasicCluster(List<org.lcsim.event.CalorimeterHit> clusterHits)
clusterHits
- The list of hits.public static double computeRawEnergy(org.lcsim.event.Cluster cluster)
cluster
- The input cluster.public static double computeEnergySum(List<org.lcsim.event.CalorimeterHit> hits)
public static org.lcsim.event.CalorimeterHit findHighestEnergyHit(org.lcsim.event.Cluster cluster)
sortReconClusterHits(List)
if this level of disambiguation
is needed (e.g. in order to find an exact seed hit).cluster
- The input cluster.public static List<org.lcsim.event.CalorimeterHit> sortedHits(org.lcsim.event.Cluster cluster, Comparator<org.lcsim.event.CalorimeterHit> comparator, boolean reverseOrder)
Comparator
.
This method will not change the hits in place. It returns a new list.
The algorithm does not disambiguate between hits with equal energies.cluster
- The input cluster.comparator
- The Comparator to use for sorting.reverseOrder
- True to use reverse rather than default ordering.public static List<org.lcsim.event.CalorimeterHit> findUnsharedHits(org.lcsim.event.Cluster cluster, List<org.lcsim.event.Cluster> clusters)
cluster
- The input cluster.clusters
- The list of clusters.public static List<org.lcsim.event.CalorimeterHit> findSharedHits(org.lcsim.event.Cluster cluster, List<org.lcsim.event.Cluster> clusters)
cluster
- The input cluster.clusters
- The list of clusters.public static org.lcsim.event.CalorimeterHit findSeedHit(org.lcsim.event.Cluster cluster)
cluster
- The input Cluster.public static Set<org.lcsim.event.MCParticle> findMCParticles(org.lcsim.event.Cluster cluster)
cluster
- The input Cluster.public static List<org.lcsim.event.CalorimeterHit> findRejectedHits(List<org.lcsim.event.Cluster> clusters, List<org.lcsim.event.CalorimeterHit> hits)
clusters
- The input Clusters.hits
- The input Calorimeter hits.public static void sortReconClusterHits(List<org.lcsim.event.Cluster> clusters)
clusters
- The list of clusters with hits to sort.public static void sortHitsUniqueEnergy(List<org.lcsim.event.CalorimeterHit> hits)
hits
- The list of hits.public static void applyCorrections(HPSEcal3 ecal, List<org.lcsim.event.Cluster> clusters, boolean isMC)
clusters
- The list of clusters.public static void applyCorrections(HPSEcal3 ecal, org.lcsim.event.Cluster cluster, boolean isMC)
cluster
- The input cluster.public static void applyCorrections(HPSEcal3 ecal, org.lcsim.event.Cluster cluster, double ypos, boolean isMC)
cluster
- The input cluster.public static void calculateProperties(List<org.lcsim.event.Cluster> clusters, org.lcsim.event.base.ClusterPropertyCalculator calc)
BaseCluster.calculateProperties()
on all clusters in the list using the given calculator.clusters
- The list of clusters.calc
- The property calculator.public static Map<org.lcsim.event.MCParticle,List<org.lcsim.event.SimCalorimeterHit>> createParticleHitMap(org.lcsim.event.Cluster cluster)
cluster
- The input cluster.public static Set<org.lcsim.event.CalorimeterHit> getHits(List<org.lcsim.event.Cluster> clusters)
clusters
- The input cluster list.public static List<org.lcsim.event.CalorimeterHit> findSharedHits(org.lcsim.event.Cluster cluster)
cluster
- The input cluster.public static List<org.lcsim.event.CalorimeterHit> findUnsharedHits(org.lcsim.event.Cluster cluster)
cluster
- The input cluster.public static boolean isHardwareCluster(org.lcsim.event.Cluster cluster)
cluster
- The Cluster.public static List<org.lcsim.event.Cluster> sort(List<org.lcsim.event.Cluster> clusters, Comparator<org.lcsim.event.Cluster> comparator, boolean inPlace, boolean reverse)
clusters
- the list of clusterscomparator
- the comparator to use for sortinginPlace
- true
to sort the list in-place and not make a new listreverse
- true
to use reverse comparator (results in list ordered highest to lowest energy)public static org.lcsim.event.Cluster findHighestEnergyCluster(List<org.lcsim.event.Cluster> clusters)
clusters
- the list of clusterspublic static double getSeedHitTime(org.lcsim.event.Cluster cluster)
cluster
- Copyright © 2019. All rights reserved.