lcsim/src/org/lcsim/contrib/uiowa/structural
diff -u -r1.3 -r1.4
--- EventEnergySum.java 6 Jan 2006 23:00:58 -0000 1.3
+++ EventEnergySum.java 12 Jan 2006 22:22:47 -0000 1.4
@@ -15,6 +15,7 @@
import hep.aida.IHistogramFactory;
import hep.aida.IHistogram1D;
import hep.aida.ICloud1D;
+import hep.aida.ICloud2D;
import hep.aida.ITuple;
import hep.aida.ITupleFactory;
@@ -74,6 +75,7 @@
m_hHCAL_charged_notrack_fractionbad = m_histoFactory.createCloud1D("hHCAL_charged_notrack_fractionbad");
m_hHCAL_neutral_fractionbad = m_histoFactory.createCloud1D("hHCAL_neutral_fractionbad");
+ m_hHCAL_charged_track_fractionbad_2D= m_histoFactory.createCloud2D("hHCAL_charged_track_fractionbad 2D");
ITupleFactory tf = af.createTupleFactory(m_tree);
m_hFractionChargedHitsBad = m_histoFactory.createCloud1D("hFractionChargedHitsBad");
@@ -119,6 +121,8 @@
ICloud1D m_hHCAL_charged_notrack_fractionbad ;
ICloud1D m_hHCAL_neutral_fractionbad ;
+ ICloud2D m_hHCAL_charged_track_fractionbad_2D;
+
public void suspend() {
try {
m_tree.commit();
@@ -266,9 +270,7 @@
}
infoDump += "). Crude energy="+sumCrudeEnergyOfThisCluster+"; track energy="+sumEnergyOfThisCluster;
eventDebugInfo += infoDump + "\n";
- /*
- System.out.println(infoDump);
- */
+ if (m_debug) { System.out.println(infoDump); }
String truthDump = new String("DEBUG: "+this.getClass().getName()+": Here are all contributing particles: ");
List<MCParticle> contributingParticles = assoc.associateClusterToMCParticles(currentCluster);
int hitCountChargedButNoTrack = 0;
@@ -324,9 +326,7 @@
}
truthDump += " *** Hits: "+hitCountNeutral+" neutral, "+hitCountChargedButNoTrack+" charged(bad), "+hitCountChargedWithTrack+" charged(safe)";
eventDebugInfo += truthDump + "\n";
- /*
- System.out.println(truthDump);
- */
+ if (m_debug) { System.out.println(truthDump); }
}
} else {
// No track
@@ -336,9 +336,7 @@
energySumOldECAL += energyOldECAL;
energySumOldHCAL += energyOldHCAL;
energySumRon += this.getClusterEnergy(currentCluster);
- /*
- System.out.println("DEBUG: "+this.getClass().getName()+": Neutral cluster with "+currentCluster.getCalorimeterHits().size()+" hits contributes "+this.getClusterEnergy(currentCluster)+" (ron) or "+energyOldECAL+" (old ECAL) + "+energyOldHCAL+" (old HCAL)");
- */
+ if (m_debug) { System.out.println("DEBUG: "+this.getClass().getName()+": Neutral cluster with "+currentCluster.getCalorimeterHits().size()+" hits contributes "+this.getClusterEnergy(currentCluster)+" (ron) or "+energyOldECAL+" (old ECAL) + "+energyOldHCAL+" (old HCAL)"); }
eventDebugInfo += "DEBUG: "+this.getClass().getName()+": Neutral cluster with "+currentCluster.getCalorimeterHits().size()+" hits contributes "+this.getClusterEnergy(currentCluster)+" (ron) or "+energyOldECAL+" (old ECAL) + "+energyOldHCAL+" (old HCAL)\n";
String truthDump = new String("DEBUG: "+this.getClass().getName()+": Here are all contributing particles: ");
List<MCParticle> contributingParticles = assoc.associateClusterToMCParticles(currentCluster);
@@ -400,9 +398,7 @@
}
truthDump += " *** Hits: "+hitCountNeutral+" neutral, "+hitCountChargedButNoTrack+" charged(safe), "+hitCountChargedWithTrack+" charged(bad)";
eventDebugInfo += truthDump + "\n";
- /*
- System.out.println(truthDump);
- */
+ if (m_debug) { System.out.println(truthDump); }
}
}
@@ -424,32 +420,32 @@
double fracNeutralHitsBad = ( (double)(totalNeutralHitsBad) / (double)(totalNeutralHitsSafe+totalNeutralHitsBad));
eventDebugInfo += "In this event, charged hits: "+totalChargedHitsSafe+" safe and "+totalChargedHitsBad+" bad.\n";
eventDebugInfo += "In this event, neutral hits: "+totalNeutralHitsSafe+" safe and "+totalNeutralHitsBad+" bad.\n";
- /*
- System.out.println("In this event, charged hits: "+totalChargedHitsSafe+" safe and "+totalChargedHitsBad+" bad.");
- System.out.println("In this event, neutral hits: "+totalNeutralHitsSafe+" safe and "+totalNeutralHitsBad+" bad.");
- */
+ if (m_debug) {
+ System.out.println("In this event, charged hits: "+totalChargedHitsSafe+" safe and "+totalChargedHitsBad+" bad.");
+ System.out.println("In this event, neutral hits: "+totalNeutralHitsSafe+" safe and "+totalNeutralHitsBad+" bad.");
+ }
m_hFractionChargedHitsBad.fill(fracChargedHitsBad);
m_hFractionNeutralHitsBad.fill(fracNeutralHitsBad);
- /*
- System.out.println("In this event, ECAL energy for charged particles with tracks: "
- +energyECAL_ChargedParticleWithTrack_ClusterWithTrack+" (particle with track -> cluster with track) "
- +energyECAL_ChargedParticleWithTrack_ClusterWithNoTrack+" (particle with track -> cluster with no track) ");
- System.out.println("In this event, ECAL energy for charged particles with no track: "
- +energyECAL_ChargedParticleWithNoTrack_ClusterWithTrack+" (particle with no track -> cluster with track) "
- +energyECAL_ChargedParticleWithNoTrack_ClusterWithNoTrack+" (particle with no track -> cluster with no track) ");
- System.out.println("In this event, ECAL energy for neutral particles: "
- +energyECAL_NeutralParticle_ClusterWithTrack+" (particle -> cluster with track) "
- +energyECAL_NeutralParticle_ClusterWithNoTrack+" (particle -> cluster with no track) ");
- System.out.println("In this event, HCAL hits for charged particles with tracks: "
- +hitsHCAL_ChargedParticleWithTrack_ClusterWithTrack+" (particle with track -> cluster with track) "
- +hitsHCAL_ChargedParticleWithTrack_ClusterWithNoTrack+" (particle with track -> cluster with no track) ");
- System.out.println("In this event, HCAL hits for charged particles with no track: "
- +hitsHCAL_ChargedParticleWithNoTrack_ClusterWithTrack+" (particle with no track -> cluster with track) "
- +hitsHCAL_ChargedParticleWithNoTrack_ClusterWithNoTrack+" (particle with no track -> cluster with no track) ");
- System.out.println("In this event, HCAL hits for neutral particles: "
- +hitsHCAL_NeutralParticle_ClusterWithTrack+" (particle -> cluster with track) "
- +hitsHCAL_NeutralParticle_ClusterWithNoTrack+" (particle -> cluster with no track) ");
- */
+ if (m_debug) {
+ System.out.println("In this event, ECAL energy for charged particles with tracks: "
+ +energyECAL_ChargedParticleWithTrack_ClusterWithTrack+" (particle with track -> cluster with track) "
+ +energyECAL_ChargedParticleWithTrack_ClusterWithNoTrack+" (particle with track -> cluster with no track) ");
+ System.out.println("In this event, ECAL energy for charged particles with no track: "
+ +energyECAL_ChargedParticleWithNoTrack_ClusterWithTrack+" (particle with no track -> cluster with track) "
+ +energyECAL_ChargedParticleWithNoTrack_ClusterWithNoTrack+" (particle with no track -> cluster with no track) ");
+ System.out.println("In this event, ECAL energy for neutral particles: "
+ +energyECAL_NeutralParticle_ClusterWithTrack+" (particle -> cluster with track) "
+ +energyECAL_NeutralParticle_ClusterWithNoTrack+" (particle -> cluster with no track) ");
+ System.out.println("In this event, HCAL hits for charged particles with tracks: "
+ +hitsHCAL_ChargedParticleWithTrack_ClusterWithTrack+" (particle with track -> cluster with track) "
+ +hitsHCAL_ChargedParticleWithTrack_ClusterWithNoTrack+" (particle with track -> cluster with no track) ");
+ System.out.println("In this event, HCAL hits for charged particles with no track: "
+ +hitsHCAL_ChargedParticleWithNoTrack_ClusterWithTrack+" (particle with no track -> cluster with track) "
+ +hitsHCAL_ChargedParticleWithNoTrack_ClusterWithNoTrack+" (particle with no track -> cluster with no track) ");
+ System.out.println("In this event, HCAL hits for neutral particles: "
+ +hitsHCAL_NeutralParticle_ClusterWithTrack+" (particle -> cluster with track) "
+ +hitsHCAL_NeutralParticle_ClusterWithNoTrack+" (particle -> cluster with no track) ");
+ }
double badECAL_track_to_notrack = energyECAL_ChargedParticleWithTrack_ClusterWithNoTrack;
double goodECAL_track_to_track = energyECAL_ChargedParticleWithTrack_ClusterWithTrack;
double badECAL_notrack_to_track = energyECAL_ChargedParticleWithNoTrack_ClusterWithTrack + energyECAL_NeutralParticle_ClusterWithTrack;
@@ -458,14 +454,14 @@
int goodHCAL_track_to_track = hitsHCAL_ChargedParticleWithTrack_ClusterWithTrack;
int badHCAL_notrack_to_track = hitsHCAL_ChargedParticleWithNoTrack_ClusterWithTrack + hitsHCAL_NeutralParticle_ClusterWithTrack;
int goodHCAL_notrack_to_notrack = hitsHCAL_ChargedParticleWithNoTrack_ClusterWithNoTrack + hitsHCAL_NeutralParticle_ClusterWithNoTrack;
- /*
- System.out.println("ECAL energy bad: "
- +badECAL_track_to_notrack+"/"+(badECAL_track_to_notrack+goodECAL_notrack_to_notrack)+" (seen as notrack) "
- +badECAL_notrack_to_track+"/"+(badECAL_notrack_to_track+goodECAL_track_to_track)+" (seen as track)");
- System.out.println("HCAL hits bad: "
- +badHCAL_track_to_notrack+"/"+(badHCAL_track_to_notrack+goodHCAL_notrack_to_notrack)+" (seen as notrack) "
- +badHCAL_notrack_to_track+"/"+(badHCAL_notrack_to_track+goodHCAL_track_to_track)+" (seen as track)");
- */
+ if (m_debug) {
+ System.out.println("ECAL energy bad: "
+ +badECAL_track_to_notrack+"/"+(badECAL_track_to_notrack+goodECAL_notrack_to_notrack)+" (seen as notrack) "
+ +badECAL_notrack_to_track+"/"+(badECAL_notrack_to_track+goodECAL_track_to_track)+" (seen as track)");
+ System.out.println("HCAL hits bad: "
+ +badHCAL_track_to_notrack+"/"+(badHCAL_track_to_notrack+goodHCAL_notrack_to_notrack)+" (seen as notrack) "
+ +badHCAL_notrack_to_track+"/"+(badHCAL_notrack_to_track+goodHCAL_track_to_track)+" (seen as track)");
+ }
m_hECAL_charged_track_to_track .fill(energyECAL_ChargedParticleWithTrack_ClusterWithTrack);
@@ -514,6 +510,8 @@
m_hHCAL_charged_notrack_fractionbad.fill(fraction_HCAL_chargednotrack_bad);
m_hHCAL_neutral_fractionbad .fill(fraction_HCAL_neutral_bad);
+ m_hHCAL_charged_track_fractionbad_2D.fill(fraction_HCAL_chargedtrack_bad, (hitsHCAL_ChargedParticleWithTrack_ClusterWithNoTrack+hitsHCAL_ChargedParticleWithTrack_ClusterWithTrack));
+
if (fraction_HCAL_chargedtrack_bad > 0.8) {
System.out.println("DEBUG: fraction HCAL chargedtrack bad = "+hitsHCAL_ChargedParticleWithTrack_ClusterWithNoTrack+" / "+(hitsHCAL_ChargedParticleWithTrack_ClusterWithNoTrack+hitsHCAL_ChargedParticleWithTrack_ClusterWithTrack)+" = "+fraction_HCAL_chargedtrack_bad);
System.out.println(eventDebugInfo);
@@ -525,10 +523,10 @@
double oldTotal = energySumCharged+energySumOldECAL+energySumOldHCAL+truthNeutrinoEnergySum;
double newTotal = energySumCharged+energySumRon+truthNeutrinoEnergySum;
- /*
- System.out.println("Charged energy in event = "+energySumCharged+" from "+countFoundTracks+" tracks, "+countChargedClusters+" charged clusters.");
- System.out.println("Neutral energy sum in event: old("+(energySumOldECAL+energySumOldHCAL)+"), new("+energySumRon+") and neutrinos="+truthNeutrinoEnergySum+" => total = old("+oldTotal+"), new("+newTotal+") from "+countNeutralClusters+" neutral clusters.");
- */
+ if (m_debug) {
+ System.out.println("Charged energy in event = "+energySumCharged+" from "+countFoundTracks+" tracks, "+countChargedClusters+" charged clusters.");
+ System.out.println("Neutral energy sum in event: old("+(energySumOldECAL+energySumOldHCAL)+"), new("+energySumRon+") and neutrinos="+truthNeutrinoEnergySum+" => total = old("+oldTotal+"), new("+newTotal+") from "+countNeutralClusters+" neutral clusters.");
+ }
double sampFracHCAL = (91.0 - energySumOldECAL - truthNeutrinoEnergySum - energySumCharged) / energySumOldHCAL;
//System.out.println("Sampling fraction in HCAL = "+sampFracHCAL);
m_hSampFrac.fill(sampFracHCAL);
@@ -607,5 +605,7 @@
}
return statusString;
}
+
+ boolean m_debug = false;
}