lcsim-contrib/src/main/java/org/lcsim/contrib/Cassell/recon
diff -N TestSetUpDTreeForReclustering.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TestSetUpDTreeForReclustering.java 14 Mar 2011 17:34:02 -0000 1.1
@@ -0,0 +1,374 @@
+package org.lcsim.contrib.Cassell.recon;
+
+import org.lcsim.recon.pfa.structural.*;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.Cluster;
+import org.lcsim.recon.cluster.directedtree.DirectedTreeDriver;
+import org.lcsim.recon.cluster.mipfinder.ShowerPointFinderDriver;
+import org.lcsim.recon.cluster.mipfinder.ShowerPointFinderDriver2;
+import org.lcsim.recon.cluster.mipfinder.trackxtrap.*;
+import org.lcsim.recon.cluster.muonfinder.MuonFinderWrapper;
+import org.lcsim.recon.cluster.muonfinder.MuonFinderWrapper3;
+import org.lcsim.recon.cluster.util.HitNearBarrelEndcapBoundaryDecision;
+import org.lcsim.recon.cluster.util.RemoveHitsFromClusters;
+import org.lcsim.recon.cluster.util.VetoHitsFromClusters;
+import org.lcsim.recon.cluster.util.ClusterMapSubtractDriver;
+import org.lcsim.recon.pfa.identifier.AmbiguousTrackToClusterMapMaker;
+import org.lcsim.recon.pfa.identifier.HelixExtrapolator;
+import org.lcsim.recon.pfa.identifier.TrackToElectronMapMaker;
+import org.lcsim.recon.pfa.identifier.TrackToGenericClusterMapMaker;
+import org.lcsim.recon.pfa.identifier.TrackToMipClusterMapMaker;
+import org.lcsim.recon.pfa.identifier.TrackToPreShowerMipMapMaker;
+import org.lcsim.util.Driver;
+import org.lcsim.util.ListAddDriver;
+import org.lcsim.util.ListSubtractDriver;
+import org.lcsim.util.TransientFlagDriver;
+import org.lcsim.util.decision.ListFilterDriver;
+import org.lcsim.util.hitmap.ClusterListToHitMapDriver;
+import org.lcsim.util.hitmap.HitListToHitMapDriver;
+import org.lcsim.util.hitmap.HitMapAddDriver;
+import org.lcsim.util.hitmap.HitMapAndDriver;
+import org.lcsim.util.hitmap.HitMapSubtractDriver;
+import org.lcsim.recon.util.CalorimeterInformation;
+import org.lcsim.geometry.Calorimeter.CalorimeterType;
+
+public class TestSetUpDTreeForReclustering extends Driver
+{
+ String inputTrackList;
+ Collection<String> allHitLists;
+ Collection<String> recoHitLists;
+ Collection<String> hitsForMST;
+ HelixExtrapolator findCluster;
+ boolean init;
+ boolean useNewInitialMipFinding = false;
+ public TestSetUpDTreeForReclustering(String inputTrackListi, Collection<String> allHitListsi, Collection<String> recoHitListsi, Collection<String> hitsForMSTi, HelixExtrapolator findClusteri) {
+ inputTrackList = inputTrackListi;
+ allHitLists = allHitListsi;
+ recoHitLists = recoHitListsi;
+ hitsForMST = hitsForMSTi;
+ findCluster = findClusteri;
+ init = false;
+ }
+ public void setUseNewInitialMipFinding(boolean x){useNewInitialMipFinding = x;}
+ protected void process(EventHeader event)
+ {
+ if(!init)
+ {
+ init = true;
+ CalorimeterInformation ci = CalorimeterInformation.instance();
+ // Convert DigiSim's lists to hitmaps:
+ Map<String,String> mapListToHitMap = new HashMap<String,String>();
+ for (String inputName : allHitLists) {
+ String outputName = (new String(inputName)).replace("DigiHits", "DigiHitMap");
+ mapListToHitMap.put(inputName, outputName);
+ HitListToHitMapDriver converter = new HitListToHitMapDriver();
+ converter.addInputList(inputName);
+ converter.setOutput(outputName);
+ add(converter);
+ }
+ // Convenience: Merge ECAL barrel & ECAL endcap
+ HitMapAddDriver combineEcal = new HitMapAddDriver();
+ combineEcal.addInputHitMap((new String(ci.getDigiCollectionName(CalorimeterType.EM_BARREL))).replace("DigiHits", "DigiHitMap"));
+ combineEcal.addInputHitMap((new String(ci.getDigiCollectionName(CalorimeterType.EM_ENDCAP))).replace("DigiHits", "DigiHitMap"));
+ combineEcal.setOutputHitMap("EcalDigiHitMap");
+ add(combineEcal);
+ // Convenience: Merge HCAL barrel & HCAL endcap
+ HitMapAddDriver combineHcal = new HitMapAddDriver();
+ combineHcal.addInputHitMap((new String(ci.getDigiCollectionName(CalorimeterType.HAD_BARREL))).replace("DigiHits", "DigiHitMap"));
+ combineHcal.addInputHitMap((new String(ci.getDigiCollectionName(CalorimeterType.HAD_ENDCAP))).replace("DigiHits", "DigiHitMap"));
+ combineHcal.setOutputHitMap("HcalDigiHitMap");
+ add(combineHcal);
+ // Make combined hitmap of all hits (for muon searches)
+ HitMapAddDriver combineAll = new HitMapAddDriver();
+ for (String inputName : allHitLists) {
+ combineAll.addInputHitMap(mapListToHitMap.get(inputName));
+ combineAll.setOutputHitMap("AllDigiHitMap");
+ }
+ add(combineAll);
+ // Make combined hitmap of all reconstructable hits
+ HitMapAddDriver combineReco = new HitMapAddDriver();
+ for (String inputName : recoHitLists) {
+ combineReco.addInputHitMap(mapListToHitMap.get(inputName));
+ combineReco.setOutputHitMap("RecoDigiHitMap");
+ }
+ add(combineReco);
+
+ // Extrapolate tracks through the calorimeters for later use
+ add(new TrackXtrapThruCalDriver(findCluster,inputTrackList,"TrackXtrapInfo"));
+
+ // Find photons in ECAL
+ {
+ // We have to use ALL hits for the photon-finder -- this is because it uses the
+ // presence of hits in early layers to veto on charged particles.
+ org.lcsim.contrib.Cassell.recon.photons.TestPhotonFinder photonFinder = new org.lcsim.contrib.Cassell.recon.photons.TestPhotonFinder("EcalDigiHitMap", "EcalDigiHitMapMinusPreliminaryPhotons", "PreliminaryPhotonClustersForDTree","PotentialElectronClusters");
+// org.lcsim.recon.cheater.CheatPhotonFinder chphotonFinder = new org.lcsim.recon.cheater.CheatPhotonFinder("EcalDigiHitMap", "Dummy", "CheatPhotonClustersForDTree");
+// add(chphotonFinder);
+ add(photonFinder);
+ add(new TransientFlagDriver("PreliminaryPhotonClustersForDTree"));
+ add(new TransientFlagDriver("PotentialElectronClusters"));
+
+ // Check for electrons and set those to one side so we don't accidentally cluster them or use their tracks:
+ add(new TrackToElectronMapMaker(findCluster, "PotentialElectronClusters", inputTrackList, "MapElectronTracksToClusters", "TracksWithoutElectrons", "ElectronMapClusters"));
+ add(new ClusterMapSubtractDriver("PreliminaryPhotonClustersForDTree", "ElectronMapClusters", "PreliminaryPhotonClustersForDTreeMinusElectrons"));
+ add(new ClusterListToHitMapDriver("ElectronMapClusters", "ElectronHitMap"));
+ add(new HitMapSubtractDriver("RecoDigiHitMap", "ElectronHitMap", "RecoDigiHitMapWithoutElectrons"));
+ add(new HitMapSubtractDriver("AllDigiHitMap", "ElectronHitMap", "AllDigiHitMapWithoutElectrons"));
+ }
+
+ // Attach calorimeter hits to tracks, useful for finding/attaching mips
+ add(new AttachCalorimeterHitsDriver("TracksWithoutElectrons","RecoDigiHitMapWithoutElectrons","TrackXtrapInfo",20.));
+ {
+ // Find muons
+ if(useNewInitialMipFinding)
+ {
+ MuonFinderWrapper3 muonFinder3 = new MuonFinderWrapper3("TrackXtrapInfo","TracksWithoutElectrons", "AllDigiHitMapWithoutElectrons", "MuonTrackClusterMap", "AllDigiHitMapWithoutElectronsOrMuons", "TracksWithoutElectronsOrMuons");
+ add(muonFinder3);
+ }
+ else
+ {
+ MuonFinderWrapper muonFinder = new MuonFinderWrapper(findCluster, "TracksWithoutElectrons", "AllDigiHitMapWithoutElectrons", "MuonTrackClusterMap", "AllDigiHitMapWithoutElectronsOrMuons", "TracksWithoutElectronsOrMuons");
+ //muonFinder.skip(); // TEST
+ add(muonFinder);
+ }
+ // Identify the muon hits within useable hit block
+ add(new HitMapSubtractDriver("RecoDigiHitMapWithoutElectrons", "AllDigiHitMapWithoutElectronsOrMuons", "RecoDigiHitMapMuons"));
+ // Non-muon hits within useable hit block
+ add(new HitMapSubtractDriver("RecoDigiHitMapWithoutElectrons", "RecoDigiHitMapMuons", "RecoDigiHitMapWithoutElectronsOrMuons"));
+ }
+
+ {
+ if(useNewInitialMipFinding)
+ {
+ System.out.println("Using new initial mip finder");
+ ShowerPointFinderDriver2 showerFinder2ForHad =
+ new ShowerPointFinderDriver2("RecoDigiHitMapWithoutElectronsOrMuons", "TracksWithoutElectronsOrMuons", "TrackXtrapInfo", "ShowerFinderMapTrackToMip", "RecoDigiHitMapWithoutElectronsOrMuonsOrMips", "ShowerFinderMips");
+ add(showerFinder2ForHad);
+ }
+ else
+ {
+ // TJ's pre-shower MIP-finder
+ ShowerPointFinderDriver showerFinder = new ShowerPointFinderDriver(findCluster, "RecoDigiHitMapWithoutElectronsOrMuons", "TracksWithoutElectronsOrMuons", "ShowerFinderMapTrackToMip", "RecoDigiHitMapWithoutElectronsOrMuonsOrMips", "ShowerFinderMips");
+ add(showerFinder);
+ }
+ add(new CheckDisjoint("RecoDigiHitMapWithoutElectronsOrMuonsOrMips", "ShowerFinderMips"));
+ // Steve's pre-shower MIP-finder
+ // disabled for now -- //add(new ReclusterDriver.SteveMipWrapper());
+
+ // Match tracks -> pre-shower MIPs (best possible linkage)
+ add(new TrackToPreShowerMipMapMaker("ShowerFinderMapTrackToMip", "TracksWithoutElectronsOrMuons", "MapPreShowerMipTracksToClusterSeeds", "UnmatchedTracksAfterPreShowerMipMap", "PreShowerMipMatchMipClusters", "PreShowerMipMatchSmallClusters", "PreShowerMipMatchBlockClusters"));
+ // At this point, we COULD take the unlinked MIP hits back out and recycle them
+ // into the DTree clustering. (The unlinked MIPs are the ones where two the MIP
+ // clusters of 2+ tracks overlapped, or where there were too few hits, or both.)
+ add(new ClusterListToHitMapDriver("PreShowerMipMatchSmallClusters", "PreShowerMipMatchSmallClusterHits"));
+ add(new ClusterListToHitMapDriver("PreShowerMipMatchBlockClusters", "PreShowerMipMatchBlockClusterHits"));
+ HitMapAddDriver remergeBadMips = new HitMapAddDriver();
+ remergeBadMips.addInputHitMap("PreShowerMipMatchSmallClusterHits");
+ remergeBadMips.addInputHitMap("PreShowerMipMatchBlockClusterHits");
+ remergeBadMips.addInputHitMap("RecoDigiHitMapWithoutElectronsOrMuonsOrMips");
+ remergeBadMips.setOutputHitMap("RecoDigiHitMapWithoutElectronsOrMuonsOrGoodMips");
+ add(remergeBadMips); // TEST
+ }
+
+ {
+ // Now go back and ensure that no photon uses hits from a charged particle's MIP.
+ // We can either remove those individual hits or veto entire clusters.
+ boolean remove = false;
+ boolean findVetoedPhotons = true;
+ if (remove) {
+ add(new RemoveHitsFromClusters("PreliminaryPhotonClustersForDTreeMinusElectrons", "MuonTrackClusterMap", "PhotonsMinusMuonHits"));
+ add(new RemoveHitsFromClusters("PhotonsMinusMuonHits", "ShowerFinderMapTrackToMip", "PhotonClustersForDTree"));
+ } else {
+ add(new VetoHitsFromClusters("PreliminaryPhotonClustersForDTreeMinusElectrons", "MuonTrackClusterMap", "PhotonsMinusMuonHits"));
+ add(new VetoHitsFromClusters("PhotonsMinusMuonHits", "ShowerFinderMapTrackToMip", "PhotonClustersForDTree"));
+ if (findVetoedPhotons) {
+ // Test: pick out vetoed clusters
+ add(new ListSubtractDriver("PreliminaryPhotonClustersForDTreeMinusElectrons", "PhotonClustersForDTree", "VetoedPhotonClusters"));
+ add(new CheckDisjoint("PhotonClustersForDTree", "VetoedPhotonClusters"));
+ add(new RemoveHitsFromClusters("VetoedPhotonClusters", "MuonTrackClusterMap", "VetoedPhotonClustersMinusMuonHits"));
+ add(new RemoveHitsFromClusters("VetoedPhotonClustersMinusMuonHits", "ShowerFinderMapTrackToMip", "VetoedPhotonClustersMinusMuonHitsAndMipHits"));
+ add(new ClusterListToHitMapDriver("VetoedPhotonClustersMinusMuonHitsAndMipHits", "PhotonVetoHitMap"));
+ }
+ }
+ add(new TransientFlagDriver("PhotonsMinusMuonHits"));
+ add(new TransientFlagDriver("PhotonClustersForDTree"));
+
+ // Identify which hits were used for photons, electrons
+ add(new ClusterListToHitMapDriver("PhotonClustersForDTree", "PhotonHitMap"));
+ add(new CheckDisjoint("ShowerFinderMips", "PhotonHitMap"));
+
+ // Identify remaining hits not used for photons or muons or mips
+ if (!remove && findVetoedPhotons) {
+ add(new HitMapSubtractDriver("RecoDigiHitMapWithoutElectronsOrMuonsOrGoodMips", "PhotonHitMap", "TmpRecoDigiHitMapWithoutElectronsOrMuonsOrMipsOrPhotons"));
+ add(new HitMapSubtractDriver("TmpRecoDigiHitMapWithoutElectronsOrMuonsOrMipsOrPhotons", "PhotonVetoHitMap", "RecoDigiHitMapWithoutElectronsOrMuonsOrMipsOrPhotons"));
+ } else {
+ add(new HitMapSubtractDriver("RecoDigiHitMapWithoutElectronsOrMuonsOrGoodMips", "PhotonHitMap", "RecoDigiHitMapWithoutElectronsOrMuonsOrMipsOrPhotons")); // Remove Muon/MIP hits
+ //add(new HitMapSubtractDriver("RecoDigiHitMap", "PhotonHitMap", "RecoDigiHitMapWithoutMuonsOrMipsOrPhotons")); // Keep all non-photon hits
+ }
+ add(new CheckDisjoint("RecoDigiHitMapWithoutElectronsOrMuonsOrMipsOrPhotons", "PhotonHitMap"));
+ }
+
+ // Run DTree on each subdetector separately:
+ Map<String,String> mapInputListToDTreeClusterList = new HashMap<String,String>();
+ for (String rawInputName : recoHitLists) {
+ String rawInputHitMapName = mapListToHitMap.get(rawInputName);
+ String filteredInputHitMapName = (new String(rawInputName)).replace("DigiHits", "DigiHitMapForDTree");
+ String outputHitMapName = new String(rawInputHitMapName+"AfterDTree");
+ String outputClusterListName = new String(rawInputHitMapName+"Clusters");
+ mapInputListToDTreeClusterList.put(rawInputName, outputClusterListName);
+ // Filter hitmap to only contain hits from this subdet that are not muon/mip/photon hits
+ add(new HitMapAndDriver(rawInputHitMapName, "RecoDigiHitMapWithoutElectronsOrMuonsOrMipsOrPhotons", filteredInputHitMapName));
+ if (hitsForMST.contains(rawInputName)) {
+ // Run MST
+ org.lcsim.recon.cluster.mst.MSTClusterDriver mstDriver = new org.lcsim.recon.cluster.mst.MSTClusterDriver(outputHitMapName, outputClusterListName);
+ mstDriver.addInputHitMap(filteredInputHitMapName);
+ mstDriver.setThreshold(1500.0); // FIXME: This is not optimal
+ mstDriver.registerMetrics(new org.lcsim.recon.cluster.mst.MinimumHitToHitDistance());
+ add(mstDriver);
+ } else {
+ if(outputClusterListName.contains("Muon"))
+ {
+ // Don't know how this ever worked for muons!
+ // Fake it with nn
+ FakeDTDriver treeDriver = new FakeDTDriver(5,5,2,0,0.);
+ treeDriver.setInputHitMap(filteredInputHitMapName);
+ treeDriver.setOutputClusterList(outputClusterListName);
+ add(treeDriver);
+ }
+ else
+ {
+ // Run DTree
+ DirectedTreeDriver treeDriver = new DirectedTreeDriver();
+ treeDriver.setInputHitMap(filteredInputHitMapName);
+ treeDriver.setOutputClusterList(outputClusterListName);
+ treeDriver.setOutputHitMap(outputHitMapName);
+ add(treeDriver);
+ }
+ }
+ add(new TransientFlagDriver(outputClusterListName));
+ }
+
+ // Merge/categorize & write out
+ ListAddDriver<Cluster> mergeDTreeClustersECAL = new ListAddDriver<Cluster>(Cluster.class);
+ ListAddDriver<Cluster> mergeDTreeClustersHCAL = new ListAddDriver<Cluster>(Cluster.class);
+ ListAddDriver<Cluster> mergeDTreeClustersMCAL = new ListAddDriver<Cluster>(Cluster.class);
+ ListAddDriver<Cluster> mergeDTreeClustersAll = new ListAddDriver<Cluster>(Cluster.class);
+ for (String inputName : recoHitLists) {
+ String clusterListName = mapInputListToDTreeClusterList.get(inputName);
+ mergeDTreeClustersAll.addInputList(clusterListName);
+ if( (inputName.compareTo(ci.getDigiCollectionName(CalorimeterType.EM_BARREL))==0)||
+ (inputName.compareTo(ci.getDigiCollectionName(CalorimeterType.EM_ENDCAP))==0)
+ ){
+ mergeDTreeClustersECAL.addInputList(clusterListName);
+ }
+ else if( (inputName.compareTo(ci.getDigiCollectionName(CalorimeterType.HAD_BARREL))==0)||
+ (inputName.compareTo(ci.getDigiCollectionName(CalorimeterType.HAD_ENDCAP))==0)
+ ){
+ mergeDTreeClustersHCAL.addInputList(clusterListName);
+ }
+ else if( (inputName.contains("Muon"))
+ ){
+ mergeDTreeClustersMCAL.addInputList(clusterListName);
+ }
+ }
+ mergeDTreeClustersECAL.setOutputList("DTreeClustersECAL");
+ mergeDTreeClustersHCAL.setOutputList("DTreeClustersHCAL");
+ mergeDTreeClustersMCAL.setOutputList("DTreeClustersMCAL");
+ mergeDTreeClustersAll .setOutputList("DTreeClustersAll");
+ add(mergeDTreeClustersECAL);
+ add(mergeDTreeClustersHCAL);
+ add(mergeDTreeClustersMCAL);
+ add(mergeDTreeClustersAll);
+ add(new TransientFlagDriver("DTreeClustersECAL"));
+ add(new TransientFlagDriver("DTreeClustersHCAL"));
+ add(new TransientFlagDriver("DTreeClustersMCAL"));
+ add(new TransientFlagDriver("DTreeClustersAll"));
+
+ // RZ. Merge DTrees crossing sub-detector boundaries
+ add(new MergeClustersCrossingSubDetectorBoundaries("DTreeClustersAll", "DTreeClusters"));
+ add(new TransientFlagDriver("DTreeClusters"));
+ add(new TransientFlagDriver("DTreeClustersOriginal"));
+
+ // OK, now go back and look for hits near boundaries (for use when making MIPs
+ // with a layer-based algorithm so it can cross from endcap to barrel).
+ {
+ HitNearBarrelEndcapBoundaryDecision dec = new HitNearBarrelEndcapBoundaryDecision(6.0, 15.0, 1);
+ add(dec);
+ add(new ListFilterDriver(dec,ci.getDigiCollectionName(CalorimeterType.EM_BARREL), "EcalBarrelDigiHitsNearBoundary", CalorimeterHit.class));
+ add(new ListFilterDriver(dec,ci.getDigiCollectionName(CalorimeterType.HAD_BARREL), "HcalBarrelDigiHitsNearBoundary", CalorimeterHit.class));
+ add(new ListFilterDriver(dec,ci.getDigiCollectionName(CalorimeterType.EM_ENDCAP), "EcalEndcapDigiHitsNearBoundary", CalorimeterHit.class));
+ add(new ListFilterDriver(dec,ci.getDigiCollectionName(CalorimeterType.HAD_ENDCAP), "HcalEndcapDigiHitsNearBoundary", CalorimeterHit.class));
+ add(new TransientFlagDriver("EcalBarrelDigiHitsNearBoundary"));
+ add(new TransientFlagDriver("HcalBarrelDigiHitsNearBoundary"));
+ add(new TransientFlagDriver("EcalEndcapDigiHitsNearBoundary"));
+ add(new TransientFlagDriver("HcalEndcapDigiHitsNearBoundary"));
+ }
+
+ // Look for substructure inside clusters:
+ {
+ int m_minHitsToBeTreatedAsClusterECAL = 15;
+ int m_minHitsToBeTreatedAsClusterHCAL = 20;
+ int m_minHitsToBeTreatedAsClusterMCAL = 5;
+ int m_minHitsToBeTreatedAsClusterFCAL = m_minHitsToBeTreatedAsClusterECAL;
+ double m_newMipFinderRadiusECAL = 20.0;
+ double m_newMipFinderRadiusHCAL = 50.0;
+ double m_newMipFinderRadiusMCAL = 100.0;
+ double m_newMipFinderRadiusFCAL = m_newMipFinderRadiusECAL;
+ boolean m_removePoorQualityMips = false;
+
+ FindSubClusters clusDriverECAL = new FindSubClusters("DTreeClustersECAL", m_newMipFinderRadiusECAL, m_minHitsToBeTreatedAsClusterECAL, m_removePoorQualityMips, "OldMipsInsideTreesECAL", "NewMipsInsideTreesECAL", "ClumpsInsideTreesECAL", "BlocksInsideTreesECAL", "LeftoverHitsInsideTreesECAL", "MapTreeToTargetsECAL", "MapSharedToTreeECAL");
+ FindSubClusters clusDriverHCAL = new FindSubClusters("DTreeClustersHCAL", m_newMipFinderRadiusHCAL, m_minHitsToBeTreatedAsClusterHCAL, m_removePoorQualityMips, "OldMipsInsideTreesHCAL", "NewMipsInsideTreesHCAL", "ClumpsInsideTreesHCAL", "BlocksInsideTreesHCAL", "LeftoverHitsInsideTreesHCAL", "MapTreeToTargetsHCAL", "MapSharedToTreeHCAL");
+ FindSubClusters clusDriverMCAL = new FindSubClusters("DTreeClustersMCAL", m_newMipFinderRadiusMCAL, m_minHitsToBeTreatedAsClusterMCAL, m_removePoorQualityMips, "OldMipsInsideTreesMCAL", "NewMipsInsideTreesMCAL", "ClumpsInsideTreesMCAL", "BlocksInsideTreesMCAL", "LeftoverHitsInsideTreesMCAL", "MapTreeToTargetsMCAL", "MapSharedToTreeMCAL");
+ //FindSubClusters clusDriverFCAL = new FindSubClusters("DTreeClustersFCAL", m_newMipFinderRadiusFCAL, m_minHitsToBeTreatedAsClusterFCAL, m_removePoorQualityMips, "OldMipsInsideTreesFCAL", "NewMipsInsideTreesFCAL", "ClumpsInsideTreesFCAL", "BlocksInsideTreesFCAL", "LeftoverHitsInsideTreesFCAL", "MapTreeToTargetsFCAL", "MapSharedToTreeFCAL");
+ clusDriverECAL.enableBarrelEndcapCrossing(ci.getDigiCollectionName(CalorimeterType.EM_BARREL), "EcalBarrelDigiHitsNearBoundary",ci.getDigiCollectionName(CalorimeterType.EM_ENDCAP), "EcalEndcapDigiHitsNearBoundary");
+ clusDriverHCAL.enableBarrelEndcapCrossing(ci.getDigiCollectionName(CalorimeterType.HAD_BARREL), "HcalBarrelDigiHitsNearBoundary",ci.getDigiCollectionName(CalorimeterType.HAD_ENDCAP), "HcalEndcapDigiHitsNearBoundary");
+ clusDriverECAL.setNNrange(1,1,1);
+ clusDriverHCAL.setNNrange(2,2,1);
+ clusDriverMCAL.setNNrange(2,2,1);
+ //clusDriverFCAL.setNNrange(1,1,1);
+ add(clusDriverECAL);
+ add(clusDriverHCAL);
+ add(clusDriverMCAL);
+ }
+
+ // Track-cluster matching in steps:
+ // Already done electrons, muons, and good pre-shower MIPs.
+ // Now take a go at the rest...
+
+ // Match tracks to MIP clusters in ECAL (ambiguities not allowed)
+ TrackToMipClusterMapMaker mipMapMaker = new TrackToMipClusterMapMaker(findCluster, "UnmatchedTracksAfterPreShowerMipMap", "MapMipClusterTracksToClusterSeeds", "UnmatchedTracksAfterMipClusterMap");
+ mipMapMaker.addInputList("OldMipsInsideTreesECAL", "MipMatchedOldMipsInsideTreesECAL", "UnmatchedOldMipsInsideTreesECALAfterMipMatch");
+ mipMapMaker.addInputList("NewMipsInsideTreesECAL", "MipMatchedNewMipsInsideTreesECAL", "UnmatchedNewMipsInsideTreesECALAfterMipMatch");
+ add(mipMapMaker);
+ // Match tracks to generic clusters in ECAL
+ TrackToGenericClusterMapMaker genMapMaker = new TrackToGenericClusterMapMaker(findCluster, "UnmatchedTracksAfterMipClusterMap", "MapGenClusterTracksToClusterSeeds", "UnmatchedTracksAfterGenClusterMap");
+ genMapMaker.addInputList("UnmatchedOldMipsInsideTreesECALAfterMipMatch", "GenMatchedOldMipsInsideTreesECAL", "UnmatchedOldMipsInsideTreesECALAfterGenMatch");
+ genMapMaker.addInputList("UnmatchedNewMipsInsideTreesECALAfterMipMatch", "GenMatchedNewMipsInsideTreesECAL", "UnmatchedNewMipsInsideTreesECALAfterGenMatch");
+ genMapMaker.addInputList("ClumpsInsideTreesECAL", "GenMatchedClumpsInsideTreesECAL", "UnmatchedClumpsInsideTreesECALAfterGenMatch");
+ genMapMaker.addInputList("BlocksInsideTreesECAL", "GenMatchedBlocksInsideTreesECAL", "UnmatchedBlocksInsideTreesECALAfterGenMatch");
+ genMapMaker.addInputList("LeftoverHitsInsideTreesECAL", "GenMatchedLeftoverHitsInsideTreesECAL", "UnmatchedLeftoverHitsInsideTreesECALAfterGenMatch");
+ genMapMaker.addInputList("PhotonClustersForDTree", "GenMatchedPhotonClustersForDTree", "UnmatchedPhotonClustersForDTreeAfterGenMatch");
+ add(genMapMaker);
+ // [here: can split photon seeds, large seeds, etc...]
+ // Remaining tracks have either NO match or an ambiguous one (i.e. >1 track to same cluster
+ AmbiguousTrackToClusterMapMaker ambiguousMapMaker = new AmbiguousTrackToClusterMapMaker(findCluster, "UnmatchedTracksAfterGenClusterMap", "MapAmbigClusterTracksToClusterSeeds", "UnmatchedTracksAfterAmbigClusterMap");
+ ambiguousMapMaker.addInputList("UnmatchedOldMipsInsideTreesECALAfterGenMatch", "AmbigMatchedOldMipsInsideTreesECAL", "UnmatchedOldMipsInsideTreesECALAfterAmbigMatch");
+ ambiguousMapMaker.addInputList("UnmatchedNewMipsInsideTreesECALAfterGenMatch", "AmbigMatchedNewMipsInsideTreesECAL", "UnmatchedNewMipsInsideTreesECALAfterAmbigMatch");
+ ambiguousMapMaker.addInputList("UnmatchedClumpsInsideTreesECALAfterGenMatch", "AmbigMatchedClumpsInsideTreesECAL", "UnmatchedClumpsInsideTreesECALAfterAmbigMatch");
+ ambiguousMapMaker.addInputList("UnmatchedBlocksInsideTreesECALAfterGenMatch", "AmbigMatchedBlocksInsideTreesECAL", "UnmatchedBlocksInsideTreesECALAfterAmbigMatch");
+ ambiguousMapMaker.addInputList("UnmatchedLeftoverHitsInsideTreesECALAfterGenMatch", "AmbigMatchedLeftoverHitsInsideTreesECAL", "UnmatchedLeftoverHitsInsideTreesECALAfterAmbigMatch");
+ ambiguousMapMaker.addInputList("UnmatchedPhotonClustersForDTreeAfterGenMatch", "AmbigMatchedPhotonClustersForDTree", "UnmatchedPhotonClustersForDTreeAfterAmbigMatch");
+ add(ambiguousMapMaker);
+ // [here: can try to split large seeds with >1 track]
+ }
+ long start = System.currentTimeMillis();
+ super.process(event);
+ long end = System.currentTimeMillis();
+ double cput = (double)(end-start)/1000.;
+ System.out.println("Processing SetUpDTreeForReclustering took "+cput+" secs");
+ }
+}