SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.12 -r1.13
--- CalorimeterHitPlots.java 24 Aug 2005 07:42:03 -0000 1.12
+++ CalorimeterHitPlots.java 29 Sep 2005 19:45:06 -0000 1.13
@@ -67,6 +67,17 @@
private void fill(List<SimCalorimeterHit> hits)
{
+ /* test for SF */
+ boolean haveSF = true;
+ try
+ {
+ hits.get(0).getCorrectedEnergy();
+ }
+ catch (Exception e)
+ {
+ haveSF = false;
+ }
+
if ( hits.size() > 0 )
{
SegmentationBase segmentation = (SegmentationBase)eventHeader.getMetaData(hits).getIDDecoder();
@@ -82,6 +93,7 @@
}
/* segmentation plots */
+ /* FIXME: Clean this up! It is too slow. */
if ( segmentation instanceof ProjectiveCylinder ||
segmentation instanceof NonprojectiveCylinder ||
segmentation instanceof ProjectiveZPlane )
@@ -108,10 +120,11 @@
}
/* corrected energy */
- hitCorrectedEnergy.fill(hit.getCorrectedEnergy());
-
- /* raw vs corrected */
- hitRawVsCorrectedEnergy.fill(hit.getRawEnergy(), hit.getCorrectedEnergy());
+ if (haveSF)
+ {
+ hitCorrectedEnergy.fill(hit.getCorrectedEnergy());
+ hitRawVsCorrectedEnergy.fill(hit.getRawEnergy(), hit.getCorrectedEnergy());
+ }
/* MCP plots */
int nmcp = hit.getMCParticleCount();
@@ -137,15 +150,18 @@
mcpMissing.fill(mcpMissingCount);
/* cheated clusters */
- if (clusterCount < 9000)
+ if ( haveSF )
{
- Map<MCParticle, CheatCluster> cheatClusters = clusterer.findClusters(hits);
- for( MCParticle particle : cheatClusters.keySet() )
+ if (clusterCount < 9000)
{
- CheatCluster cluster = cheatClusters.get(particle);
- double kE = particle.getEnergy() - particle.getMass();
- mcpCluster.fill(kE, cluster.getEnergy());
- clusterCount += 1;
+ Map<MCParticle, CheatCluster> cheatClusters = clusterer.findClusters(hits);
+ for( MCParticle particle : cheatClusters.keySet() )
+ {
+ CheatCluster cluster = cheatClusters.get(particle);
+ double kE = particle.getEnergy() - particle.getMass();
+ mcpCluster.fill(kE, cluster.getEnergy());
+ clusterCount += 1;
+ }
}
}
}