Commit in lcsim/src/org/lcsim/contrib/uiowa on MAIN
NonTrivialPFA.java+23-81.3 -> 1.4
MJC: Separate out clustering and particle-making for small photons in NonTrivialPFA

lcsim/src/org/lcsim/contrib/uiowa
NonTrivialPFA.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- NonTrivialPFA.java	10 Apr 2007 20:43:08 -0000	1.3
+++ NonTrivialPFA.java	12 Apr 2007 22:40:25 -0000	1.4
@@ -289,11 +289,12 @@
 	    String smallPhotonParticleList_RonCalib = "small photons (ron calib)";
 	    String haloMinusPhotonClusterList = "skeletons plus halo minus small photons";
 	    String smallClusterMinusPhotonClusterList = "mst clusters linked (<10 hits) minus small photons";
+	    String smallPhotonClusterList = "small photon clusters";
 	    SimpleFragmentIdentifier fragID = new SimpleFragmentIdentifier(10, 100.0);
 	    fragID.addParticleList(tempParticleList);
-            // FIXME: Separate out the cluster formation from the particle making to avoid duplication of haloMinusPhotonClusterList, smallClusterMinusPhotonClusterList
-	    addSmallPhotonFinder(prefix+"adhoc: ", fragID, haloClusterList, smallClusterList, smallPhotonParticleList_adhoc,    haloMinusPhotonClusterList, smallClusterMinusPhotonClusterList, adHocCalib);
-	    addSmallPhotonFinder(prefix+"ron: ", fragID, haloClusterList, smallClusterList, smallPhotonParticleList_RonCalib, haloMinusPhotonClusterList, smallClusterMinusPhotonClusterList, ronPhotonCalib);
+	    addSmallPhotonClusterFinder(prefix, fragID, haloClusterList, smallClusterList, haloMinusPhotonClusterList, smallClusterMinusPhotonClusterList, smallPhotonClusterList);
+            addSmallPhotonParticleFinder(prefix+"adhoc: ",smallPhotonClusterList,smallPhotonParticleList_adhoc,adHocCalib);
+            addSmallPhotonParticleFinder(prefix+"ron: ",smallPhotonClusterList,smallPhotonParticleList_RonCalib,ronPhotonCalib);
 
 	    // Merge/handle fragments
 	    SimpleFragmentMerger fragMerge = new SimpleFragmentMerger();
@@ -762,11 +763,19 @@
 
     protected void addSmallPhotonFinder(String prefix, FragmentIdentifier fragID, String haloClusterList, String smallClusterList, String smallPhotonParticleList, String haloMinusPhotonClusterList, String smallClusterMinusPhotonClusterList, ClusterEnergyCalculator calibration)
     {
+	String smallPhotonClusterList=prefix+"small photon cluster list";
+        addSmallPhotonClusterFinder(prefix,fragID,haloClusterList,smallClusterList,haloMinusPhotonClusterList,smallClusterMinusPhotonClusterList,smallPhotonClusterList);
+        addSmallPhotonParticleFinder(prefix,smallPhotonClusterList,smallPhotonParticleList,calibration);
+    }
+
+    protected void addSmallPhotonClusterFinder(String prefix, FragmentIdentifier fragID, String haloClusterList, String smallClusterList, String haloMinusPhotonClusterList, String smallClusterMinusPhotonClusterList, String smallPhotonClusterList)
+    {
 	// First, "fragments" in the first few ECAL layers are probably photons.
 	FragmentIdentifierDecisionMaker isFragmentDecisionDriver = new FragmentIdentifierDecisionMaker(fragID);
 	AndDecisionMakerSingle<Cluster> isSmallPhoton = new AndDecisionMakerSingle<Cluster>();
 	isSmallPhoton.addDecisionMaker(isFragmentDecisionDriver);
 	isSmallPhoton.addDecisionMaker(new ClusterFirstLayerDecision(4, new HitInECALDecision()));
+
 	ClusterListFilterDriver isSmallPhotonFilter1 = new ClusterListFilterDriver();
 	ClusterListFilterDriver isSmallPhotonFilter2 = new ClusterListFilterDriver();
 	isSmallPhotonFilter1.setInputDecision(isSmallPhoton);
@@ -777,18 +786,24 @@
 	isSmallPhotonFilter2.setOutputList(prefix+"small photon clusters 2");
 	isSmallPhotonFilter1.setOutputClusterListFail(smallClusterMinusPhotonClusterList);
 	isSmallPhotonFilter2.setOutputClusterListFail(haloMinusPhotonClusterList);
+
 	ListAddDriver<Cluster> mergeSmallPhotonClusters = new ListAddDriver<Cluster>();
 	mergeSmallPhotonClusters.addInputList(prefix+"small photon clusters 1");
 	mergeSmallPhotonClusters.addInputList(prefix+"small photon clusters 2");
-	mergeSmallPhotonClusters.setOutputList(prefix+"small photon clusters");
-	SimpleNeutralParticleMaker smallPhotonMaker = new SimpleNeutralParticleMaker(22);
-	smallPhotonMaker.setCalibration(calibration);
-	smallPhotonMaker.setInputClusterList(prefix+"small photon clusters");
-	smallPhotonMaker.setOutputParticleList(smallPhotonParticleList);
+	mergeSmallPhotonClusters.setOutputList(smallPhotonClusterList);
+
 	add(isFragmentDecisionDriver);
 	add(isSmallPhotonFilter1);
 	add(isSmallPhotonFilter2);
 	add(mergeSmallPhotonClusters);
+    }
+
+    protected void addSmallPhotonParticleFinder(String prefix, String smallPhotonClusterList, String smallPhotonParticleList, ClusterEnergyCalculator calibration)
+    {
+	SimpleNeutralParticleMaker smallPhotonMaker = new SimpleNeutralParticleMaker(22);
+	smallPhotonMaker.setCalibration(calibration);
+	smallPhotonMaker.setInputClusterList(smallPhotonClusterList);
+	smallPhotonMaker.setOutputParticleList(smallPhotonParticleList);
 	add(smallPhotonMaker);	
     }
     
CVSspam 0.2.8