lcsim/src/org/lcsim/recon/pfa/structural
diff -u -r1.11 -r1.12
--- ReclusterDTreeDriver.java 21 Aug 2008 18:36:54 -0000 1.11
+++ ReclusterDTreeDriver.java 31 Aug 2008 18:49:50 -0000 1.12
@@ -35,7 +35,7 @@
* in this package, which uses the implementation in
* org.lcsim.recon.cluster.directedtree developed by NIU).
*
- * @version $Id: ReclusterDTreeDriver.java,v 1.11 2008/08/21 18:36:54 mcharles Exp $
+ * @version $Id: ReclusterDTreeDriver.java,v 1.12 2008/08/31 18:49:50 mcharles Exp $
* @author Mat Charles <[log in to unmask]>
*/
@@ -102,7 +102,7 @@
}
public ReclusterDTreeDriver(String dTreeClusterList, String trackList, String mcList) {
- System.out.println("ReclusterDTreeDriver version 0.41");
+ System.out.println("ReclusterDTreeDriver version 0.42");
initTrackMatch();
initCalibration();
initPlots();
@@ -204,10 +204,10 @@
List<CalorimeterHit> allHitsMcalEndcap = null;
List<CalorimeterHit> allHitsFcalEndcap = null;
if (m_useMucalBarrel) {
- allHitsMcalBarrel = m_event.get(CalorimeterHit.class, "MuonBarrHits");
+ allHitsMcalBarrel = m_event.get(CalorimeterHit.class, "MuonBarrDigiHits");
}
if (m_useMucalEndcap) {
- allHitsMcalEndcap = m_event.get(CalorimeterHit.class, "MuonEndcapHits");
+ allHitsMcalEndcap = m_event.get(CalorimeterHit.class, "MuonEndcapDigiHits");
}
if (m_useFcal) {
allHitsFcalEndcap = m_event.get(CalorimeterHit.class, "ForwardEcalEndcapDigiHits");
@@ -995,7 +995,7 @@
Map<Track, BasicCluster> mapTrackToMIP = (Map<Track, BasicCluster>) (m_event.get(mapName));
MIPGeometryHandler geomHandler = new LayerBasedMIPGeometryHandler(mapTrackToMIP, findCluster);
//MIPGeometryHandler geomHandler = new HelixTangentMIPGeometryHandler(mapTrackToMIP, findCluster);
- algorithm = new ConeMIPReassignmentAlgorithm(geomHandler, 800.0, 3.14);
+ algorithm = new ConeMIPReassignmentAlgorithm(geomHandler, 800.0, Math.PI*0.5);
}
if (m_fixSingleTracksWithCone) {
// First, try to fix the simplest case: single tracks with E/p < 1
@@ -1069,16 +1069,12 @@
Map<Track, Cluster> tweakedTracksMatchedToClusters)
{
Set<Cluster> showerComponents = newMapTrackToShowerComponents.get(tr);
- Set<Track> tmpJet = new HashSet<Track>();
- tmpJet.add(tr);
- if ( checkIfReassignmentNeeded(tmpJet, showerComponents, allSharedClusters, toleranceOfTrack) ) {
- List<Cluster> reassignedClusters = reassignClustersToTrack(tr, showerComponents, unassignedClusters, allSharedClusters, toleranceOfTrack, algorithm, newMapShowerComponentToTrack, tweakedTracksMatchedToClusters, newMapTrackToShowerComponents);
- if (reassignedClusters != null && reassignedClusters.size()>0) {
- for (Cluster clus : reassignedClusters) {
- showerComponents.add(clus);
- unassignedClusters.remove(clus);
- newMapShowerComponentToTrack.put(clus, tr);
- }
+ List<Cluster> reassignedClusters = reassignClustersToTrack(tr, showerComponents, unassignedClusters, allSharedClusters, toleranceOfTrack, algorithm, newMapShowerComponentToTrack, tweakedTracksMatchedToClusters, newMapTrackToShowerComponents);
+ if (reassignedClusters != null && reassignedClusters.size()>0) {
+ for (Cluster clus : reassignedClusters) {
+ showerComponents.add(clus);
+ unassignedClusters.remove(clus);
+ newMapShowerComponentToTrack.put(clus, tr);
}
}
}
@@ -1094,14 +1090,12 @@
Map<Track, Set<Cluster>> newMapTrackToShowerComponents)
{
Set<Cluster> showerComponents = newMapJetToShowerComponents.get(jet);
- if ( checkIfReassignmentNeeded(jet, showerComponents, allSharedClusters, m_jetTolerance) ) {
- List<Cluster> reassignedClusters = reassignClustersToJet(jet, showerComponents, unassignedClusters, allSharedClusters, m_jetTolerance, algorithm, newMapShowerComponentToTrack, tweakedTracksMatchedToClusters,newMapTrackToShowerComponents);
- if (reassignedClusters != null && reassignedClusters.size()>0) {
- for (Cluster clus : reassignedClusters) {
- showerComponents.add(clus);
- unassignedClusters.remove(clus);
- newMapShowerComponentToJet.put(clus, jet);
- }
+ List<Cluster> reassignedClusters = reassignClustersToJet(jet, showerComponents, unassignedClusters, allSharedClusters, m_jetTolerance, algorithm, newMapShowerComponentToTrack, tweakedTracksMatchedToClusters,newMapTrackToShowerComponents);
+ if (reassignedClusters != null && reassignedClusters.size()>0) {
+ for (Cluster clus : reassignedClusters) {
+ showerComponents.add(clus);
+ unassignedClusters.remove(clus);
+ newMapShowerComponentToJet.put(clus, jet);
}
}
}
lcsim/src/org/lcsim/recon/pfa/structural
diff -u -r1.9 -r1.10
--- ReclusterDriver.java 19 Aug 2008 06:30:43 -0000 1.9
+++ ReclusterDriver.java 31 Aug 2008 18:49:50 -0000 1.10
@@ -40,7 +40,7 @@
* This version is superseded by ReclusterDTreeDriver,
* which derives from it.
*
- * @version $Id: ReclusterDriver.java,v 1.9 2008/08/19 06:30:43 mcharles Exp $
+ * @version $Id: ReclusterDriver.java,v 1.10 2008/08/31 18:49:50 mcharles Exp $
* @author Mat Charles <[log in to unmask]>
*/
@@ -1046,7 +1046,7 @@
findCluster.process(m_event); // picks up geometry
MIPGeometryHandler geomHandler = new LayerBasedMIPGeometryHandler(mapTrackToMIP, findCluster);
//MIPGeometryHandler geomHandler = new HelixTangentMIPGeometryHandler(mapTrackToMIP, findCluster);
- mipAlg = new ConeMIPReassignmentAlgorithm(geomHandler, 800.0, 3.14);
+ mipAlg = new ConeMIPReassignmentAlgorithm(geomHandler, 800.0, Math.PI*0.5);
}
// Loop over possible links and calculate scores
@@ -1439,8 +1439,8 @@
System.out.println("Here is a summary of all the energy deposits for each track:");
for (Track tr : tracksSortedByMomentum) {
double trackMomentum = (new BasicHep3Vector(tr.getMomentum())).magnitude();
- HitMap hitsEcal = ((HitMap)(m_event.get("inputHitMapEcal")));
- HitMap hitsHcal = ((HitMap)(m_event.get("inputHitMapHcal")));
+ HitMap hitsEcal = ((HitMap)(m_event.get("EcalDigiHitMap")));
+ HitMap hitsHcal = ((HitMap)(m_event.get("HcalDigiHitMap")));
List<CalorimeterHit> allTruthHitsInEcal = findHitsFromTruth_T(tr, hitsEcal.values());
List<CalorimeterHit> allTruthHitsInHcal = findHitsFromTruth_T(tr, hitsHcal.values());
int countCoreHitsEcal = 0;
@@ -3049,12 +3049,20 @@
// DEBUG: Check the status of all hits in the event.
HitMap hitMapEcal = ((HitMap)(m_event.get("EcalDigiHitMap")));
HitMap hitMapHcal = ((HitMap)(m_event.get("HcalDigiHitMap")));
+ HitMap hitMapMcal = ((HitMap)(m_event.get("HcalDigiHitMap")));
+ HitMap hitMapMcalBarrel = ((HitMap)(m_event.get("MuonBarrDigiHitMap")));
+ HitMap hitMapMcalEndcap = ((HitMap)(m_event.get("MuonEndcapDigiHitMap")));
Set<CalorimeterHit> hitsEcal = new HashSet<CalorimeterHit>(hitMapEcal.values());
Set<CalorimeterHit> hitsHcal = new HashSet<CalorimeterHit>(hitMapHcal.values());
+ Set<CalorimeterHit> hitsMcal = new HashSet<CalorimeterHit>();
+ hitsMcal.addAll(hitMapMcalBarrel.values());
+ hitsMcal.addAll(hitMapMcalEndcap.values());
Set<CalorimeterHit> hitsEcalSharedWithTargets = new HashSet<CalorimeterHit>();
Set<CalorimeterHit> hitsHcalSharedWithTargets = new HashSet<CalorimeterHit>();
+ Set<CalorimeterHit> hitsMcalSharedWithTargets = new HashSet<CalorimeterHit>();
Set<CalorimeterHit> hitsEcalSharedWithoutTargets = new HashSet<CalorimeterHit>();
Set<CalorimeterHit> hitsHcalSharedWithoutTargets = new HashSet<CalorimeterHit>();
+ Set<CalorimeterHit> hitsMcalSharedWithoutTargets = new HashSet<CalorimeterHit>();
for (SharedClusterGroup shares : allSharedClusters) {
List<SharedCluster> sharedClusters = shares.listAllSharedClusters();
@@ -3063,20 +3071,19 @@
for (CalorimeterHit hit : sharedCluster.getCluster().getCalorimeterHits()) {
boolean hitInEcal = hitsEcal.contains(hit);
boolean hitInHcal = hitsHcal.contains(hit);
+ boolean hitInMcal = hitsMcal.contains(hit);
if (hitInEcal && hitInHcal) { throw new AssertionError("Book-keeping error"); }
- if (!hitInEcal && !hitInHcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInEcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInHcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (!hitInEcal && !hitInHcal && !hitInMcal) { throw new AssertionError("Book-keeping error"); }
if (targets.size()==0) {
- if (hitInEcal) {
- hitsEcalSharedWithoutTargets.add(hit);
- } else {
- hitsHcalSharedWithoutTargets.add(hit);
- }
+ if (hitInEcal) { hitsEcalSharedWithoutTargets.add(hit); }
+ if (hitInHcal) { hitsHcalSharedWithoutTargets.add(hit); }
+ if (hitInMcal) { hitsMcalSharedWithoutTargets.add(hit); }
} else {
- if (hitInEcal) {
- hitsEcalSharedWithTargets.add(hit);
- } else {
- hitsHcalSharedWithTargets.add(hit);
- }
+ if (hitInEcal) { hitsEcalSharedWithTargets.add(hit); }
+ if (hitInHcal) { hitsHcalSharedWithTargets.add(hit); }
+ if (hitInMcal) { hitsMcalSharedWithTargets.add(hit); }
}
}
}
@@ -3084,60 +3091,67 @@
Set<CalorimeterHit> hitsEcalInChargedCore = new HashSet<CalorimeterHit>();
Set<CalorimeterHit> hitsHcalInChargedCore = new HashSet<CalorimeterHit>();
+ Set<CalorimeterHit> hitsMcalInChargedCore = new HashSet<CalorimeterHit>();
for (Track tr : tracksSortedByMomentum) {
Set<Cluster> showerComponents = newMapTrackToShowerComponents.get(tr);
for (Cluster clus : showerComponents) {
for (CalorimeterHit hit : clus.getCalorimeterHits()) {
boolean hitInEcal = hitsEcal.contains(hit);
boolean hitInHcal = hitsHcal.contains(hit);
+ boolean hitInMcal = hitsMcal.contains(hit);
if (hitInEcal && hitInHcal) { throw new AssertionError("Book-keeping error"); }
- if (!hitInEcal && !hitInHcal) { throw new AssertionError("Book-keeping error"); }
- if (hitInEcal) {
- hitsEcalInChargedCore.add(hit);
- } else {
- hitsHcalInChargedCore.add(hit);
- }
+ if (hitInEcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInHcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (!hitInEcal && !hitInHcal && !hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInEcal) { hitsEcalInChargedCore.add(hit); }
+ if (hitInHcal) { hitsHcalInChargedCore.add(hit); }
+ if (hitInMcal) { hitsMcalInChargedCore.add(hit); }
}
}
}
Set<CalorimeterHit> hitsEcalInPhotonCore = new HashSet<CalorimeterHit>();
Set<CalorimeterHit> hitsHcalInPhotonCore = new HashSet<CalorimeterHit>();
+ Set<CalorimeterHit> hitsMcalInPhotonCore = new HashSet<CalorimeterHit>();
for (Cluster clus : photons) {
Track tr = newMapShowerComponentToTrack.get(clus);
if (tr == null) {
for (CalorimeterHit hit : clus.getCalorimeterHits()) {
boolean hitInEcal = hitsEcal.contains(hit);
boolean hitInHcal = hitsHcal.contains(hit);
+ boolean hitInMcal = hitsMcal.contains(hit);
if (hitInEcal && hitInHcal) { throw new AssertionError("Book-keeping error"); }
- if (!hitInEcal && !hitInHcal) { throw new AssertionError("Book-keeping error"); }
- if (hitInEcal) {
- hitsEcalInPhotonCore.add(hit);
- } else {
- hitsHcalInPhotonCore.add(hit);
- }
+ if (hitInEcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInHcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (!hitInEcal && !hitInHcal && !hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInEcal) { hitsEcalInPhotonCore.add(hit); }
+ if (hitInHcal) { hitsHcalInPhotonCore.add(hit); }
+ if (hitInMcal) { hitsMcalInPhotonCore.add(hit); }
}
}
}
Set<CalorimeterHit> hitsEcalInNeutralCore = new HashSet<CalorimeterHit>();
Set<CalorimeterHit> hitsHcalInNeutralCore = new HashSet<CalorimeterHit>();
+ Set<CalorimeterHit> hitsMcalInNeutralCore = new HashSet<CalorimeterHit>();
for (Cluster clus : neutralClusterCores) {
for (CalorimeterHit hit : clus.getCalorimeterHits()) {
boolean hitInEcal = hitsEcal.contains(hit);
boolean hitInHcal = hitsHcal.contains(hit);
+ boolean hitInMcal = hitsMcal.contains(hit);
if (hitInEcal && hitInHcal) { throw new AssertionError("Book-keeping error"); }
- if (!hitInEcal && !hitInHcal) { throw new AssertionError("Book-keeping error"); }
- if (hitInEcal) {
- hitsEcalInNeutralCore.add(hit);
- } else {
- hitsHcalInNeutralCore.add(hit);
- }
+ if (hitInEcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInHcal && hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (!hitInEcal && !hitInHcal && !hitInMcal) { throw new AssertionError("Book-keeping error"); }
+ if (hitInEcal) { hitsEcalInNeutralCore.add(hit); }
+ if (hitInHcal) { hitsHcalInNeutralCore.add(hit); }
+ if (hitInMcal) { hitsMcalInNeutralCore.add(hit); }
}
}
int countIdentifiedHitsEcal = hitsEcalSharedWithTargets.size() + hitsEcalSharedWithoutTargets.size() + hitsEcalInChargedCore.size() + hitsEcalInPhotonCore.size() + hitsEcalInNeutralCore.size();
int countIdentifiedHitsHcal = hitsHcalSharedWithTargets.size() + hitsHcalSharedWithoutTargets.size() + hitsHcalInChargedCore.size() + hitsHcalInPhotonCore.size() + hitsHcalInNeutralCore.size();
+ int countIdentifiedHitsMcal = hitsMcalSharedWithTargets.size() + hitsMcalSharedWithoutTargets.size() + hitsMcalInChargedCore.size() + hitsMcalInPhotonCore.size() + hitsMcalInNeutralCore.size();
System.out.println("Of the "+hitsEcal.size()+" ECAL hits, I identified "+countIdentifiedHitsEcal+":");
System.out.println(" "+hitsEcalSharedWithTargets.size()+" are shared and have a target");
@@ -3151,11 +3165,19 @@
System.out.println(" "+hitsHcalInChargedCore.size()+" are in the core of a charged shower");
System.out.println(" "+hitsHcalInPhotonCore.size()+" are in the core of a photon shower");
System.out.println(" "+hitsHcalInNeutralCore.size()+" are in the core of a neutral hadron shower");
+ System.out.println("Of the "+hitsMcal.size()+" MCAL hits, I identified "+countIdentifiedHitsMcal+":");
+ System.out.println(" "+hitsMcalSharedWithTargets.size()+" are shared and have a target");
+ System.out.println(" "+hitsMcalSharedWithoutTargets.size()+" are shared and have no target");
+ System.out.println(" "+hitsMcalInChargedCore.size()+" are in the core of a charged shower");
+ System.out.println(" "+hitsMcalInPhotonCore.size()+" are in the core of a photon shower");
+ System.out.println(" "+hitsMcalInNeutralCore.size()+" are in the core of a neutral hadron shower");
+
for (Track tr : tracksSortedByMomentum) {
List<CalorimeterHit> trackTruthHitsInEcal = findHitsFromTruth_T(tr, hitsEcal);
List<CalorimeterHit> trackTruthHitsInHcal = findHitsFromTruth_T(tr, hitsHcal);
- System.out.println("For track with p="+(new BasicHep3Vector(tr.getMomentum())).magnitude()+" with "+trackTruthHitsInEcal.size()+" ECAL + "+trackTruthHitsInHcal.size()+" HCAL hits:");
+ List<CalorimeterHit> trackTruthHitsInMcal = findHitsFromTruth_T(tr, hitsMcal);
+ System.out.println("For track with p="+(new BasicHep3Vector(tr.getMomentum())).magnitude()+" with "+trackTruthHitsInEcal.size()+" ECAL + "+trackTruthHitsInHcal.size()+" HCAL + "+trackTruthHitsInMcal.size()+" MCAL hits:");
int count;
String printme = new String(" ECAL hits: ");
count = 0; for (CalorimeterHit hit : trackTruthHitsInEcal) { if (hitsEcalSharedWithTargets.contains(hit)) { count++; } } ; printme += " sharedWithTarget="+count;
@@ -3171,6 +3193,13 @@
count = 0; for (CalorimeterHit hit : trackTruthHitsInHcal) { if (hitsHcalInPhotonCore.contains(hit)) { count++; } } ; printme += " photonCore="+count;
count = 0; for (CalorimeterHit hit : trackTruthHitsInHcal) { if (hitsHcalInNeutralCore.contains(hit)) { count++; } } ; printme += " neutralCore="+count;
System.out.println(printme);
+ printme = new String(" MCAL hits: ");
+ count = 0; for (CalorimeterHit hit : trackTruthHitsInMcal) { if (hitsMcalSharedWithTargets.contains(hit)) { count++; } } ; printme += " sharedWithTarget="+count;
+ count = 0; for (CalorimeterHit hit : trackTruthHitsInMcal) { if (hitsMcalSharedWithoutTargets.contains(hit)) { count++; } } ; printme += " sharedWithoutTarget="+count;
+ count = 0; for (CalorimeterHit hit : trackTruthHitsInMcal) { if (hitsMcalInChargedCore.contains(hit)) { count++; } } ; printme += " chargedCore="+count;
+ count = 0; for (CalorimeterHit hit : trackTruthHitsInMcal) { if (hitsMcalInPhotonCore.contains(hit)) { count++; } } ; printme += " photonCore="+count;
+ count = 0; for (CalorimeterHit hit : trackTruthHitsInMcal) { if (hitsMcalInNeutralCore.contains(hit)) { count++; } } ; printme += " neutralCore="+count;
+ System.out.println(printme);
}
}