public final class ClusterDiagnosticDriver
extends org.lcsim.util.Driver
ClusterDiagnosticDriver
performs diagnostic checks on
run data to verify that clustering is being performed as expected
and that there are no errors occurring. It takes GTP clusters created
by the software simulation (simulated clusters) and compares them to
GTP clusters reported by the hardware (hardware, or SSP, clusters).
ConfigurationManager
class automatically. Note that a driver to initialize this class
must be present in the event chain in order for the diagnostics to
initialize and function.Modifier and Type | Field and Description |
---|---|
private String |
bankCollectionName
The LCIO collection containing the trigger banks.
|
private String |
clusterCollectionName
The LCIO collection containing GTP clusters.
|
private List<Pair<Long,double[]>> |
efficiencyPlotEntries
Stores entries for the efficiency over time plot.
|
private double |
energyBinSize
Defines the bin size used for energy plots.
|
private double |
energyVerificationThreshold
The maximum energy by which two matched clusters may vary and
still be verified.
|
private double |
energyXMax
Defines the upper limit of the energy plot x-axes.
|
private int |
failedCloneBug |
private static String |
failedEnergyEnergyDiffPlot
Plots the difference in energy between matched clusters which failed due to energy.
|
private static String |
failedEnergyHitDiffPlot
Plots the difference in hit count between matched clusters which failed due to energy.
|
private int |
failedHitCountDeadtime
Indicates the number of failed cluster events that may have
lost a hit due to deadtime issues.
|
private static String |
failedHitCountEnergyDiffPlot
Plots the difference in energy between matched clusters which failed due to hit count.
|
private static String |
failedHitCountHitDiffPlot
Plots the difference in hit count between matched clusters which failed due to hit count.
|
private int |
failedMatchEnergy
Indicates the number simulated/hardware cluster pairs that did
not verify because the matched clusters did not in energy within
the bounds set by the energy verification threshold.
|
private int |
failedMatchHitCount
Indicates the number simulated/hardware cluster pairs that did
not verify because the matched clusters did not in hit count
within the bounds set by the hit count verification threshold.
|
private int |
failedMatchPosition
Indicates the number simulated/hardware cluster pairs that did
not verify because no two clusters were found with a matching
seed position.
|
private int |
failedMatchTime
Indicates the number simulated/hardware cluster pairs that did
not verify because no two clusters were found with a matching
time-stamp.
|
private int |
failedNearSeedThreshold
Indicates the number of failed cluster events that have a seed
hit near the seed energy threshold.
|
private int |
failedNegativeEnergyHit
Indicates the number of failed cluster events where the energies
were identical, but hit count differed.
|
private int |
failedPositionDeadtime
Indicates the number of failed cluster events that occur within
the dead time window of the event start and also have a t = 0
cluster with a hit on the same channel.
|
private boolean |
firstInstantiation
Indicates whether the DAQ configuration has updated before or
not.
|
private long |
firstStartTime
Tracks the start time of the first observed event.
|
private int |
goodSimulatedClusterCount
Indicates the number of hardware clusters processed which were
safe from pulse-clipping.
|
private int |
hardwareClusterCount
Indicates the number of hardware clusters processed.
|
private String |
hitCollectionName
The LCIO collection containing FADC hits.
|
private int |
hitVerificationThreshold
The maximum number of hits by which two matched clusters may
vary and still be verified.
|
private long |
localEndTime
Tracks the current time of the current event for the purpose of
identifying the end of a local sample.
|
private int |
localGoodSimulatedClusterCount
Tracks the number of pulse-clipping-safe simulated clusters in
the local window.
|
private int |
localMatchedClusters
Tracks the number of matched clusters in the local window.
|
private long |
localStartTime
Tracks the start time of the current local sample.
|
private long |
localWindowSize
Defines the length of time over which statistics are collected
in order to produce an entry into the efficiency over time plot.
|
private LocalOutputLogger |
logger
The event logger.
|
private int |
matchedClusters
Indicates the number simulated/hardware cluster pairs that were
successfully verified.
|
private static String |
matchedClusters2DEnergyDiffPlot
Plots the 2D difference in energy between matched clusters.
|
private static String |
matchedClusters2DHitDiffPlot
Plots the 2D difference in hit count between matched clusters.
|
private static String |
matchedClustersEnergyDiffPlot
Plots the difference in energy between matched clusters.
|
private static String |
matchedClustersEnergyEfficiencyPlot
Plots the energy efficiency of matched cluster pairs.
|
private static String |
matchedClustersEnergyPlot
Plots the energy distribution of matched cluster pairs.
|
private static String |
matchedClustersHitDiffPlot
Plots the difference in hit count between matched clusters.
|
private static String |
matchedClustersTimeEfficiencyPlot
Plots the time efficiency of matched cluster pairs.
|
private static String |
matchedClustersTimePlot
Plots the time distribution of matched cluster pairs.
|
private static String |
MODULE_HEADER
Directory structure for all clustering diagnostic plots.
|
private int |
noiseEventThreshold
The number of hits required to label an event a "noise event"
when
skipNoiseEvents is enabled. |
private int |
nsa
The number of integration samples after a threshold-crossing
event used in hit pulse-processing.
|
private int |
nsb
The number of integration samples before a threshold-crossing
event used in hit pulse-processing.
|
private boolean |
printOnFail
Whether events where at least one cluster fails to verify should
produce a detailed event readout.
|
private static String |
runtimeEfficiencyPlot
Plots the efficiency over the course of the run.
|
private int |
simulatedClusterCount
Indicates the number of simulated clusters processed.
|
private boolean |
skipNoiseEvents
Whether events with more than
noiseEventThreshold
hits should be skipped. |
private static String |
softwareClustersEnergyPlot
Plots the energy distribution of safe simulated clusters.
|
private static String |
softwareClustersTimePlot
Plots the time distribution of safe simulated clusters.
|
private boolean |
verbose
Whether every event should produce a detailed event printout.
|
private int |
windowWidth
The size of the event window in nanoseconds.
|
Constructor and Description |
---|
ClusterDiagnosticDriver() |
Modifier and Type | Method and Description |
---|---|
void |
endOfData()
Prints out final run verification statistics and generates
efficiency plots.
|
private static List<org.lcsim.event.CalorimeterHit> |
getCalorimeterHits(org.lcsim.event.EventHeader event,
String hitCollectionName)
Gets the a of
CalorimeterHit objects from the
argument event from the LCIO collection hitCollectionName . |
private static Set<Point> |
getClusterHitIndices(org.lcsim.event.Cluster cluster) |
private static Set<Point> |
getClusterPossibleHitIndices(org.lcsim.event.Cluster cluster) |
private static List<SSPCluster> |
getHardwareClusters(org.lcsim.event.EventHeader event,
String bankCollectionName)
Gets the a of
SSPCluster objects from the argument
event from the SSP bank contained in the LCIO collection
bankCollectionName . |
private static double |
getRatioError(double num,
double sigmaNum,
double den,
double sigmaDen) |
private static List<org.lcsim.event.Cluster> |
getSimulatedClusters(org.lcsim.event.EventHeader event,
String clusterCollectionName)
Gets the a of
Cluster objects from the argument
event from the LCIO collection clusterCollectionName . |
private void |
instantiatePlots()
Instantiates the diagnostics plots.
|
private static boolean |
isHitMatch(org.lcsim.event.Cluster simCluster,
SSPCluster sspCluster,
int hitWindow)
Performs the verification check for cluster hit counts.
|
private static List<ClusterMatchedPair> |
matchSimulatedToHardware(Collection<org.lcsim.event.Cluster> simulatedClusters,
Collection<SSPCluster> hardwareClusters,
double energyWindow,
int hitWindow,
LocalOutputLogger logger)
Performs cluster matching between a collection of simulated
clusters and a collection of hardware clusters using the strictly
time-compliant algorithm.
|
void |
process(org.lcsim.event.EventHeader event)
Obtains all necessary collections, performs cluster verification,
and outputs event statistics.
|
void |
setBankCollectionName(String collection)
Sets the name of LCIO collection containing the trigger banks.
|
void |
setClusterCollectionName(String collection)
Sets the name of LCIO collection containing simulated GTP clusters.
|
void |
setEnergyAxisBinSize(double binSize)
Sets the size of the bins in energy plots.
|
void |
setEnergyAxisMaximum(double xMax)
Sets the maximum value of the x-axis for energy plots.
|
void |
setEnergyVerificationThreshold(double thresold)
Sets the maximum cluster energy by which a matched cluster pair
may vary and still verify.
|
void |
setHitCollectionName(String collection)
Sets the name of LCIO collection containing hits.
|
void |
setHitVerificationThreshold(int thresold)
Sets the maximum number of hits by which a matched cluster pair
may vary and still verify.
|
void |
setLocalWindowSize(int size)
Defines the size of the local window for use in the efficiency
over time plot.
|
void |
setNoiseThreshold(int threshold)
Sets the total number of hits that must be present in an event
in order for it to be considered a noise event.
|
void |
setPrintOnVerificationFailure(boolean state)
When enabled, events where at least one cluster which is not
pulse-clipped will print a full event summary.
|
void |
setSkipNoiseEvents(boolean state)
Indicates whether events which exceed a certain number of total
hits, defined by
noiseEventThreshold , should be
treated as noise events and skipped. |
void |
setVerbose(boolean state)
Sets whether the full event verification summary should be printed
on every event or not.
|
void |
startOfData()
Connects the driver to the DAQ configuration manager and updates
DAQ settings as they become available.
|
private static String |
toString(org.lcsim.event.CalorimeterHit hit)
Converts a
CalorimeterHit to a basic descriptive
string. |
private int hardwareClusterCount
private int simulatedClusterCount
private int goodSimulatedClusterCount
private int matchedClusters
private int failedMatchTime
private int failedMatchEnergy
private int failedMatchHitCount
private int failedMatchPosition
private int failedNearSeedThreshold
private int failedPositionDeadtime
private int failedHitCountDeadtime
private int failedNegativeEnergyHit
private int failedCloneBug
private int localMatchedClusters
private long localWindowSize
private long localEndTime
private long localStartTime
private long firstStartTime
private int localGoodSimulatedClusterCount
private List<Pair<Long,double[]>> efficiencyPlotEntries
private int noiseEventThreshold
skipNoiseEvents
is enabled.private int hitVerificationThreshold
private double energyVerificationThreshold
private boolean verbose
private boolean printOnFail
private boolean skipNoiseEvents
noiseEventThreshold
hits should be skipped.private double energyXMax
private double energyBinSize
private String hitCollectionName
private String bankCollectionName
private String clusterCollectionName
private int nsa
private int nsb
private int windowWidth
private boolean firstInstantiation
private LocalOutputLogger logger
private static final String MODULE_HEADER
private static final String softwareClustersTimePlot
private static final String softwareClustersEnergyPlot
private static final String matchedClustersTimePlot
private static final String matchedClustersEnergyPlot
private static final String matchedClustersTimeEfficiencyPlot
matchedClustersTimePlot
/ softwareClustersTimePlot
.private static final String matchedClustersEnergyEfficiencyPlot
softwareClustersEnergyPlot
/ matchedClustersEnergyPlot
.private static final String matchedClustersEnergyDiffPlot
private static final String matchedClustersHitDiffPlot
private static final String failedEnergyEnergyDiffPlot
private static final String failedHitCountEnergyDiffPlot
private static final String failedEnergyHitDiffPlot
private static final String failedHitCountHitDiffPlot
private static final String matchedClusters2DEnergyDiffPlot
private static final String matchedClusters2DHitDiffPlot
private static final String runtimeEfficiencyPlot
private static final Set<Point> getClusterHitIndices(org.lcsim.event.Cluster cluster)
private static final Set<Point> getClusterPossibleHitIndices(org.lcsim.event.Cluster cluster)
private static final double getRatioError(double num, double sigmaNum, double den, double sigmaDen)
public void endOfData()
endOfData
in class org.lcsim.util.Driver
public void process(org.lcsim.event.EventHeader event)
process
in class org.lcsim.util.Driver
public void startOfData()
startOfData
in class org.lcsim.util.Driver
private void instantiatePlots()
private static final List<org.lcsim.event.CalorimeterHit> getCalorimeterHits(org.lcsim.event.EventHeader event, String hitCollectionName)
CalorimeterHit
objects from the
argument event from the LCIO collection hitCollectionName
.event
- - The event object.hitCollectionName
- - The name of the hit collection.CalorimeterHit
objects, or returns null
if no collection was found.private static final List<SSPCluster> getHardwareClusters(org.lcsim.event.EventHeader event, String bankCollectionName)
SSPCluster
objects from the argument
event from the SSP bank contained in the LCIO collection
bankCollectionName
.event
- - The event object.bankCollectionName
- - The name of the bank collection
containing the SSP bank, which contains the cluster list.SSPCluster
objects,
or returns null
if no bank collection or no SSP bank
was found.private static final List<org.lcsim.event.Cluster> getSimulatedClusters(org.lcsim.event.EventHeader event, String clusterCollectionName)
Cluster
objects from the argument
event from the LCIO collection clusterCollectionName
.event
- - The event object.clusterCollectionName
- - The name of the cluster collection.Cluster
objects, or
returns null
if no collection was found.private static final boolean isHitMatch(org.lcsim.event.Cluster simCluster, SSPCluster sspCluster, int hitWindow)
simCluster
- - The simulated cluster to check.sspCluster
- - The hardware cluster to check.hitWindow
- - The range by which hit counts are allowed to
differ between the clusters.true
if the hit counts match to
within threshold and false
otherwise.private static final List<ClusterMatchedPair> matchSimulatedToHardware(Collection<org.lcsim.event.Cluster> simulatedClusters, Collection<SSPCluster> hardwareClusters, double energyWindow, int hitWindow, LocalOutputLogger logger)
simulatedClusters
- - A collection of GTP clusters generated
by the software simulation.hardwareClusters
- - A collection of GTP clusters reported
in the SSP bank by the hardware.energyWindow
- - The window of allowed deviation between
the simulated cluster and hardware cluster energies. Units are
in GeV.hitWindow
- - The window of allowed deviation between
the simulated cluster and hardware cluster hit counts.logger
- - The logger object to which diagnostic text should
be written.List
containing all the matched
simulated/hardware cluster pairs as well as their verification
statuses.private static final String toString(org.lcsim.event.CalorimeterHit hit)
CalorimeterHit
to a basic descriptive
string.hit
- - The hit to be converted.String
.public void setBankCollectionName(String collection)
collection
- - The collection name.public void setClusterCollectionName(String collection)
collection
- - The collection name.public void setEnergyAxisBinSize(double binSize)
binSize
- - The bin width in units of GeV.public void setEnergyAxisMaximum(double xMax)
xMax
- - The x-axis maximum, in units of GeV.public void setEnergyVerificationThreshold(double thresold)
thresold
- - The maximum difference in energy. Value is
inclusive and in units of GeV.public void setHitCollectionName(String collection)
collection
- - The collection name.public void setHitVerificationThreshold(int thresold)
thresold
- - The maximum difference in hits. Value is
inclusive.public void setLocalWindowSize(int size)
size
- - The duration of local efficiency measurements.public void setNoiseThreshold(int threshold)
skipNoiseEvents
is set to true
.threshold
- - The noise hit threshold.public void setPrintOnVerificationFailure(boolean state)
state
- - true
prints the event summary and
false
does not.public void setSkipNoiseEvents(boolean state)
noiseEventThreshold
, should be
treated as noise events and skipped.state
- - true
causes noise events to be skipped
and false
does not.public void setVerbose(boolean state)
state
- - true
prints the event summary and
false
does not.Copyright © 2019. All rights reserved.