SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.8 -r1.9
--- MCParticlePlots.java 20 Aug 2005 05:24:19 -0000 1.8
+++ MCParticlePlots.java 21 Aug 2005 03:57:24 -0000 1.9
@@ -52,6 +52,7 @@
ICloud1D mcpEnergyFinalState;
IHistogram1D mcpKE;
ICloud1D mcpFSCount;
+ ICloud1D mcpNoEndPoint;
Map<String, Integer> particleCounts = new HashMap<String,Integer>();
@@ -87,7 +88,8 @@
mcpVtxToEPDist = aida.cloud1D(makePlotName("Vertex to Endpoint Distance"));
mcpVtxToEPDistLTMeV = aida.histogram1D(makePlotName("Vertex to Endpoint Distance for kE < 1 MeV"), 500, 0., 2000.0);
mcpVtxToEPDistGTMeV = aida.histogram1D(makePlotName("Vertex to Endpoint Distance for kE > 1 MeV"), 200, 0., 24000.0);
- mcpKE = aida.histogram1D(makePlotName("Kinetic Energy"), 200, 0.0, 10.0);
+ mcpKE = aida.histogram1D(makePlotName("Kinetic Energy"), 200, 0.0, 10.0);
+ mcpNoEndPoint = aida.cloud1D(makePlotName("No End Point"));
}
public void fill()
@@ -105,9 +107,10 @@
{
particleCounts.clear();
int FSCount = 0;
+ int noEndPointCount = 0;
totE = 0;
for ( MCParticle particle : particles)
- {
+ {
/* generator status */
mcpGenStatus.fill(particle.getGeneratorStatus());
@@ -131,24 +134,40 @@
mcpPhi.fill(VecOp.phi(particle.getMomentum()));
/* vtx to EP distance */
- double vtxEPdist = computeVertexToEndpointDistance(particle.getOrigin(), particle.getEndPoint());
- if ( vtxEPdist != 0 )
+ boolean hasEndpoint = true;
+ Hep3Vector endpoint = null;
+ try
{
- mcpVtxToEPDist.fill(vtxEPdist);
-
- double kE = particle.getEnergy() - particle.getMass();
-
- mcpKE.fill(kE);
-
- if ( kE < 0.001 )
- {
- /* vtx to EP distance for kE < 1 MeV */
- mcpVtxToEPDistLTMeV.fill(vtxEPdist);
- }
- else
+ endpoint = particle.getEndPoint();
+ }
+ catch (RuntimeException rte)
+ {
+ hasEndpoint = false;
+ noEndPointCount += 1;
+ }
+
+ double vtxEPdist = 0.0;
+ if ( hasEndpoint )
+ {
+ vtxEPdist = computeVertexToEndpointDistance(particle.getOrigin(), endpoint);
+ if ( vtxEPdist != 0 )
{
- /* vtx to EP distance for kE > 1 MeV */
- mcpVtxToEPDistGTMeV.fill(vtxEPdist);
+ mcpVtxToEPDist.fill(vtxEPdist);
+
+ double kE = particle.getEnergy() - particle.getMass();
+
+ mcpKE.fill(kE);
+
+ if ( kE < 0.001 )
+ {
+ /* vtx to EP distance for kE < 1 MeV */
+ mcpVtxToEPDistLTMeV.fill(vtxEPdist);
+ }
+ else
+ {
+ /* vtx to EP distance for kE > 1 MeV */
+ mcpVtxToEPDistGTMeV.fill(vtxEPdist);
+ }
}
}
@@ -157,7 +176,7 @@
{
FSCount += 1;
totE += particle.getEnergy();
-
+
mcpEnergyFinalState.fill(particle.getEnergy());
String particleName = mcpLkp.get(particle.getPDGID()).getName();
@@ -176,11 +195,11 @@
/* particle energy */
aida.cloud1D(makePlotName(particleName + ": Energy")).fill(particle.getEnergy());
- /* momentum = x2 + y2 + z2 */
+ /* momentum -> x2 + y2 + z2 */
aida.cloud1D(makePlotName(particleName + ": Momentum")).fill(
particle.getPX() * particle.getPX() +
particle.getPY() + particle.getPY() +
- particle.getPZ() + particle.getPZ()
+ particle.getPZ() + particle.getPZ()
);
/* particle momentum -> theta, phi */
@@ -189,18 +208,21 @@
HitUtil.getPhi(particle.getMomentum().v())
);
- /* particle cosTheta */
+ /* particle momentum -> cosTheta */
aida.cloud1D(makePlotName(particleName + ": Momentum CosTheta")).fill(
VecOp.cosTheta(particle.getMomentum()));
-
- /* vertex to endpoint distance */
- aida.cloud1D(makePlotName(particleName + ": Vertex to Endpoint Distance")).fill(
- vtxEPdist);
- /* endpoint RZ */
- aida.cloud2D(makePlotName(particleName + ": Endpoint R vs Z")).fill(
- HitUtil.getCylindricalRadius(particle.getEndPoint().v()),
- particle.getEndPoint().z());
+ /* vertex to endpoint distance */
+ if ( hasEndpoint )
+ {
+ aida.cloud1D(makePlotName(particleName + ": Vertex to Endpoint Distance")).fill(
+ vtxEPdist);
+
+ /* endpoint RZ */
+ aida.cloud2D(makePlotName(particleName + ": Endpoint R vs Z")).fill(
+ HitUtil.getCylindricalRadius(particle.getEndPoint().v()),
+ particle.getEndPoint().z());
+ }
/* increment particle count */
if ( particleCounts.containsKey(particleName) )
@@ -235,6 +257,9 @@
/* total number of FS particles */
mcpFSCount.fill(FSCount);
+
+ /* # MCPs w/o endpoints */
+ mcpNoEndPoint.fill(noEndPointCount);
}
}