hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.1 -r1.2
--- TestRunRateAnalysis.java 21 Jun 2012 18:54:55 -0000 1.1
+++ TestRunRateAnalysis.java 30 Jul 2012 22:33:07 -0000 1.2
@@ -1,5 +1,6 @@
package org.lcsim.hps.recon.ecal;
+import hep.aida.IHistogram1D;
import hep.aida.IHistogram2D;
import java.util.List;
import org.lcsim.event.CalorimeterHit;
@@ -14,13 +15,15 @@
* Prints triggers to file if file path specified.
*
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: TestRunRateAnalysis.java,v 1.1 2012/06/21 18:54:55 meeg Exp $
+ * @version $Id: TestRunRateAnalysis.java,v 1.2 2012/07/30 22:33:07 meeg Exp $
*/
public class TestRunRateAnalysis extends Driver {
AIDA aida = AIDA.defaultInstance();
IHistogram2D eClusterVsP, photonEClusterVsP, electronEClusterVsP, positronEClusterVsP;
IHistogram2D eVsP, photonEVsP, electronEVsP, positronEVsP;
+ IHistogram1D eClusterOverP, photonEClusterOverP, electronEClusterOverP, positronEClusterOverP;
+ IHistogram1D eOverP, photonEOverP, electronEOverP, positronEOverP;
private String clusterCollectionName;
private String hitCollectionName = "EcalHits";
int nTriggers;
@@ -40,10 +43,20 @@
electronEClusterVsP = aida.histogram2D("Electron Cluster E vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
positronEClusterVsP = aida.histogram2D("Positron Cluster E vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
- eVsP = aida.histogram2D("All E vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
- photonEVsP = aida.histogram2D("Photon E vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
- electronEVsP = aida.histogram2D("Electron E vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
- positronEVsP = aida.histogram2D("Positron E vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
+ eClusterOverP = aida.histogram1D("Cluster E over Pz, Pz > 0.6", 100, 0.0, 2.0);
+ photonEClusterOverP = aida.histogram1D("Photon Cluster E over Pz, Pz > 0.6", 100, 0.0, 2.0);
+ electronEClusterOverP = aida.histogram1D("Electron Cluster E over Pz, Pz > 0.6", 100, 0.0, 2.0);
+ positronEClusterOverP = aida.histogram1D("Positron Cluster E over Pz, Pz > 0.6", 100, 0.0, 2.0);
+
+ eVsP = aida.histogram2D("All Edep vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
+ photonEVsP = aida.histogram2D("Photon Edep vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
+ electronEVsP = aida.histogram2D("Electron Edep vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
+ positronEVsP = aida.histogram2D("Positron Edep vs. Pz", 100, 0.0, 2000.0, 100, 0.0, 2000.0);
+
+ eOverP = aida.histogram1D("All Edep over Pz, Pz > 0.6", 100, 0.0, 2.0);
+ photonEOverP = aida.histogram1D("Photon Edep over Pz, Pz > 0.6", 100, 0.0, 2.0);
+ electronEOverP = aida.histogram1D("Electron Edep over Pz, Pz > 0.6", 100, 0.0, 2.0);
+ positronEOverP = aida.histogram1D("Positron Edep over Pz, Pz > 0.6", 100, 0.0, 2.0);
}
public void setClusterEnergyLow(double clusterEnergyLow) {
@@ -60,12 +73,12 @@
// MCParticles
List<MCParticle> mcparticles = event.get(MCParticle.class).get(0);
-// if (mcparticles.size() != 1) {
-// throw new RuntimeException("expected exactly 1 MCParticle");
-// }
if (mcparticles.isEmpty()) {
return;
}
+ if (mcparticles.size() != 1) {
+ throw new RuntimeException("expected exactly 1 MCParticle");
+ }
// MCParticle particle = mcparticles.get(0);
// Get the list of raw ECal hits.
@@ -88,12 +101,24 @@
for (MCParticle particle : mcparticles) {
if (ParticleTypeClassifier.isElectron(particle.getPDGID())) {
electronEClusterVsP.fill(1000.0 * particle.getPZ(), 1000.0 * cluster.getEnergy());
+ if (particle.getPZ() > 0.6) {
+ electronEClusterOverP.fill(cluster.getEnergy() / particle.getPZ());
+ }
} else if (ParticleTypeClassifier.isPositron(particle.getPDGID())) {
positronEClusterVsP.fill(1000.0 * particle.getPZ(), 1000.0 * cluster.getEnergy());
+ if (particle.getPZ() > 0.6) {
+ positronEClusterOverP.fill(cluster.getEnergy() / particle.getPZ());
+ }
} else if (ParticleTypeClassifier.isPhoton(particle.getPDGID())) {
photonEClusterVsP.fill(1000.0 * particle.getPZ(), 1000.0 * cluster.getEnergy());
+ if (particle.getPZ() > 0.6) {
+ photonEClusterOverP.fill(cluster.getEnergy() / particle.getPZ());
+ }
}
eClusterVsP.fill(1000.0 * particle.getPZ(), 1000.0 * cluster.getEnergy());
+ if (particle.getPZ() > 0.6) {
+ eClusterOverP.fill(cluster.getEnergy() / particle.getPZ());
+ }
}
}
}
@@ -113,12 +138,24 @@
for (MCParticle particle : mcparticles) {
if (ParticleTypeClassifier.isElectron(particle.getPDGID())) {
electronEVsP.fill(1000.0 * particle.getPZ(), 1000.0 * totalE);
+ if (particle.getPZ() > 0.6) {
+ electronEOverP.fill(totalE / particle.getPZ());
+ }
} else if (ParticleTypeClassifier.isPositron(particle.getPDGID())) {
positronEVsP.fill(1000.0 * particle.getPZ(), 1000.0 * totalE);
+ if (particle.getPZ() > 0.6) {
+ positronEOverP.fill(totalE / particle.getPZ());
+ }
} else if (ParticleTypeClassifier.isPhoton(particle.getPDGID())) {
photonEVsP.fill(1000.0 * particle.getPZ(), 1000.0 * totalE);
+ if (particle.getPZ() > 0.6) {
+ photonEOverP.fill(totalE / particle.getPZ());
+ }
}
eVsP.fill(1000.0 * particle.getPZ(), 1000.0 * totalE);
+ if (particle.getPZ() > 0.6) {
+ eOverP.fill(totalE / particle.getPZ());
+ }
}
}