SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.1 -r1.2
--- MCParticleInfo.java 7 Sep 2005 05:47:03 -0000 1.1
+++ MCParticleInfo.java 12 Oct 2005 01:09:03 -0000 1.2
@@ -17,6 +17,7 @@
int pdgid;
String name;
double eventEnergy=0;
+ double charge=java.lang.Double.NaN;
int eventHits=0;
static ParticlePropertyProvider mcpLkp
@@ -27,6 +28,7 @@
{
this.pdgid = pdgid;
name = mcpLkp.get(pdgid).getName();
+ charge = mcpLkp.get(pdgid).getCharge();
}
String getName()
@@ -39,6 +41,11 @@
return pdgid;
}
+ double getCharge()
+ {
+ return charge;
+ }
+
void addEventEnergy(double incr)
{
eventEnergy += incr;
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.14 -r1.15
--- MCParticlePlots.java 30 Sep 2005 20:06:28 -0000 1.14
+++ MCParticlePlots.java 12 Oct 2005 01:09:04 -0000 1.15
@@ -57,6 +57,7 @@
IHistogram1D mcpKE;
ICloud1D mcpFSCount;
ICloud1D mcpNoEndPoint;
+ ICloud1D mcpNeutralCount, mcpPositiveCount, mcpNegativeCount, mcpChargedCount;
Map<String, Integer> particleCounts = new HashMap<String,Integer>();
@@ -88,6 +89,10 @@
mcpKE = aida.histogram1D(makePlotName("Kinetic Energy"), 200, 0.0, 10.0);
mcpNoEndPoint = aida.cloud1D(makePlotName("No End Point"));
mcpBackscatterNotPEP = aida.cloud1D(makePlotName("Backscattered Particles without vertexIsNotEndPointOfParent flag"));
+ mcpNeutralCount = aida.cloud1D(makePlotName("Neutral Charge Count by Event"));
+ mcpPositiveCount = aida.cloud1D(makePlotName("Positive Charge Count by Event"));
+ mcpNegativeCount = aida.cloud1D(makePlotName("Negative Particle Count by Event"));
+ mcpChargedCount = aida.cloud1D(makePlotName("Charged Particle Count by Event"));
}
protected void fill(EventHeader event)
@@ -114,7 +119,7 @@
particleCounts.clear();
int FSCount = 0;
int backscatterNotPEPCount = 0;
- int noEndPointCount = 0;
+ int noEndPointCount = 0;
totE = 0;
for ( MCParticle particle : particles)
{
@@ -274,6 +279,8 @@
}
}
+ int nPositive, nNeutral, nNegative;
+ nPositive = nNeutral = nNegative = 0;
for ( MCParticleInfo info : mcpMap.values() )
{
String k = info.getName();
@@ -302,6 +309,20 @@
info.resetTotals();
+ double charge = info.getCharge();
+ if ( charge > 0 )
+ {
+ ++nPositive;
+ }
+ else if ( charge < 0 )
+ {
+ ++nNegative;
+ }
+ else
+ {
+ ++nNeutral;
+ }
+
tree.cd("..");
}
@@ -319,6 +340,12 @@
/* backscatter w/o vertexIsNotEndpointOfParent flag set */
mcpBackscatterNotPEP.fill(backscatterNotPEPCount);
+
+ /* charge count */
+ mcpNeutralCount.fill(nNeutral);
+ mcpPositiveCount.fill(nPositive);
+ mcpNegativeCount.fill(nNegative);
+ mcpChargedCount.fill(nPositive + nNegative);
}
}