Print

Print


Commit in lcsim/src/org/lcsim/contrib/uiowa/structural on MAIN
LikelihoodFindingStructuralDriver.java+42-501.2 -> 1.3
Made event I/O work

lcsim/src/org/lcsim/contrib/uiowa/structural
LikelihoodFindingStructuralDriver.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- LikelihoodFindingStructuralDriver.java	1 Oct 2005 01:35:41 -0000	1.2
+++ LikelihoodFindingStructuralDriver.java	14 Oct 2005 17:52:24 -0000	1.3
@@ -12,73 +12,65 @@
 
     ClusterAssociator m_clusterAssociator = null;
     LikelihoodEvaluator m_eval = null;
+    String m_listOfBigClustersName = null;
+    String m_listOfMIPsName = null;
+    String m_listOfClumpsName = null;
 
-    public LikelihoodFindingStructuralDriver(LikelihoodEvaluator eval, ClusterAssociator assoc) {
+    public LikelihoodFindingStructuralDriver(LikelihoodEvaluator eval, ClusterAssociator assoc, String listOfBigClustersName, String listOfTrackSegmentsName, String listOfClumpsName) {
 	m_eval = eval; // This should be set up beforehand
 	m_clusterAssociator = assoc;
-
-        // m_eval.addLikelihoodQuantityTrackToTrack(new TrackToTrackDOCA(), 10, 0.0, 5.0, false, true);
-//         m_eval.addLikelihoodQuantityTrackToTrack(new TrackToTrackPOCAInCalorimeter(), 2, -0.5, 1.5, false, 
-// false);
-//         m_eval.addLikelihoodQuantityTrackToTrack(new TrackToTrackSmallestDistanceToPOCA(), 5, 0.0, 5.0, fal
-// se, true);
-//         m_eval.addLikelihoodQuantityTrackToTrack(new TrackToTrackIntermediateHitsCount(), 10, -0.5, 9.5, fa
-// lse, true);
-//         m_eval.addLikelihoodQuantityTrackToTrack(new TrackToTrackIntermediateHitsFraction(), 11, -0.05, 1.0
-// 5, false, false);
-//         m_eval.addLikelihoodQuantityTrackToClump(new TrackToClumpDOCA(), 5, 0.0, 25.0, false, true);
-//         m_eval.addLikelihoodQuantityTrackToClump(new TrackToClumpMinDistance(), 5, 0.0, 25.0, false, true);
-//         m_eval.addLikelihoodQuantityClumpToClump(new ClumpToClumpDOCA(), 5, 0.0, 50.0, false, true);
-//         m_eval.addLikelihoodQuantityClumpToClump(new ClumpToClumpMinDistance(), 5, 0.0, 50.0, false, true);
+	m_listOfBigClustersName = listOfBigClustersName;
+	m_listOfMIPsName = listOfTrackSegmentsName;
+	m_listOfClumpsName = listOfClumpsName;
     }
 
     public List<Cluster> getListOfBigClusters() {
         // Grab from event store
-	List<Cluster> vBigClusters = m_event.get(Cluster.class, "MSTCluster Merged");
+	List<Cluster> vBigClusters = m_event.get(Cluster.class, m_listOfBigClustersName);
         return vBigClusters;
     }
 
-    public boolean ignoreCluster(Cluster clus) {
-        // Ignore if < 10 hits
-        if (clus.getCalorimeterHits().size() <= 10) {
-            return true; // ignore because too small
-        }
-
-	throw new AssertionError("Not implemented yet!");
-
-        // Ignore if dominant particle is not a charged hadron
-        // with > 500 MeV of energy. This is a bit arbitrary,
-	// but helps ensure we don't train the algorithm on
-	// 10 MeV photons, electrons, etc.
-
-	// Not implemented yet!
-
-        //MCParticle alphaParticle = findAlphaParticle(clus);
-        //if (!isCharged(alphaParticle)) {
-	//return true; // ignore because neutral
-	//}
-        //if (isLepton(alphaParticle)) {
-	//return true; // ignore because not hadron
-	//}
-	//// Check momentum...
-        //double[] mom = alphaParticle.getMomentum();
-        //double momMagnitude = Math.sqrt(mom[0]*mom[0] + mom[1]*mom[1] + mom[2]*mom[2]);
-        //if (momMagnitude<0.5) {
-	//return true;
-	//} else {
-	//return false; // don't ignore
-	//}
-    }
+//     public boolean ignoreCluster(Cluster clus) {
+//         // Ignore if < 10 hits
+//         if (clus.getCalorimeterHits().size() <= 10) {
+//             return true; // ignore because too small
+//         }
+//
+// 	throw new AssertionError("Not implemented yet!");
+//
+//         // Ignore if dominant particle is not a charged hadron
+//         // with > 500 MeV of energy. This is a bit arbitrary,
+// 	// but helps ensure we don't train the algorithm on
+// 	// 10 MeV photons, electrons, etc.
+//
+// 	// Not implemented yet!
+//
+//         //MCParticle alphaParticle = findAlphaParticle(clus);
+//         //if (!isCharged(alphaParticle)) {
+// 	//return true; // ignore because neutral
+// 	//}
+//         //if (isLepton(alphaParticle)) {
+// 	//return true; // ignore because not hadron
+// 	//}
+// 	//// Check momentum...
+//         //double[] mom = alphaParticle.getMomentum();
+//         //double momMagnitude = Math.sqrt(mom[0]*mom[0] + mom[1]*mom[1] + mom[2]*mom[2]);
+//         //if (momMagnitude<0.5) {
+// 	//return true;
+// 	//} else {
+// 	//return false; // don't ignore
+// 	//}
+//     }
     
     public List<Cluster> findTrackSegments(Cluster clus) {
-	List<MapClusterToListOfClusters> dummyList = m_event.get(MapClusterToListOfClusters.class, "[string goes here]");
+	List<MapClusterToListOfClusters> dummyList = m_event.get(MapClusterToListOfClusters.class, m_listOfMIPsName );
 	Map<Cluster, List<Cluster>>mapClustersToMIPs = dummyList.iterator().next();
         List<Cluster> vMIPs = mapClustersToMIPs.get(clus);
         return vMIPs;
     }
 
     public List<Cluster> findClumps(Cluster clus) {
-	List<MapClusterToListOfClusters> dummyList = m_event.get(MapClusterToListOfClusters.class, "[string goes here]");
+	List<MapClusterToListOfClusters> dummyList = m_event.get(MapClusterToListOfClusters.class, m_listOfClumpsName);
 	Map<Cluster, List<Cluster>>mapClustersToClumps = dummyList.iterator().next();
         List<Cluster> vClumps = mapClustersToClumps.get(clus);
         return vClumps;
@@ -113,7 +105,7 @@
 
     protected boolean determineIfLinkIsCorrect(Cluster clus1, Cluster clus2)
     {
-        return m_clusterAssociator.isLinkCorrect(clus1, clus2);
+        return m_clusterAssociator.isLinkCorrect(clus1, clus2, m_event);
     }
 
 //     // Find the dominant particles:
CVSspam 0.2.8