lcsim/src/org/lcsim/contrib/uiowa
diff -u -r1.1 -r1.2
--- SetUpDTreeForReclustering.java 16 Jan 2008 19:30:17 -0000 1.1
+++ SetUpDTreeForReclustering.java 20 Mar 2008 02:26:19 -0000 1.2
@@ -10,6 +10,8 @@
public class SetUpDTreeForReclustering extends Driver
{
+ boolean useOldRonPhotonFinder = false;
+
public SetUpDTreeForReclustering() {
// Convert DigiSim's lists to hitmaps:
HitListToHitMapDriver converter1 = new HitListToHitMapDriver();
@@ -30,15 +32,41 @@
add(converter4);
// Find photons in ECAL
- org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01 photonFinderEcalBarrel = new org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01("EcalBarrDigiHitMap", "EcalBarrDigiHitMapWithoutPhotons", "EcalBarrPhotonClusters");
- org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01 photonFinderEcalEndcap = new org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01("EcalEndcapDigiHitMap", "EcalEndcapDigiHitMapWithoutPhotons", "EcalEndcapPhotonClusters");
- add(photonFinderEcalBarrel);
- add(photonFinderEcalEndcap);
- ListAddDriver<Cluster> mergePhotonClusters = new ListAddDriver<Cluster>(Cluster.class);
- mergePhotonClusters.addInputList("EcalBarrPhotonClusters");
- mergePhotonClusters.addInputList("EcalEndcapPhotonClusters");
- mergePhotonClusters.setOutputList("PhotonClustersForDTree");
- add(mergePhotonClusters);
+ if (useOldRonPhotonFinder) {
+ // Make photons in barrel & endcap separately
+ org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01 photonFinderEcalBarrel = new org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01("EcalBarrDigiHitMap", "EcalBarrDigiHitMapWithoutPhotons", "EcalBarrPhotonClusters");
+ org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01 photonFinderEcalEndcap = new org.lcsim.contrib.uiowa.RonPhotonFinder.RonPhotonFinderSid01("EcalEndcapDigiHitMap", "EcalEndcapDigiHitMapWithoutPhotons", "EcalEndcapPhotonClusters");
+ add(photonFinderEcalBarrel);
+ add(photonFinderEcalEndcap);
+ // Merge to a single list of photons
+ ListAddDriver<Cluster> mergePhotonClusters = new ListAddDriver<Cluster>(Cluster.class);
+ mergePhotonClusters.addInputList("EcalBarrPhotonClusters");
+ mergePhotonClusters.addInputList("EcalEndcapPhotonClusters");
+ mergePhotonClusters.setOutputList("PhotonClustersForDTree");
+ add(mergePhotonClusters);
+ } else {
+ // Merge barrel & endcap hits
+ HitMapAddDriver combineEcal = new HitMapAddDriver();
+ combineEcal.addInputHitMap("EcalBarrDigiHitMap");
+ combineEcal.addInputHitMap("EcalEndcapDigiHitMap");
+ combineEcal.setOutputHitMap("EcalDigiHitMap");
+ add(combineEcal);
+ // Make photons in barrel & endcap together
+ org.lcsim.contrib.Cassell.recon.DTPhotons.RonDTPhotonFinderSid01 photonFinder = new org.lcsim.contrib.Cassell.recon.DTPhotons.RonDTPhotonFinderSid01("EcalDigiHitMap", "EcalDigiHitMapWithoutPhotons", "PhotonClustersForDTree");
+ add(photonFinder);
+ // Split back into barrel & endcap
+ // This is a little fiddly -- need to do one subtraction to
+ // identify the photon hits, then a second to remove the photon
+ // hits from the previous hitmaps.
+ HitMapSubtractDriver separateEcal1 = new HitMapSubtractDriver("EcalBarrDigiHitMap", "EcalDigiHitMapWithoutPhotons", "EcalBarrel_photonHits");
+ HitMapSubtractDriver separateEcal2 = new HitMapSubtractDriver("EcalEndcapDigiHitMap", "EcalDigiHitMapWithoutPhotons", "EcalEndcap_photonHits");
+ HitMapSubtractDriver separateEcal3 = new HitMapSubtractDriver("EcalBarrDigiHitMap", "EcalBarrel_photonHits", "EcalBarrDigiHitMapWithoutPhotons");
+ HitMapSubtractDriver separateEcal4 = new HitMapSubtractDriver("EcalEndcapDigiHitMap", "EcalEndcap_photonHits", "EcalEndcapDigiHitMapWithoutPhotons");
+ add(separateEcal1);
+ add(separateEcal2);
+ add(separateEcal3);
+ add(separateEcal4);
+ }
// Run DTree
DirectedTreeDriver treeDriverEcalBarr = new DirectedTreeDriver();