public class BaseCluster extends Object implements Cluster
This is a concrete implementation of the Cluster
LCIO interface.
This version is an overhaul of the previous base class, with the following changes:
calculateProperties()
method so that it doesn't do a bunch of array copies.clone()
method.Cluster
,
CalorimeterHit
,
ClusterPropertyCalculator
,
TensorClusterPropertyCalculator
Modifier and Type | Field and Description |
---|---|
protected ClusterPropertyCalculator |
calc |
protected List<Cluster> |
clusters |
protected double[] |
directionError |
protected double |
energy |
protected double |
energyError |
protected List<Double> |
hitContributions |
protected List<CalorimeterHit> |
hits |
protected double |
iphi |
protected double |
itheta |
protected boolean |
needsPropertyCalculation |
protected int |
pid |
protected double[] |
position |
protected double[] |
positionError |
protected double[] |
shapeParameters |
protected double[] |
subdetectorEnergies |
protected int |
type |
Constructor and Description |
---|
BaseCluster()
The no argument constructor.
|
BaseCluster(Cluster cluster)
Copy constructor, which will create new arrays and lists in this object so the copied cluster's data is not incorrectly referenced.
|
BaseCluster(List<CalorimeterHit> hits)
Basic constructor that takes a list of hits.
|
BaseCluster(List<CalorimeterHit> hits,
double energy,
double energyError,
double[] position,
double[] positionError,
double iphi,
double itheta,
double[] directionError,
double[] shapeParameters,
int type,
int pid)
Almost fully qualified constructor, if the cluster's properties are already calculated.
|
Modifier and Type | Method and Description |
---|---|
void |
addCluster(Cluster cluster)
Add a sub-cluster to the cluster.
|
void |
addClusters(List<Cluster> clusters)
Add a list of sub-clusters to the cluster.
|
void |
addHit(CalorimeterHit hit)
Add a hit to the cluster with default energy contribution.
|
void |
addHit(CalorimeterHit hit,
double contribution)
Add a hit to the cluster with specified energy contribution.
|
void |
addHits(List<CalorimeterHit> hits)
Add a list of hits to the cluster.
|
void |
calculateProperties()
Calculate the properties of this cluster using the current
ClusterPropertyCalculator . |
(package private) void |
checkCalculateProperties()
Calculate properties if needs property calculation.
|
Object |
clone()
Clone to a new object using the copy constructor.
|
List<CalorimeterHit> |
getCalorimeterHits()
Get the list of CalorimeterHits of this cluster.
|
List<Cluster> |
getClusters()
Get the clusters that are part of this cluster.
|
double[] |
getDirectionError()
Get the direction error of the cluster as a double array of size 6.
|
double |
getEnergy()
Get the energy of the cluster, which by default will be the sum of the CalorimeterHit corrected energy values.
|
double |
getEnergyError()
Get the energy error.
|
double[] |
getHitContributions()
Get the individual hit contribution energies.
|
double |
getIPhi()
Get the intrinsic phi direction of the cluster.
|
double |
getITheta()
Get the intrinsic theta direction of the cluster.
|
int |
getParticleId()
Get the PDG ID of the particle hypothesis.
|
double[] |
getPosition()
Get the position of the cluster as a double array of size 3.
|
double[] |
getPositionError()
Get the position error of the cluster as a double array of size 6.
|
double[] |
getShape()
Get the shape parameters of the cluster as a double array of unspecified size.
|
int |
getSize()
Get the number of hits in the cluster, including hits in sub-clusters.
|
double[] |
getSubdetectorEnergies()
Get the list of subdetector energy contributions.
|
int |
getType()
Get a value defining the type of this cluster.
|
boolean |
hasPropertyCalculator()
Return
true if property calculator is set. |
boolean |
needsPropertyCalculation()
Return
true if cluster is flagged as needed a property calculation. |
void |
removeHit(CalorimeterHit hit)
Remove a hit from the cluster.
|
void |
setDirectionError(double[] directionError)
Set the direction error of the cluster.
|
void |
setEnergy(double energy)
Set a total energy of this cluster, overriding any energy value that may have been automatically calculated from hit energies.
|
void |
setEnergyError(double energyError)
Set the error on the energy measurement.
|
void |
setIPhi(double iphi)
Set the intrinsic phi of the cluster.
|
void |
setITheta(double itheta)
Set the intrinsic theta of the cluster.
|
void |
setNeedsPropertyCalculation(boolean needsPropertyCalculation)
Manually set whether the cluster needs property calculation.
|
void |
setParticleId(int pid)
Get the PDG ID of the particle hypothesis.
|
void |
setPosition(double[] position)
Set the position of the cluster.
|
void |
setPositionError(double[] positionError)
Set the position error of the cluster.
|
void |
setPropertyCalculator(ClusterPropertyCalculator calc)
Set a property calculator for computing position, etc.
|
void |
setShapeParameters(double[] shapeParameters)
Set the shape parameters of the cluster.
|
void |
setSubdetectorEnergies(double[] subdetectorEnergies)
Set the subdetector energies.
|
void |
setType(int type)
Set the type of the cluster.
|
protected ClusterPropertyCalculator calc
protected double[] directionError
protected double energy
protected double energyError
protected List<CalorimeterHit> hits
protected double iphi
protected double itheta
protected boolean needsPropertyCalculation
protected int pid
protected double[] position
protected double[] positionError
protected double[] shapeParameters
protected double[] subdetectorEnergies
protected int type
public BaseCluster()
public BaseCluster(Cluster cluster)
The hits in the CalorimeterHit
list are not themselves copied.
cluster
- the BaseCluster
to copypublic BaseCluster(List<CalorimeterHit> hits)
hits
- the list of CalorimeterHitspublic BaseCluster(List<CalorimeterHit> hits, double energy, double energyError, double[] position, double[] positionError, double iphi, double itheta, double[] directionError, double[] shapeParameters, int type, int pid)
hits
- the list of hitsenergy
- the total energyenergyError
- the energy errorposition
- the positionpositionError
- the position erroriphi
- the intrinsic phiitheta
- the intrinsic thetadirectionError
- the direction errorshapeParameters
- the shape parameterspublic void addCluster(Cluster cluster)
cluster
- the cluster to addpublic void addClusters(List<Cluster> clusters)
the
- list of clusters to addpublic void addHit(CalorimeterHit hit)
hit
- the hit to addpublic void addHit(CalorimeterHit hit, double contribution)
hit
- the hit to addcontribution
- the energy contribution of the hit [GeV]public void addHits(List<CalorimeterHit> hits)
the
- list of hits to addpublic void calculateProperties()
ClusterPropertyCalculator
. The calculated properties will be set on the
following class variables:position
, positionError
, iphi
, itheta
, directionError
, and shapeParameters
. Then
needsPropertyCalculation
will be set to false
until the cluster's state changes.void checkCalculateProperties()
public Object clone()
public List<CalorimeterHit> getCalorimeterHits()
getCalorimeterHits
in interface Cluster
CalorimeterHit
public List<Cluster> getClusters()
getClusters
in interface Cluster
public double[] getDirectionError()
getDirectionError
in interface Cluster
public double getEnergy()
public double getEnergyError()
getEnergyError
in interface Cluster
public double[] getHitContributions()
addHit(CalorimeterHit, double)
method.getHitContributions
in interface Cluster
public double getIPhi()
public double getITheta()
public int getParticleId()
getParticleId
in interface Cluster
public double[] getPosition()
getPosition
in interface Cluster
public double[] getPositionError()
getPositionError
in interface Cluster
public double[] getShape()
public int getSize()
public double[] getSubdetectorEnergies()
getSubdetectorEnergies
in interface Cluster
public int getType()
public boolean hasPropertyCalculator()
true
if property calculator is set.true
if property calculator is setpublic boolean needsPropertyCalculation()
true
if cluster is flagged as needed a property calculation.true
if cluster needs property calculationpublic void removeHit(CalorimeterHit hit)
hit
- the hit to removepublic void setDirectionError(double[] directionError)
directionError
- the direction error of the clusterIllegalArgumentException
- if array is wrong sizepublic void setEnergy(double energy)
energy
- the total energy of this clusterpublic void setEnergyError(double energyError)
energyError
- the error on the energ measurementpublic void setIPhi(double iphi)
iphi
- the intrinsic phi of the clusterpublic void setITheta(double itheta)
iphi
- The intrinsic theta of the cluster.public void setNeedsPropertyCalculation(boolean needsPropertyCalculation)
needsPropertyCalculation
- true
if cluster needs property calculationpublic void setParticleId(int pid)
public void setPosition(double[] position)
position
- the position of the clusterIllegalArgumentException
- if array is wrong sizepublic void setPositionError(double[] positionError)
positionError
- the position error of the clusterIllegalArgumentException
- if array is wrong sizepublic void setPropertyCalculator(ClusterPropertyCalculator calc)
calc
- the property calculatorpublic void setShapeParameters(double[] shapeParameters)
shapeParameters
- the shape parameterspublic void setSubdetectorEnergies(double[] subdetectorEnergies)
subdetectorEnergies
- the subdetector energiespublic void setType(int type)
type
- the type of the clusterCopyright © 2016 Linear Collider Detector (LCD). All rights reserved.