public class ClusterDriver
extends org.lcsim.util.Driver
This is a Driver
that creates ECAL Cluster
collections using the Clusterer
interface.
A specific clustering engine can be created with the setClustererName(String)
method
which will use a factory to create it by name. The cuts of the Clusterer
can be set generically with the setCuts(double[])
method.
Clusterer
,
NumericalCuts
,
Cluster
,
Driver
Modifier and Type | Field and Description |
---|---|
protected Clusterer |
clusterer |
protected boolean |
createEmptyClusterCollection |
protected double[] |
cuts |
protected HPSEcal3 |
ecal |
protected String |
ecalName |
protected String |
inputHitCollectionName |
protected HPSEcal3.NeighborMap |
neighborMap |
protected String |
outputClusterCollectionName |
protected boolean |
raiseErrorNoHitCollection |
protected boolean |
skipNoClusterEvents |
protected boolean |
sortHits |
protected boolean |
storeHits |
protected boolean |
validateClusters |
protected boolean |
writeClusterCollection |
Constructor and Description |
---|
ClusterDriver()
No argument constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
detectorChanged(org.lcsim.geometry.Detector detector)
Setup conditions specific configuration.
|
(package private) <ClustererType extends Clusterer> |
getClusterer()
Get a
Clusterer using type inference for the concrete type. |
(package private) void |
printHitIDs(List<org.lcsim.event.CalorimeterHit> hits) |
void |
process(org.lcsim.event.EventHeader event)
This method implements the default clustering procedure based on input parameters.
|
void |
setClusterer(Clusterer clusterer)
Set the Clusterer which implements the clustering algorithm.
|
void |
setClustererName(String name)
Set the Clusterer by name.
|
void |
setCreateEmptyClusterCollection(boolean createEmptyClusterCollection)
Set whether an empty collection should be created if there are no clusters made by the Clusterer.
|
void |
setCuts(double[] cuts)
Set the numerical cuts of the Clusterer.
|
void |
setEcalName(String ecalName)
Set the name of the ECAL in the detector framework.
|
void |
setInputHitCollectionName(String inputHitCollectionName)
Set the name of the input CalorimeterHit collection to use for clustering.
|
void |
setOutputClusterCollectionName(String outputClusterCollectionName)
Set the name of the output Cluster collection.
|
void |
setRaiseErrorNoHitCollection(boolean raiseErrorNoHitCollection)
True to raise an exception if the input hit collection is not found in the event.
|
void |
setSkipNoClusterEvents(boolean skipNoClusterEvents)
True to raise a
NextEventException if no Clusters are created by the Clusterer. |
void |
setSortHits(boolean sortHits)
True to sort the clusters' hits before writing to event.
|
void |
setStoreHits(boolean storeHits)
True to store hit references into the output clusters.
|
void |
setValidateClusters(boolean validateClusters)
Set whether to validate the output.
|
void |
setWriteClusterCollection(boolean writeClusterCollection)
True to write the Cluster collection to the output LCIO file.
|
void |
startOfData()
Perform start of job initialization.
|
(package private) void |
validateClusters(org.lcsim.event.EventHeader event)
Perform basic validation of the cluster output collection, including checking
that the cluster collection was created, clusters are not null,
none of the clustered hits are null, and each hit exists in the input
hit collection.
|
protected String ecalName
protected HPSEcal3 ecal
protected HPSEcal3.NeighborMap neighborMap
protected String outputClusterCollectionName
protected String inputHitCollectionName
protected Clusterer clusterer
protected double[] cuts
protected boolean createEmptyClusterCollection
protected boolean raiseErrorNoHitCollection
protected boolean skipNoClusterEvents
protected boolean writeClusterCollection
protected boolean storeHits
protected boolean sortHits
protected boolean validateClusters
public void setEcalName(String ecalName)
ecalName
- The name of the ECAL.public void setOutputClusterCollectionName(String outputClusterCollectionName)
outputClusterCollectionName
- The name of the output Cluster collection.public void setInputHitCollectionName(String inputHitCollectionName)
inputHitCollectionName
- The name of the input hit collection.public void setSkipNoClusterEvents(boolean skipNoClusterEvents)
NextEventException
if no Clusters are created by the Clusterer.skipNoClusterEvents
- True to skip events with no clusters.public void setWriteClusterCollection(boolean writeClusterCollection)
writeClusterCollection
- True to write the Cluster to the event; false to mark as transient.public void setRaiseErrorNoHitCollection(boolean raiseErrorNoHitCollection)
raiseErrorNoHitCollection
- True to raise an exception if hit collection is not in event.public void setStoreHits(boolean storeHits)
LCIOConstants.CLBIT_HITS
on the collection flags.storeHits
- True to store hits.public void setSortHits(boolean sortHits)
sortHits
- True to sort hits.public void setClustererName(String name)
name
- The name or canonical class name of the Clusterer.public void setClusterer(Clusterer clusterer)
clusterer
- The Clusterer.public void setCreateEmptyClusterCollection(boolean createEmptyClusterCollection)
createEmptyClusterCollection
- True to write an empty collection to the event.public void setCuts(double[] cuts)
cuts
- The numerical cuts.public void setValidateClusters(boolean validateClusters)
validateClusters
- True to validate output.public void detectorChanged(org.lcsim.geometry.Detector detector)
detectorChanged
in class org.lcsim.util.Driver
public void startOfData()
startOfData
in class org.lcsim.util.Driver
public void process(org.lcsim.event.EventHeader event)
process
in class org.lcsim.util.Driver
<ClustererType extends Clusterer> ClustererType getClusterer()
Clusterer
using type inference for the concrete type.void validateClusters(org.lcsim.event.EventHeader event)
event
- The LCSim event.void printHitIDs(List<org.lcsim.event.CalorimeterHit> hits)
Copyright © 2019. All rights reserved.